wlan_cmn.h 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. /*
  2. * Copyright (c) 2016-2017 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. /* Max vdev_id */
  40. #define WLAN_UMAC_VDEV_ID_MAX 0xFF
  41. /* 802.11 cap info */
  42. #define WLAN_CAPINFO_ESS 0x0001
  43. #define WLAN_CAPINFO_IBSS 0x0002
  44. #define WLAN_CAPINFO_CF_POLLABLE 0x0004
  45. #define WLAN_CAPINFO_CF_POLLREQ 0x0008
  46. #define WLAN_CAPINFO_PRIVACY 0x0010
  47. #define WLAN_CAPINFO_SHORT_PREAMBLE 0x0020
  48. #define WLAN_CAPINFO_PBCC 0x0040
  49. #define WLAN_CAPINFO_CHNL_AGILITY 0x0080
  50. #define WLAN_CAPINFO_SPECTRUM_MGMT 0x0100
  51. #define WLAN_CAPINFO_QOS 0x0200
  52. #define WLAN_CAPINFO_SHORT_SLOTTIME 0x0400
  53. #define WLAN_CAPINFO_APSD 0x0800
  54. #define WLAN_CAPINFO_RADIOMEAS 0x1000
  55. #define WLAN_CAPINFO_DSSSOFDM 0x2000
  56. /* Allowed time to wait for Object creation */
  57. #define WLAN_VDEV_CREATE_TIMEOUT_CNT 300
  58. /* 25 msec */
  59. #define WLAN_VDEV_CREATE_TIMEOUT 25
  60. #define WLAN_PDEV_CREATE_TIMEOUT_CNT 300
  61. /* 25 msec */
  62. #define WLAN_PDEV_CREATE_TIMEOUT 25
  63. #define WLAN_PSOC_CREATE_TIMEOUT_CNT 300
  64. /* 25 msec */
  65. #define WLAN_PSOC_CREATE_TIMEOUT 25
  66. /**
  67. * enum wlan_umac_comp_id - UMAC component id
  68. * @WLAN_UMAC_COMP_MLME: MLME
  69. * @WLAN_UMAC_COMP_SCANMGR: SCAN MGR
  70. * @WLAN_UMAC_COMP_SCANCACHE: SCAN CACHE
  71. * @WLAN_UMAC_COMP_MGMT_TXRX: MGMT Tx/Rx
  72. *
  73. * This id is static.
  74. * On Adding new component, new id has to be assigned
  75. */
  76. enum wlan_umac_comp_id {
  77. WLAN_UMAC_COMP_MLME = 0,
  78. WLAN_UMAC_COMP_SCANMGR = 1,
  79. WLAN_UMAC_COMP_SCANCACHE = 2,
  80. WLAN_UMAC_COMP_MGMT_TXRX = 3,
  81. };
  82. /**
  83. * enum WLAN_DEV_TYPE - for DA or OL architecture types
  84. * @WLAN_DEV_DA: Direct attach
  85. * @WLAN_DEV_OL: Partial offload
  86. * @WLAN_DEV_INVALID: Invalid dev type
  87. */
  88. typedef enum {
  89. WLAN_DEV_DA = 0,
  90. WLAN_DEV_OL = 1,
  91. WLAN_DEV_INVALID = 3,
  92. } WLAN_DEV_TYPE;
  93. /**
  94. * enum wlan_phymode - phy mode
  95. * @WLAN_PHYMODE_AUTO: autoselect
  96. * @WLAN_PHYMODE_11A: 5GHz, OFDM
  97. * @WLAN_PHYMODE_11B: 2GHz, CCK
  98. * @WLAN_PHYMODE_11G: 2GHz, OFDM
  99. * @WLAN_PHYMODE_11NA_HT20: 5Ghz, HT20
  100. * @WLAN_PHYMODE_11NG_HT20: 2Ghz, HT20
  101. * @WLAN_PHYMODE_11NA_HT40PLUS: 5Ghz, HT40 (ext ch +1)
  102. * @WLAN_PHYMODE_11NA_HT40MINUS: 5Ghz, HT40 (ext ch -1)
  103. * @WLAN_PHYMODE_11NG_HT40PLUS: 2Ghz, HT40 (ext ch +1)
  104. * @WLAN_PHYMODE_11NG_HT40MINUS: 2Ghz, HT40 (ext ch -1)
  105. * @WLAN_PHYMODE_11NG_HT40: 2Ghz, Auto HT40
  106. * @WLAN_PHYMODE_11NA_HT40: 5Ghz, Auto HT40
  107. * @WLAN_PHYMODE_11AC_VHT20: 5Ghz, VHT20
  108. * @WLAN_PHYMODE_11AC_VHT40PLUS: 5Ghz, VHT40 (Ext ch +1)
  109. * @WLAN_PHYMODE_11AC_VHT40MINUS:5Ghz VHT40 (Ext ch -1)
  110. * @WLAN_PHYMODE_11AC_VHT40: 5Ghz, VHT40
  111. * @WLAN_PHYMODE_11AC_VHT80: 5Ghz, VHT80
  112. * @WLAN_PHYMODE_11AC_VHT160: 5Ghz, VHT160
  113. * @WLAN_PHYMODE_11AC_VHT80_80: 5Ghz, VHT80_80
  114. */
  115. enum wlan_phymode {
  116. WLAN_PHYMODE_AUTO = 0,
  117. WLAN_PHYMODE_11A = 1,
  118. WLAN_PHYMODE_11B = 2,
  119. WLAN_PHYMODE_11G = 3,
  120. WLAN_PHYMODE_11NA_HT20 = 4,
  121. WLAN_PHYMODE_11NG_HT20 = 5,
  122. WLAN_PHYMODE_11NA_HT40PLUS = 6,
  123. WLAN_PHYMODE_11NA_HT40MINUS = 7,
  124. WLAN_PHYMODE_11NG_HT40PLUS = 8,
  125. WLAN_PHYMODE_11NG_HT40MINUS = 9,
  126. WLAN_PHYMODE_11NG_HT40 = 10,
  127. WLAN_PHYMODE_11NA_HT40 = 11,
  128. WLAN_PHYMODE_11AC_VHT20 = 12,
  129. WLAN_PHYMODE_11AC_VHT40PLUS = 13,
  130. WLAN_PHYMODE_11AC_VHT40MINUS = 14,
  131. WLAN_PHYMODE_11AC_VHT40 = 15,
  132. WLAN_PHYMODE_11AC_VHT80 = 16,
  133. WLAN_PHYMODE_11AC_VHT160 = 17,
  134. WLAN_PHYMODE_11AC_VHT80_80 = 18,
  135. };
  136. #define WLAN_PHYMODE_MAX (WLAN_PHYMODE_11AC_VHT80_80 + 1)
  137. /**
  138. * enum wlan_peer_type - peer type
  139. * @WLAN_PEER_SELF: for AP mode, SELF PEER or AP PEER are same
  140. * @WLAN_PEER_AP: BSS peer for STA mode, Self peer for AP mode
  141. * @WLAN_PEER_STA: Self Peer for STA mode, STA peer for AP mode
  142. * @WLAN_PEER_TDLS: TDLS Peer
  143. * @WLAN_PEER_NAWDS: NAWDS Peer
  144. * @WLAN_PEER_STA_TEMP: STA Peer Temp (its host only node)
  145. * @WLAN_PEER_IBSS: IBSS Peer
  146. */
  147. enum wlan_peer_type {
  148. WLAN_PEER_SELF = 1,
  149. WLAN_PEER_AP = 2,
  150. WLAN_PEER_STA = 3,
  151. WLAN_PEER_TDLS = 4,
  152. WLAN_PEER_NAWDS = 5,
  153. WLAN_PEER_STA_TEMP = 6,
  154. WLAN_PEER_IBSS = 7,
  155. };
  156. /* MAC address length */
  157. #define WLAN_MACADDR_LEN 6
  158. /* Util API to copy the MAC address */
  159. #define WLAN_ADDR_COPY(dst, src) qdf_mem_copy(dst, src, WLAN_MACADDR_LEN)
  160. /* Util API to compare the MAC address */
  161. #define WLAN_ADDR_EQ(a1, a2) qdf_mem_cmp(a1, a2, WLAN_MACADDR_LEN)
  162. #endif /* _WLAN_OBJMGR_CMN_H_*/