wlan_cmn.h 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. /*
  2. * Copyright (c) 2016 The Linux Foundation. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for
  5. * any purpose with or without fee is hereby granted, provided that the
  6. * above copyright notice and this permission notice appear in all
  7. * copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  10. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  11. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  12. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  13. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  14. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  15. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  16. * PERFORMANCE OF THIS SOFTWARE.
  17. */
  18. /**
  19. * DOC: This file provides the common definitions for object manager
  20. */
  21. #ifndef _WLAN_CMN_H_
  22. #define _WLAN_CMN_H_
  23. /* Max no of UMAC components */
  24. #define WLAN_UMAC_MAX_COMPONENTS 25
  25. /* Max no. of radios, a pSoc/Device can support */
  26. #define WLAN_UMAC_MAX_PDEVS 3
  27. /* Max no. of VDEV per PSOC */
  28. #define WLAN_UMAC_PSOC_MAX_VDEVS 51
  29. /* Max no. of VDEVs, a PDEV can support */
  30. #define WLAN_UMAC_PDEV_MAX_VDEVS 17
  31. /* Max no. of Peers, a device can support */
  32. #define WLAN_UMAC_PSOC_MAX_PEERS 1024
  33. /* Max length of a SSID */
  34. #define WLAN_SSID_MAX_LEN 32
  35. /* Max no. of Stations can be associated to VDEV*/
  36. #define WLAN_UMAC_MAX_AP_PEERS WLAN_UMAC_PSOC_MAX_PEERS
  37. /* Max no. of peers for STA vap */
  38. #define WLAN_UMAC_MAX_STA_PEERS 2
  39. /* 802.11 cap info */
  40. #define WLAN_CAPINFO_ESS 0x0001
  41. #define WLAN_CAPINFO_IBSS 0x0002
  42. #define WLAN_CAPINFO_CF_POLLABLE 0x0004
  43. #define WLAN_CAPINFO_CF_POLLREQ 0x0008
  44. #define WLAN_CAPINFO_PRIVACY 0x0010
  45. #define WLAN_CAPINFO_SHORT_PREAMBLE 0x0020
  46. #define WLAN_CAPINFO_PBCC 0x0040
  47. #define WLAN_CAPINFO_CHNL_AGILITY 0x0080
  48. #define WLAN_CAPINFO_SPECTRUM_MGMT 0x0100
  49. #define WLAN_CAPINFO_QOS 0x0200
  50. #define WLAN_CAPINFO_SHORT_SLOTTIME 0x0400
  51. #define WLAN_CAPINFO_APSD 0x0800
  52. #define WLAN_CAPINFO_RADIOMEAS 0x1000
  53. #define WLAN_CAPINFO_DSSSOFDM 0x2000
  54. /* Allowed time to wait for Object creation */
  55. #define WLAN_VDEV_CREATE_TIMEOUT_CNT 300
  56. /* 25 msec */
  57. #define WLAN_VDEV_CREATE_TIMEOUT ((CONVERT_SEC_TO_SYSTEM_TIME(1)/40) + 1)
  58. #define WLAN_PDEV_CREATE_TIMEOUT_CNT 300
  59. /* 25 msec */
  60. #define WLAN_PDEV_CREATE_TIMEOUT ((CONVERT_SEC_TO_SYSTEM_TIME(1)/40) + 1)
  61. #define WLAN_PSOC_CREATE_TIMEOUT_CNT 300
  62. /* 25 msec */
  63. #define WLAN_PSOC_CREATE_TIMEOUT ((CONVERT_SEC_TO_SYSTEM_TIME(1)/40) + 1)
  64. /**
  65. * enum wlan_umac_comp_id - UMAC component id
  66. * @WLAN_UMAC_COMP_MLME: MLME
  67. * @WLAN_UMAC_COMP_SCANMGR: SCAN MGR
  68. * @WLAN_UMAC_COMP_SCANCACHE: SCAN CACHE
  69. * @WLAN_UMAC_COMP_MGMT_TXRX: MGMT Tx/Rx
  70. *
  71. * This id is static.
  72. * On Adding new component, new id has to be assigned
  73. */
  74. enum wlan_umac_comp_id {
  75. WLAN_UMAC_COMP_MLME = 0,
  76. WLAN_UMAC_COMP_SCANMGR = 1,
  77. WLAN_UMAC_COMP_SCANCACHE = 2,
  78. WLAN_UMAC_COMP_MGMT_TXRX = 3,
  79. };
  80. /**
  81. * enum WLAN_DEV_TYPE - for DA or OL architecture types
  82. * @WLAN_DEV_DA: Direct attach
  83. * @WLAN_DEV_OL: Partial offload
  84. * @WLAN_DEV_INVALID: Invalid dev type
  85. */
  86. typedef enum {
  87. WLAN_DEV_DA = 0,
  88. WLAN_DEV_OL = 1,
  89. WLAN_DEV_INVALID = 3,
  90. } WLAN_DEV_TYPE;
  91. /**
  92. * enum wlan_phymode - phy mode
  93. * @WLAN_PHYMODE_AUTO: autoselect
  94. * @WLAN_PHYMODE_11A: 5GHz, OFDM
  95. * @WLAN_PHYMODE_11B: 2GHz, CCK
  96. * @WLAN_PHYMODE_11G: 2GHz, OFDM
  97. * @WLAN_PHYMODE_11NA_HT20: 5Ghz, HT20
  98. * @WLAN_PHYMODE_11NG_HT20: 2Ghz, HT20
  99. * @WLAN_PHYMODE_11NA_HT40PLUS: 5Ghz, HT40 (ext ch +1)
  100. * @WLAN_PHYMODE_11NA_HT40MINUS: 5Ghz, HT40 (ext ch -1)
  101. * @WLAN_PHYMODE_11NG_HT40PLUS: 2Ghz, HT40 (ext ch +1)
  102. * @WLAN_PHYMODE_11NG_HT40MINUS: 2Ghz, HT40 (ext ch -1)
  103. * @WLAN_PHYMODE_11NG_HT40: 2Ghz, Auto HT40
  104. * @WLAN_PHYMODE_11NA_HT40: 5Ghz, Auto HT40
  105. * @WLAN_PHYMODE_11AC_VHT20: 5Ghz, VHT20
  106. * @WLAN_PHYMODE_11AC_VHT40PLUS: 5Ghz, VHT40 (Ext ch +1)
  107. * @WLAN_PHYMODE_11AC_VHT40MINUS:5Ghz VHT40 (Ext ch -1)
  108. * @WLAN_PHYMODE_11AC_VHT40: 5Ghz, VHT40
  109. * @WLAN_PHYMODE_11AC_VHT80: 5Ghz, VHT80
  110. * @WLAN_PHYMODE_11AC_VHT160: 5Ghz, VHT160
  111. * @WLAN_PHYMODE_11AC_VHT80_80: 5Ghz, VHT80_80
  112. */
  113. enum wlan_phymode {
  114. WLAN_PHYMODE_AUTO = 0,
  115. WLAN_PHYMODE_11A = 1,
  116. WLAN_PHYMODE_11B = 2,
  117. WLAN_PHYMODE_11G = 3,
  118. WLAN_PHYMODE_11NA_HT20 = 4,
  119. WLAN_PHYMODE_11NG_HT20 = 5,
  120. WLAN_PHYMODE_11NA_HT40PLUS = 6,
  121. WLAN_PHYMODE_11NA_HT40MINUS = 7,
  122. WLAN_PHYMODE_11NG_HT40PLUS = 8,
  123. WLAN_PHYMODE_11NG_HT40MINUS = 9,
  124. WLAN_PHYMODE_11NG_HT40 = 10,
  125. WLAN_PHYMODE_11NA_HT40 = 11,
  126. WLAN_PHYMODE_11AC_VHT20 = 12,
  127. WLAN_PHYMODE_11AC_VHT40PLUS = 13,
  128. WLAN_PHYMODE_11AC_VHT40MINUS = 14,
  129. WLAN_PHYMODE_11AC_VHT40 = 15,
  130. WLAN_PHYMODE_11AC_VHT80 = 16,
  131. WLAN_PHYMODE_11AC_VHT160 = 17,
  132. WLAN_PHYMODE_11AC_VHT80_80 = 18,
  133. };
  134. #define WLAN_PHYMODE_MAX (WLAN_PHYMODE_11AC_VHT80_80 + 1)
  135. /**
  136. * enum wlan_peer_type - peer type
  137. * @WLAN_PEER_SELF: for AP mode, SELF PEER or AP PEER are same
  138. * @WLAN_PEER_AP: BSS peer for STA mode, Self peer for AP mode
  139. * @WLAN_PEER_STA: Self Peer for STA mode, STA peer for AP mode
  140. * @WLAN_PEER_TDLS: TDLS Peer
  141. * @WLAN_PEER_NAWDS: NAWDS Peer
  142. * @WLAN_PEER_STA_TEMP: STA Peer Temp (its host only node)
  143. */
  144. enum wlan_peer_type {
  145. WLAN_PEER_SELF = 1,
  146. WLAN_PEER_AP = 2,
  147. WLAN_PEER_STA = 3,
  148. WLAN_PEER_TDLS = 4,
  149. WLAN_PEER_NAWDS = 5,
  150. WLAN_PEER_STA_TEMP = 6,
  151. };
  152. /* MAC address length */
  153. #define WLAN_MACADDR_LEN 6
  154. /* Util API to copy the MAC address */
  155. #define WLAN_ADDR_COPY(dst, src) qdf_mem_copy(dst, src, WLAN_MACADDR_LEN)
  156. /* Util API to compare the MAC address */
  157. #define WLAN_ADDR_EQ(a1, a2) qdf_mem_cmp(a1, a2, WLAN_MACADDR_LEN)
  158. #endif /* _WLAN_OBJMGR_CMN_H_*/