fw.h 37 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360
  1. /*
  2. * Marvell Wireless LAN device driver: Firmware specific macros & structures
  3. *
  4. * Copyright (C) 2011, Marvell International Ltd.
  5. *
  6. * This software file (the "File") is distributed by Marvell International
  7. * Ltd. under the terms of the GNU General Public License Version 2, June 1991
  8. * (the "License"). You may use, redistribute and/or modify this File in
  9. * accordance with the terms and conditions of the License, a copy of which
  10. * is available by writing to the Free Software Foundation, Inc.,
  11. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
  12. * worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
  13. *
  14. * THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
  15. * IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
  16. * ARE EXPRESSLY DISCLAIMED. The License provides additional details about
  17. * this warranty disclaimer.
  18. */
  19. #ifndef _MWIFIEX_FW_H_
  20. #define _MWIFIEX_FW_H_
  21. #include <linux/if_ether.h>
  22. #define INTF_HEADER_LEN 4
  23. struct rfc_1042_hdr {
  24. u8 llc_dsap;
  25. u8 llc_ssap;
  26. u8 llc_ctrl;
  27. u8 snap_oui[3];
  28. u16 snap_type;
  29. };
  30. struct rx_packet_hdr {
  31. struct ethhdr eth803_hdr;
  32. struct rfc_1042_hdr rfc1042_hdr;
  33. };
  34. struct tx_packet_hdr {
  35. struct ethhdr eth803_hdr;
  36. struct rfc_1042_hdr rfc1042_hdr;
  37. };
  38. #define B_SUPPORTED_RATES 5
  39. #define G_SUPPORTED_RATES 9
  40. #define BG_SUPPORTED_RATES 13
  41. #define A_SUPPORTED_RATES 9
  42. #define HOSTCMD_SUPPORTED_RATES 14
  43. #define N_SUPPORTED_RATES 3
  44. #define ALL_802_11_BANDS (BAND_A | BAND_B | BAND_G | BAND_GN)
  45. #define FW_MULTI_BANDS_SUPPORT (BIT(8) | BIT(9) | BIT(10) | BIT(11))
  46. #define IS_SUPPORT_MULTI_BANDS(adapter) \
  47. (adapter->fw_cap_info & FW_MULTI_BANDS_SUPPORT)
  48. #define GET_FW_DEFAULT_BANDS(adapter) \
  49. ((adapter->fw_cap_info >> 8) & ALL_802_11_BANDS)
  50. #define SHORT_SLOT_TIME_DISABLED(CapInfo) (CapInfo &= ~BIT(10))
  51. #define SHORT_SLOT_TIME_ENABLED(CapInfo) (CapInfo |= BIT(10))
  52. extern u8 supported_rates_b[B_SUPPORTED_RATES];
  53. extern u8 supported_rates_g[G_SUPPORTED_RATES];
  54. extern u8 supported_rates_bg[BG_SUPPORTED_RATES];
  55. extern u8 supported_rates_a[A_SUPPORTED_RATES];
  56. extern u8 supported_rates_n[N_SUPPORTED_RATES];
  57. #define HostCmd_WEP_KEY_INDEX_MASK 0x3fff
  58. #define KEY_INFO_ENABLED 0x01
  59. enum KEY_TYPE_ID {
  60. KEY_TYPE_ID_WEP = 0,
  61. KEY_TYPE_ID_TKIP,
  62. KEY_TYPE_ID_AES,
  63. KEY_TYPE_ID_WAPI,
  64. };
  65. enum KEY_INFO_WEP {
  66. KEY_INFO_WEP_MCAST = 0x01,
  67. KEY_INFO_WEP_UNICAST = 0x02,
  68. KEY_INFO_WEP_ENABLED = 0x04
  69. };
  70. enum KEY_INFO_TKIP {
  71. KEY_INFO_TKIP_MCAST = 0x01,
  72. KEY_INFO_TKIP_UNICAST = 0x02,
  73. KEY_INFO_TKIP_ENABLED = 0x04
  74. };
  75. enum KEY_INFO_AES {
  76. KEY_INFO_AES_MCAST = 0x01,
  77. KEY_INFO_AES_UNICAST = 0x02,
  78. KEY_INFO_AES_ENABLED = 0x04
  79. };
  80. #define WAPI_KEY_LEN 50
  81. enum KEY_INFO_WAPI {
  82. KEY_INFO_WAPI_MCAST = 0x01,
  83. KEY_INFO_WAPI_UNICAST = 0x02,
  84. KEY_INFO_WAPI_ENABLED = 0x04
  85. };
  86. #define MAX_POLL_TRIES 100
  87. #define MAX_MULTI_INTERFACE_POLL_TRIES 1000
  88. #define MAX_FIRMWARE_POLL_TRIES 100
  89. #define FIRMWARE_READY 0xfedc
  90. #define FIRMWARE_TRANSFER_NBLOCK 2
  91. enum MWIFIEX_802_11_PRIVACY_FILTER {
  92. MWIFIEX_802_11_PRIV_FILTER_ACCEPT_ALL,
  93. MWIFIEX_802_11_PRIV_FILTER_8021X_WEP
  94. };
  95. enum MWIFIEX_802_11_WEP_STATUS {
  96. MWIFIEX_802_11_WEP_ENABLED,
  97. MWIFIEX_802_11_WEP_DISABLED,
  98. };
  99. #define CAL_SNR(RSSI, NF) ((s16)((s16)(RSSI)-(s16)(NF)))
  100. #define PROPRIETARY_TLV_BASE_ID 0x0100
  101. #define TLV_TYPE_KEY_MATERIAL (PROPRIETARY_TLV_BASE_ID + 0)
  102. #define TLV_TYPE_CHANLIST (PROPRIETARY_TLV_BASE_ID + 1)
  103. #define TLV_TYPE_NUMPROBES (PROPRIETARY_TLV_BASE_ID + 2)
  104. #define TLV_TYPE_RSSI_LOW (PROPRIETARY_TLV_BASE_ID + 4)
  105. #define TLV_TYPE_SNR_LOW (PROPRIETARY_TLV_BASE_ID + 5)
  106. #define TLV_TYPE_FAILCOUNT (PROPRIETARY_TLV_BASE_ID + 6)
  107. #define TLV_TYPE_BCNMISS (PROPRIETARY_TLV_BASE_ID + 7)
  108. #define TLV_TYPE_LEDBEHAVIOR (PROPRIETARY_TLV_BASE_ID + 9)
  109. #define TLV_TYPE_PASSTHROUGH (PROPRIETARY_TLV_BASE_ID + 10)
  110. #define TLV_TYPE_POWER_TBL_2_4GHZ (PROPRIETARY_TLV_BASE_ID + 12)
  111. #define TLV_TYPE_POWER_TBL_5GHZ (PROPRIETARY_TLV_BASE_ID + 13)
  112. #define TLV_TYPE_WMMQSTATUS (PROPRIETARY_TLV_BASE_ID + 16)
  113. #define TLV_TYPE_WILDCARDSSID (PROPRIETARY_TLV_BASE_ID + 18)
  114. #define TLV_TYPE_TSFTIMESTAMP (PROPRIETARY_TLV_BASE_ID + 19)
  115. #define TLV_TYPE_RSSI_HIGH (PROPRIETARY_TLV_BASE_ID + 22)
  116. #define TLV_TYPE_SNR_HIGH (PROPRIETARY_TLV_BASE_ID + 23)
  117. #define TLV_TYPE_STARTBGSCANLATER (PROPRIETARY_TLV_BASE_ID + 30)
  118. #define TLV_TYPE_AUTH_TYPE (PROPRIETARY_TLV_BASE_ID + 31)
  119. #define TLV_TYPE_LINK_QUALITY (PROPRIETARY_TLV_BASE_ID + 36)
  120. #define TLV_TYPE_RSSI_LOW_DATA (PROPRIETARY_TLV_BASE_ID + 38)
  121. #define TLV_TYPE_SNR_LOW_DATA (PROPRIETARY_TLV_BASE_ID + 39)
  122. #define TLV_TYPE_RSSI_HIGH_DATA (PROPRIETARY_TLV_BASE_ID + 40)
  123. #define TLV_TYPE_SNR_HIGH_DATA (PROPRIETARY_TLV_BASE_ID + 41)
  124. #define TLV_TYPE_CHANNELBANDLIST (PROPRIETARY_TLV_BASE_ID + 42)
  125. #define TLV_TYPE_WAPI_IE (PROPRIETARY_TLV_BASE_ID + 94)
  126. #define TLV_TYPE_BSSID (PROPRIETARY_TLV_BASE_ID + 35)
  127. #define MWIFIEX_TX_DATA_BUF_SIZE_2K 2048
  128. #define TLV_TYPE_HT_CAP (PROPRIETARY_TLV_BASE_ID + 74)
  129. #define TLV_TYPE_HT_INFO (PROPRIETARY_TLV_BASE_ID + 75)
  130. #define TLV_SECONDARY_CHANNEL_OFFSET (PROPRIETARY_TLV_BASE_ID + 76)
  131. #define TLV_TYPE_2040BSS_COEXISTENCE (PROPRIETARY_TLV_BASE_ID + 77)
  132. #define TLV_TYPE_OVERLAP_BSS_SCAN_PARAM (PROPRIETARY_TLV_BASE_ID + 78)
  133. #define TLV_TYPE_EXTCAP (PROPRIETARY_TLV_BASE_ID + 79)
  134. #define TLV_TYPE_HT_OPERATIONAL_MCS_SET (PROPRIETARY_TLV_BASE_ID + 80)
  135. #define ADDBA_TID_MASK (BIT(2) | BIT(3) | BIT(4) | BIT(5))
  136. #define DELBA_TID_MASK (BIT(12) | BIT(13) | BIT(14) | BIT(15))
  137. #define SSN_MASK 0xfff0
  138. #define BA_RESULT_SUCCESS 0x0
  139. #define BA_RESULT_FAILURE 0x1
  140. #define BA_RESULT_TIMEOUT 0x2
  141. #define BA_RESULT_DATA_INVALID 0x3
  142. #define IS_BASTREAM_SETUP(ptr) (ptr->ba_status)
  143. #define BA_STREAM_NOT_ALLOWED 0xff
  144. #define IS_11N_ENABLED(priv) ((priv->adapter->config_bands & BAND_GN || \
  145. priv->adapter->config_bands & BAND_AN) \
  146. && priv->curr_bss_params.bss_descriptor.bcn_ht_cap)
  147. #define INITIATOR_BIT(DelBAParamSet) (((DelBAParamSet) &\
  148. BIT(DELBA_INITIATOR_POS)) >> DELBA_INITIATOR_POS)
  149. #define MWIFIEX_TX_DATA_BUF_SIZE_4K 4096
  150. #define MWIFIEX_TX_DATA_BUF_SIZE_8K 8192
  151. #define MAX_RX_AMPDU_SIZE_64K 0x03
  152. #define NON_GREENFIELD_STAS 0x04
  153. #define HWSPEC_GREENFIELD_SUPP BIT(29)
  154. #define HWSPEC_RXSTBC_SUPP BIT(26)
  155. #define HWSPEC_SHORTGI40_SUPP BIT(24)
  156. #define HWSPEC_SHORTGI20_SUPP BIT(23)
  157. #define HWSPEC_CHANBW40_SUPP BIT(17)
  158. #define DEFAULT_11N_CAP_MASK (HWSPEC_SHORTGI20_SUPP | HWSPEC_RXSTBC_SUPP)
  159. #define ISSUPP_11NENABLED(FwCapInfo) (FwCapInfo & BIT(11))
  160. #define ISSUPP_GREENFIELD(Dot11nDevCap) (Dot11nDevCap & BIT(29))
  161. #define ISSUPP_RXSTBC(Dot11nDevCap) (Dot11nDevCap & BIT(26))
  162. #define ISSUPP_TXSTBC(Dot11nDevCap) (Dot11nDevCap & BIT(25))
  163. #define ISSUPP_SHORTGI40(Dot11nDevCap) (Dot11nDevCap & BIT(24))
  164. #define ISSUPP_SHORTGI20(Dot11nDevCap) (Dot11nDevCap & BIT(23))
  165. #define GET_DELAYEDBACK(Dot11nDevCap) (((Dot11nDevCap >> 20) & 0x03))
  166. #define ISSUPP_CHANWIDTH40(Dot11nDevCap) (Dot11nDevCap & BIT(17))
  167. #define ISENABLED_40MHZ_INTOLARENT(Dot11nDevCap) (Dot11nDevCap & BIT(8))
  168. #define SETSUPP_CHANWIDTH40(Dot11nDevCap) (Dot11nDevCap |= BIT(17))
  169. #define RESETSUPP_CHANWIDTH40(Dot11nDevCap) (Dot11nDevCap &= ~BIT(17))
  170. #define GET_TXMCSSUPP(DevMCSSupported) (DevMCSSupported >> 4)
  171. #define GET_RXMCSSUPP(DevMCSSupported) (DevMCSSupported & 0x0f)
  172. #define GETHT_SUPPCHANWIDTH(HTCapInfo) (HTCapInfo & BIT(1))
  173. #define GETHT_GREENFIELD(HTCapInfo) (HTCapInfo & BIT(4))
  174. #define GETHT_SHORTGI20(HTCapInfo) (HTCapInfo & BIT(5))
  175. #define GETHT_SHORTGI40(HTCapInfo) (HTCapInfo & BIT(6))
  176. #define GETHT_TXSTBC(HTCapInfo) (HTCapInfo & BIT(7))
  177. #define GETHT_RXSTBC(HTCapInfo) ((HTCapInfo >> 8) & 0x03)
  178. #define GETHT_DELAYEDBACK(HTCapInfo) (HTCapInfo & BIT(10))
  179. #define GETHT_MAXAMSDU(HTCapInfo) (HTCapInfo & BIT(11))
  180. #define SETHT_SUPPCHANWIDTH(HTCapInfo) (HTCapInfo |= BIT(1))
  181. #define SETHT_GREENFIELD(HTCapInfo) (HTCapInfo |= BIT(4))
  182. #define SETHT_SHORTGI20(HTCapInfo) (HTCapInfo |= BIT(5))
  183. #define SETHT_SHORTGI40(HTCapInfo) (HTCapInfo |= BIT(6))
  184. #define SETHT_TXSTBC(HTCapInfo) (HTCapInfo |= BIT(7))
  185. #define SETHT_RXSTBC(HTCapInfo, value) (HTCapInfo |= (value << 8))
  186. #define SETHT_DELAYEDBACK(HTCapInfo) (HTCapInfo |= BIT(10))
  187. #define SETHT_MAXAMSDU(HTCapInfo) (HTCapInfo |= BIT(11))
  188. #define SETHT_DSSSCCK40(HTCapInfo) (HTCapInfo |= BIT(12))
  189. #define SETHT_40MHZ_INTOLARANT(HTCapInfo) (HTCapInfo |= BIT(14))
  190. #define RESETHT_SUPPCHANWIDTH(HTCapInfo) (HTCapInfo &= ~BIT(1))
  191. #define RESETHT_GREENFIELD(HTCapInfo) (HTCapInfo &= ~BIT(4))
  192. #define RESETHT_SHORTGI20(HTCapInfo) (HTCapInfo &= ~BIT(5))
  193. #define RESETHT_SHORTGI40(HTCapInfo) (HTCapInfo &= ~BIT(6))
  194. #define RESETHT_TXSTBC(HTCapInfo) (HTCapInfo &= ~BIT(7))
  195. #define RESETHT_RXSTBC(HTCapInfo) (HTCapInfo &= ~(0x03 << 8))
  196. #define RESETHT_DELAYEDBACK(HTCapInfo) (HTCapInfo &= ~BIT(10))
  197. #define RESETHT_MAXAMSDU(HTCapInfo) (HTCapInfo &= ~BIT(11))
  198. #define RESETHT_40MHZ_INTOLARANT(HTCapInfo) (HTCapInfo &= ~BIT(14))
  199. #define RESETHT_EXTCAP_RDG(HTExtCap) (HTExtCap &= ~BIT(11))
  200. #define SETHT_MCS32(x) (x[4] |= 1)
  201. #define SETHT_MCS_SET_DEFINED(x) (x[12] |= 1)
  202. #define SETHT_RX_HIGHEST_DT_SUPP(x, y) ((*(u16 *) (x + 10)) = y)
  203. #define AMPDU_FACTOR_64K 0x03
  204. #define SETAMPDU_SIZE(x, y) do { \
  205. x = x & ~0x03; \
  206. x |= y & 0x03; \
  207. } while (0) \
  208. #define SETAMPDU_SPACING(x, y) do { \
  209. x = x & ~0x1c; \
  210. x |= (y & 0x07) << 2; \
  211. } while (0) \
  212. #define ISSUPP_BANDA(FwCapInfo) (FwCapInfo & BIT(10))
  213. #define ISALLOWED_CHANWIDTH40(Field2) (Field2 & BIT(2))
  214. #define SET_CHANWIDTH40(Field2) (Field2 |= BIT(2))
  215. #define RESET_CHANWIDTH40(Field2) (Field2 &= ~(BIT(0) | BIT(1) | BIT(2)))
  216. #define GET_SECONDARYCHAN(Field2) (Field2 & (BIT(0) | BIT(1)))
  217. #define SET_SECONDARYCHAN(RadioType, SECCHAN) (RadioType |= (SECCHAN << 4))
  218. #define LLC_SNAP_LEN 8
  219. #define TLV_TYPE_RATE_DROP_PATTERN (PROPRIETARY_TLV_BASE_ID + 81)
  220. #define TLV_TYPE_RATE_DROP_CONTROL (PROPRIETARY_TLV_BASE_ID + 82)
  221. #define TLV_TYPE_RATE_SCOPE (PROPRIETARY_TLV_BASE_ID + 83)
  222. #define TLV_TYPE_POWER_GROUP (PROPRIETARY_TLV_BASE_ID + 84)
  223. #define MOD_CLASS_HR_DSSS 0x03
  224. #define MOD_CLASS_OFDM 0x07
  225. #define MOD_CLASS_HT 0x08
  226. #define HT_BW_20 0
  227. #define HT_BW_40 1
  228. #define HostCmd_CMD_GET_HW_SPEC 0x0003
  229. #define HostCmd_CMD_802_11_SCAN 0x0006
  230. #define HostCmd_CMD_802_11_GET_LOG 0x000b
  231. #define HostCmd_CMD_MAC_MULTICAST_ADR 0x0010
  232. #define HostCmd_CMD_802_11_EEPROM_ACCESS 0x0059
  233. #define HostCmd_CMD_802_11_ASSOCIATE 0x0012
  234. #define HostCmd_CMD_802_11_SNMP_MIB 0x0016
  235. #define HostCmd_CMD_MAC_REG_ACCESS 0x0019
  236. #define HostCmd_CMD_BBP_REG_ACCESS 0x001a
  237. #define HostCmd_CMD_RF_REG_ACCESS 0x001b
  238. #define HostCmd_CMD_PMIC_REG_ACCESS 0x00ad
  239. #define HostCmd_CMD_802_11_RF_CHANNEL 0x001d
  240. #define HostCmd_CMD_802_11_DEAUTHENTICATE 0x0024
  241. #define HostCmd_CMD_MAC_CONTROL 0x0028
  242. #define HostCmd_CMD_802_11_AD_HOC_START 0x002b
  243. #define HostCmd_CMD_802_11_AD_HOC_JOIN 0x002c
  244. #define HostCmd_CMD_802_11_AD_HOC_STOP 0x0040
  245. #define HostCmd_CMD_802_11_MAC_ADDRESS 0x004D
  246. #define HostCmd_CMD_802_11D_DOMAIN_INFO 0x005b
  247. #define HostCmd_CMD_802_11_KEY_MATERIAL 0x005e
  248. #define HostCmd_CMD_802_11_BG_SCAN_QUERY 0x006c
  249. #define HostCmd_CMD_WMM_GET_STATUS 0x0071
  250. #define HostCmd_CMD_802_11_TX_RATE_QUERY 0x007f
  251. #define HostCmd_CMD_802_11_IBSS_COALESCING_STATUS 0x0083
  252. #define HostCmd_CMD_VERSION_EXT 0x0097
  253. #define HostCmd_CMD_RSSI_INFO 0x00a4
  254. #define HostCmd_CMD_FUNC_INIT 0x00a9
  255. #define HostCmd_CMD_FUNC_SHUTDOWN 0x00aa
  256. #define HostCmd_CMD_11N_CFG 0x00cd
  257. #define HostCmd_CMD_11N_ADDBA_REQ 0x00ce
  258. #define HostCmd_CMD_11N_ADDBA_RSP 0x00cf
  259. #define HostCmd_CMD_11N_DELBA 0x00d0
  260. #define HostCmd_CMD_RECONFIGURE_TX_BUFF 0x00d9
  261. #define HostCmd_CMD_AMSDU_AGGR_CTRL 0x00df
  262. #define HostCmd_CMD_TXPWR_CFG 0x00d1
  263. #define HostCmd_CMD_TX_RATE_CFG 0x00d6
  264. #define HostCmd_CMD_802_11_PS_MODE_ENH 0x00e4
  265. #define HostCmd_CMD_802_11_HS_CFG_ENH 0x00e5
  266. #define HostCmd_CMD_CAU_REG_ACCESS 0x00ed
  267. #define HostCmd_CMD_SET_BSS_MODE 0x00f7
  268. enum ENH_PS_MODES {
  269. EN_PS = 1,
  270. DIS_PS = 2,
  271. EN_AUTO_DS = 3,
  272. DIS_AUTO_DS = 4,
  273. SLEEP_CONFIRM = 5,
  274. GET_PS = 0,
  275. EN_AUTO_PS = 0xff,
  276. DIS_AUTO_PS = 0xfe,
  277. };
  278. #define HostCmd_RET_BIT 0x8000
  279. #define HostCmd_ACT_GEN_GET 0x0000
  280. #define HostCmd_ACT_GEN_SET 0x0001
  281. #define HostCmd_ACT_GEN_REMOVE 0x0004
  282. #define HostCmd_ACT_SET_BOTH 0x0003
  283. #define HostCmd_ACT_GET_BOTH 0x000c
  284. #define HostCmd_RESULT_OK 0x0000
  285. #define HostCmd_RESULT_ERROR 0x0001
  286. #define HostCmd_RESULT_NOT_SUPPORT 0x0002
  287. #define HostCmd_RESULT_PENDING 0x0003
  288. #define HostCmd_RESULT_BUSY 0x0004
  289. #define HostCmd_RESULT_PARTIAL_DATA 0x0005
  290. #define HostCmd_ACT_MAC_RX_ON 0x0001
  291. #define HostCmd_ACT_MAC_TX_ON 0x0002
  292. #define HostCmd_ACT_MAC_WEP_ENABLE 0x0008
  293. #define HostCmd_ACT_MAC_ETHERNETII_ENABLE 0x0010
  294. #define HostCmd_ACT_MAC_PROMISCUOUS_ENABLE 0x0080
  295. #define HostCmd_ACT_MAC_ALL_MULTICAST_ENABLE 0x0100
  296. #define HostCmd_ACT_MAC_RTS_CTS_ENABLE 0x0200
  297. #define HostCmd_ACT_MAC_STRICT_PROTECTION_ENABLE 0x0400
  298. #define HostCmd_ACT_MAC_ADHOC_G_PROTECTION_ON 0x2000
  299. #define HostCmd_BSS_MODE_BSS 0x0001
  300. #define HostCmd_BSS_MODE_IBSS 0x0002
  301. #define HostCmd_BSS_MODE_ANY 0x0003
  302. #define HostCmd_SCAN_RADIO_TYPE_BG 0
  303. #define HostCmd_SCAN_RADIO_TYPE_A 1
  304. #define HOST_SLEEP_CFG_CANCEL 0xffffffff
  305. #define HOST_SLEEP_CFG_COND_DEF 0x0000000f
  306. #define HOST_SLEEP_CFG_GPIO_DEF 0xff
  307. #define HOST_SLEEP_CFG_GAP_DEF 0
  308. #define CMD_F_HOSTCMD (1 << 0)
  309. #define CMD_F_CANCELED (1 << 1)
  310. #define HostCmd_CMD_ID_MASK 0x0fff
  311. #define HostCmd_SEQ_NUM_MASK 0x00ff
  312. #define HostCmd_BSS_NUM_MASK 0x0f00
  313. #define HostCmd_BSS_TYPE_MASK 0xf000
  314. #define HostCmd_SET_SEQ_NO_BSS_INFO(seq, num, type) { \
  315. (((seq) & 0x00ff) | \
  316. (((num) & 0x000f) << 8)) | \
  317. (((type) & 0x000f) << 12); }
  318. #define HostCmd_GET_SEQ_NO(seq) \
  319. ((seq) & HostCmd_SEQ_NUM_MASK)
  320. #define HostCmd_GET_BSS_NO(seq) \
  321. (((seq) & HostCmd_BSS_NUM_MASK) >> 8)
  322. #define HostCmd_GET_BSS_TYPE(seq) \
  323. (((seq) & HostCmd_BSS_TYPE_MASK) >> 12)
  324. #define EVENT_DUMMY_HOST_WAKEUP_SIGNAL 0x00000001
  325. #define EVENT_LINK_LOST 0x00000003
  326. #define EVENT_LINK_SENSED 0x00000004
  327. #define EVENT_MIB_CHANGED 0x00000006
  328. #define EVENT_INIT_DONE 0x00000007
  329. #define EVENT_DEAUTHENTICATED 0x00000008
  330. #define EVENT_DISASSOCIATED 0x00000009
  331. #define EVENT_PS_AWAKE 0x0000000a
  332. #define EVENT_PS_SLEEP 0x0000000b
  333. #define EVENT_MIC_ERR_MULTICAST 0x0000000d
  334. #define EVENT_MIC_ERR_UNICAST 0x0000000e
  335. #define EVENT_DEEP_SLEEP_AWAKE 0x00000010
  336. #define EVENT_ADHOC_BCN_LOST 0x00000011
  337. #define EVENT_WMM_STATUS_CHANGE 0x00000017
  338. #define EVENT_BG_SCAN_REPORT 0x00000018
  339. #define EVENT_RSSI_LOW 0x00000019
  340. #define EVENT_SNR_LOW 0x0000001a
  341. #define EVENT_MAX_FAIL 0x0000001b
  342. #define EVENT_RSSI_HIGH 0x0000001c
  343. #define EVENT_SNR_HIGH 0x0000001d
  344. #define EVENT_IBSS_COALESCED 0x0000001e
  345. #define EVENT_DATA_RSSI_LOW 0x00000024
  346. #define EVENT_DATA_SNR_LOW 0x00000025
  347. #define EVENT_DATA_RSSI_HIGH 0x00000026
  348. #define EVENT_DATA_SNR_HIGH 0x00000027
  349. #define EVENT_LINK_QUALITY 0x00000028
  350. #define EVENT_PORT_RELEASE 0x0000002b
  351. #define EVENT_PRE_BEACON_LOST 0x00000031
  352. #define EVENT_ADDBA 0x00000033
  353. #define EVENT_DELBA 0x00000034
  354. #define EVENT_BA_STREAM_TIEMOUT 0x00000037
  355. #define EVENT_AMSDU_AGGR_CTRL 0x00000042
  356. #define EVENT_WEP_ICV_ERR 0x00000046
  357. #define EVENT_HS_ACT_REQ 0x00000047
  358. #define EVENT_BW_CHANGE 0x00000048
  359. #define EVENT_HOSTWAKE_STAIE 0x0000004d
  360. #define EVENT_ID_MASK 0xffff
  361. #define BSS_NUM_MASK 0xf
  362. #define EVENT_GET_BSS_NUM(event_cause) \
  363. (((event_cause) >> 16) & BSS_NUM_MASK)
  364. #define EVENT_GET_BSS_TYPE(event_cause) \
  365. (((event_cause) >> 24) & 0x00ff)
  366. struct mwifiex_event_wep_icv_err {
  367. u16 reason_code;
  368. u8 src_mac_addr[ETH_ALEN];
  369. u8 wep_key_index;
  370. u8 wep_key_length;
  371. u8 key[WLAN_KEY_LEN_WEP104];
  372. };
  373. struct mwifiex_802_11_fixed_ies {
  374. u8 time_stamp[8];
  375. __le16 beacon_interval;
  376. __le16 capabilities;
  377. };
  378. struct mwifiex_ie_types_header {
  379. __le16 type;
  380. __le16 len;
  381. } __packed;
  382. struct mwifiex_ie_types_data {
  383. struct mwifiex_ie_types_header header;
  384. u8 data[1];
  385. } __packed;
  386. #define MWIFIEX_TxPD_POWER_MGMT_NULL_PACKET 0x01
  387. #define MWIFIEX_TxPD_POWER_MGMT_LAST_PACKET 0x08
  388. struct txpd {
  389. u8 bss_type;
  390. u8 bss_num;
  391. __le16 tx_pkt_length;
  392. __le16 tx_pkt_offset;
  393. __le16 tx_pkt_type;
  394. __le32 tx_control;
  395. u8 priority;
  396. u8 flags;
  397. u8 pkt_delay_2ms;
  398. u8 reserved1;
  399. } __packed;
  400. struct rxpd {
  401. u8 bss_type;
  402. u8 bss_num;
  403. u16 rx_pkt_length;
  404. u16 rx_pkt_offset;
  405. u16 rx_pkt_type;
  406. u16 seq_num;
  407. u8 priority;
  408. u8 rx_rate;
  409. s8 snr;
  410. s8 nf;
  411. /* Ht Info [Bit 0] RxRate format: LG=0, HT=1
  412. * [Bit 1] HT Bandwidth: BW20 = 0, BW40 = 1
  413. * [Bit 2] HT Guard Interval: LGI = 0, SGI = 1 */
  414. u8 ht_info;
  415. u8 reserved;
  416. } __packed;
  417. enum mwifiex_chan_scan_mode_bitmasks {
  418. MWIFIEX_PASSIVE_SCAN = BIT(0),
  419. MWIFIEX_DISABLE_CHAN_FILT = BIT(1),
  420. };
  421. #define SECOND_CHANNEL_BELOW 0x30
  422. #define SECOND_CHANNEL_ABOVE 0x10
  423. struct mwifiex_chan_scan_param_set {
  424. u8 radio_type;
  425. u8 chan_number;
  426. u8 chan_scan_mode_bitmap;
  427. __le16 min_scan_time;
  428. __le16 max_scan_time;
  429. } __packed;
  430. struct mwifiex_ie_types_chan_list_param_set {
  431. struct mwifiex_ie_types_header header;
  432. struct mwifiex_chan_scan_param_set chan_scan_param[1];
  433. } __packed;
  434. struct chan_band_param_set {
  435. u8 radio_type;
  436. u8 chan_number;
  437. };
  438. struct mwifiex_ie_types_chan_band_list_param_set {
  439. struct mwifiex_ie_types_header header;
  440. struct chan_band_param_set chan_band_param[1];
  441. } __packed;
  442. struct mwifiex_ie_types_rates_param_set {
  443. struct mwifiex_ie_types_header header;
  444. u8 rates[1];
  445. } __packed;
  446. struct mwifiex_ie_types_ssid_param_set {
  447. struct mwifiex_ie_types_header header;
  448. u8 ssid[1];
  449. } __packed;
  450. struct mwifiex_ie_types_num_probes {
  451. struct mwifiex_ie_types_header header;
  452. __le16 num_probes;
  453. } __packed;
  454. struct mwifiex_ie_types_wildcard_ssid_params {
  455. struct mwifiex_ie_types_header header;
  456. u8 max_ssid_length;
  457. u8 ssid[1];
  458. } __packed;
  459. #define TSF_DATA_SIZE 8
  460. struct mwifiex_ie_types_tsf_timestamp {
  461. struct mwifiex_ie_types_header header;
  462. u8 tsf_data[1];
  463. } __packed;
  464. struct mwifiex_cf_param_set {
  465. u8 cfp_cnt;
  466. u8 cfp_period;
  467. u16 cfp_max_duration;
  468. u16 cfp_duration_remaining;
  469. } __packed;
  470. struct mwifiex_ibss_param_set {
  471. u16 atim_window;
  472. } __packed;
  473. struct mwifiex_ie_types_ss_param_set {
  474. struct mwifiex_ie_types_header header;
  475. union {
  476. struct mwifiex_cf_param_set cf_param_set[1];
  477. struct mwifiex_ibss_param_set ibss_param_set[1];
  478. } cf_ibss;
  479. } __packed;
  480. struct mwifiex_fh_param_set {
  481. u16 dwell_time;
  482. u8 hop_set;
  483. u8 hop_pattern;
  484. u8 hop_index;
  485. } __packed;
  486. struct mwifiex_ds_param_set {
  487. u8 current_chan;
  488. } __packed;
  489. struct mwifiex_ie_types_phy_param_set {
  490. struct mwifiex_ie_types_header header;
  491. union {
  492. struct mwifiex_fh_param_set fh_param_set[1];
  493. struct mwifiex_ds_param_set ds_param_set[1];
  494. } fh_ds;
  495. } __packed;
  496. struct mwifiex_ie_types_auth_type {
  497. struct mwifiex_ie_types_header header;
  498. __le16 auth_type;
  499. } __packed;
  500. struct mwifiex_ie_types_vendor_param_set {
  501. struct mwifiex_ie_types_header header;
  502. u8 ie[MWIFIEX_MAX_VSIE_LEN];
  503. };
  504. struct mwifiex_ie_types_rsn_param_set {
  505. struct mwifiex_ie_types_header header;
  506. u8 rsn_ie[1];
  507. } __packed;
  508. #define KEYPARAMSET_FIXED_LEN 6
  509. struct mwifiex_ie_type_key_param_set {
  510. __le16 type;
  511. __le16 length;
  512. __le16 key_type_id;
  513. __le16 key_info;
  514. __le16 key_len;
  515. u8 key[50];
  516. } __packed;
  517. struct host_cmd_ds_802_11_key_material {
  518. __le16 action;
  519. struct mwifiex_ie_type_key_param_set key_param_set;
  520. } __packed;
  521. struct host_cmd_ds_gen {
  522. u16 command;
  523. u16 size;
  524. u16 seq_num;
  525. u16 result;
  526. };
  527. #define S_DS_GEN sizeof(struct host_cmd_ds_gen)
  528. enum sleep_resp_ctrl {
  529. RESP_NOT_NEEDED = 0,
  530. RESP_NEEDED,
  531. };
  532. struct mwifiex_ps_param {
  533. __le16 null_pkt_interval;
  534. __le16 multiple_dtims;
  535. __le16 bcn_miss_timeout;
  536. __le16 local_listen_interval;
  537. __le16 adhoc_wake_period;
  538. __le16 mode;
  539. __le16 delay_to_ps;
  540. };
  541. struct mwifiex_auto_ds_param {
  542. __le16 deep_sleep_timeout;
  543. };
  544. struct sleep_confirm_param {
  545. __le16 resp_ctrl;
  546. };
  547. #define BITMAP_AUTO_DS 0x01
  548. #define BITMAP_STA_PS 0x10
  549. #define BITMAP_UAP_INACT_PS 0x100
  550. #define BITMAP_UAP_DTIM_PS 0x200
  551. struct auto_ps_param {
  552. __le16 ps_bitmap;
  553. /* auto deep sleep parameter,
  554. * sta power save parameter
  555. * uap inactivity parameter
  556. * uap DTIM parameter */
  557. };
  558. #define AUTO_PS_FIX_SIZE 4
  559. #define TLV_TYPE_AUTO_DS_PARAM (PROPRIETARY_TLV_BASE_ID + 113)
  560. #define TLV_TYPE_PS_PARAM (PROPRIETARY_TLV_BASE_ID + 114)
  561. struct mwifiex_ie_types_auto_ds_param {
  562. struct mwifiex_ie_types_header header;
  563. struct mwifiex_auto_ds_param param;
  564. } __packed;
  565. struct mwifiex_ie_types_ps_param {
  566. struct mwifiex_ie_types_header header;
  567. struct mwifiex_ps_param param;
  568. } __packed;
  569. struct host_cmd_ds_802_11_ps_mode_enh {
  570. __le16 action;
  571. union {
  572. struct mwifiex_ps_param opt_ps;
  573. struct mwifiex_auto_ds_param auto_ds;
  574. struct sleep_confirm_param sleep_cfm;
  575. __le16 ps_bitmap;
  576. struct auto_ps_param auto_ps;
  577. } params;
  578. } __packed;
  579. struct host_cmd_ds_get_hw_spec {
  580. __le16 hw_if_version;
  581. __le16 version;
  582. __le16 reserved;
  583. __le16 num_of_mcast_adr;
  584. u8 permanent_addr[ETH_ALEN];
  585. __le16 region_code;
  586. __le16 number_of_antenna;
  587. __le32 fw_release_number;
  588. __le32 reserved_1;
  589. __le32 reserved_2;
  590. __le32 reserved_3;
  591. __le32 fw_cap_info;
  592. __le32 dot_11n_dev_cap;
  593. u8 dev_mcs_support;
  594. __le16 mp_end_port; /* SDIO only, reserved for other interfacces */
  595. __le16 reserved_4;
  596. } __packed;
  597. struct host_cmd_ds_802_11_rssi_info {
  598. __le16 action;
  599. __le16 ndata;
  600. __le16 nbcn;
  601. __le16 reserved[9];
  602. long long reserved_1;
  603. };
  604. struct host_cmd_ds_802_11_rssi_info_rsp {
  605. __le16 action;
  606. __le16 ndata;
  607. __le16 nbcn;
  608. __le16 data_rssi_last;
  609. __le16 data_nf_last;
  610. __le16 data_rssi_avg;
  611. __le16 data_nf_avg;
  612. __le16 bcn_rssi_last;
  613. __le16 bcn_nf_last;
  614. __le16 bcn_rssi_avg;
  615. __le16 bcn_nf_avg;
  616. long long tsf_bcn;
  617. };
  618. struct host_cmd_ds_802_11_mac_address {
  619. __le16 action;
  620. u8 mac_addr[ETH_ALEN];
  621. };
  622. struct host_cmd_ds_mac_control {
  623. __le16 action;
  624. __le16 reserved;
  625. };
  626. struct host_cmd_ds_mac_multicast_adr {
  627. __le16 action;
  628. __le16 num_of_adrs;
  629. u8 mac_list[MWIFIEX_MAX_MULTICAST_LIST_SIZE][ETH_ALEN];
  630. } __packed;
  631. struct host_cmd_ds_802_11_deauthenticate {
  632. u8 mac_addr[ETH_ALEN];
  633. __le16 reason_code;
  634. } __packed;
  635. struct host_cmd_ds_802_11_associate {
  636. u8 peer_sta_addr[ETH_ALEN];
  637. __le16 cap_info_bitmap;
  638. __le16 listen_interval;
  639. __le16 beacon_period;
  640. u8 dtim_period;
  641. } __packed;
  642. struct ieee_types_assoc_rsp {
  643. __le16 cap_info_bitmap;
  644. __le16 status_code;
  645. __le16 a_id;
  646. u8 ie_buffer[1];
  647. } __packed;
  648. struct host_cmd_ds_802_11_associate_rsp {
  649. struct ieee_types_assoc_rsp assoc_rsp;
  650. } __packed;
  651. struct ieee_types_cf_param_set {
  652. u8 element_id;
  653. u8 len;
  654. u8 cfp_cnt;
  655. u8 cfp_period;
  656. u16 cfp_max_duration;
  657. u16 cfp_duration_remaining;
  658. } __packed;
  659. struct ieee_types_ibss_param_set {
  660. u8 element_id;
  661. u8 len;
  662. __le16 atim_window;
  663. } __packed;
  664. union ieee_types_ss_param_set {
  665. struct ieee_types_cf_param_set cf_param_set;
  666. struct ieee_types_ibss_param_set ibss_param_set;
  667. } __packed;
  668. struct ieee_types_fh_param_set {
  669. u8 element_id;
  670. u8 len;
  671. __le16 dwell_time;
  672. u8 hop_set;
  673. u8 hop_pattern;
  674. u8 hop_index;
  675. } __packed;
  676. struct ieee_types_ds_param_set {
  677. u8 element_id;
  678. u8 len;
  679. u8 current_chan;
  680. } __packed;
  681. union ieee_types_phy_param_set {
  682. struct ieee_types_fh_param_set fh_param_set;
  683. struct ieee_types_ds_param_set ds_param_set;
  684. } __packed;
  685. struct host_cmd_ds_802_11_ad_hoc_start {
  686. u8 ssid[IEEE80211_MAX_SSID_LEN];
  687. u8 bss_mode;
  688. __le16 beacon_period;
  689. u8 dtim_period;
  690. union ieee_types_ss_param_set ss_param_set;
  691. union ieee_types_phy_param_set phy_param_set;
  692. u16 reserved1;
  693. __le16 cap_info_bitmap;
  694. u8 DataRate[HOSTCMD_SUPPORTED_RATES];
  695. } __packed;
  696. struct host_cmd_ds_802_11_ad_hoc_result {
  697. u8 pad[3];
  698. u8 bssid[ETH_ALEN];
  699. } __packed;
  700. struct adhoc_bss_desc {
  701. u8 bssid[ETH_ALEN];
  702. u8 ssid[IEEE80211_MAX_SSID_LEN];
  703. u8 bss_mode;
  704. __le16 beacon_period;
  705. u8 dtim_period;
  706. u8 time_stamp[8];
  707. u8 local_time[8];
  708. union ieee_types_phy_param_set phy_param_set;
  709. union ieee_types_ss_param_set ss_param_set;
  710. __le16 cap_info_bitmap;
  711. u8 data_rates[HOSTCMD_SUPPORTED_RATES];
  712. /*
  713. * DO NOT ADD ANY FIELDS TO THIS STRUCTURE.
  714. * It is used in the Adhoc join command and will cause a
  715. * binary layout mismatch with the firmware
  716. */
  717. } __packed;
  718. struct host_cmd_ds_802_11_ad_hoc_join {
  719. struct adhoc_bss_desc bss_descriptor;
  720. u16 reserved1;
  721. u16 reserved2;
  722. } __packed;
  723. struct host_cmd_ds_802_11_get_log {
  724. __le32 mcast_tx_frame;
  725. __le32 failed;
  726. __le32 retry;
  727. __le32 multi_retry;
  728. __le32 frame_dup;
  729. __le32 rts_success;
  730. __le32 rts_failure;
  731. __le32 ack_failure;
  732. __le32 rx_frag;
  733. __le32 mcast_rx_frame;
  734. __le32 fcs_error;
  735. __le32 tx_frame;
  736. __le32 reserved;
  737. __le32 wep_icv_err_cnt[4];
  738. };
  739. struct host_cmd_ds_tx_rate_query {
  740. u8 tx_rate;
  741. /* Ht Info [Bit 0] RxRate format: LG=0, HT=1
  742. * [Bit 1] HT Bandwidth: BW20 = 0, BW40 = 1
  743. * [Bit 2] HT Guard Interval: LGI = 0, SGI = 1 */
  744. u8 ht_info;
  745. } __packed;
  746. enum Host_Sleep_Action {
  747. HS_CONFIGURE = 0x0001,
  748. HS_ACTIVATE = 0x0002,
  749. };
  750. struct mwifiex_hs_config_param {
  751. __le32 conditions;
  752. u8 gpio;
  753. u8 gap;
  754. } __packed;
  755. struct hs_activate_param {
  756. u16 resp_ctrl;
  757. } __packed;
  758. struct host_cmd_ds_802_11_hs_cfg_enh {
  759. __le16 action;
  760. union {
  761. struct mwifiex_hs_config_param hs_config;
  762. struct hs_activate_param hs_activate;
  763. } params;
  764. } __packed;
  765. enum SNMP_MIB_INDEX {
  766. OP_RATE_SET_I = 1,
  767. DTIM_PERIOD_I = 3,
  768. RTS_THRESH_I = 5,
  769. SHORT_RETRY_LIM_I = 6,
  770. LONG_RETRY_LIM_I = 7,
  771. FRAG_THRESH_I = 8,
  772. DOT11D_I = 9,
  773. };
  774. #define MAX_SNMP_BUF_SIZE 128
  775. struct host_cmd_ds_802_11_snmp_mib {
  776. __le16 query_type;
  777. __le16 oid;
  778. __le16 buf_size;
  779. u8 value[1];
  780. } __packed;
  781. #define RADIO_ON 0x01
  782. #define RADIO_OFF 0x00
  783. struct mwifiex_rate_scope {
  784. __le16 type;
  785. __le16 length;
  786. __le16 hr_dsss_rate_bitmap;
  787. __le16 ofdm_rate_bitmap;
  788. __le16 ht_mcs_rate_bitmap[8];
  789. } __packed;
  790. struct mwifiex_rate_drop_pattern {
  791. __le16 type;
  792. __le16 length;
  793. __le32 rate_drop_mode;
  794. } __packed;
  795. struct host_cmd_ds_tx_rate_cfg {
  796. __le16 action;
  797. __le16 cfg_index;
  798. } __packed;
  799. struct mwifiex_power_group {
  800. u8 modulation_class;
  801. u8 first_rate_code;
  802. u8 last_rate_code;
  803. s8 power_step;
  804. s8 power_min;
  805. s8 power_max;
  806. u8 ht_bandwidth;
  807. u8 reserved;
  808. } __packed;
  809. struct mwifiex_types_power_group {
  810. u16 type;
  811. u16 length;
  812. } __packed;
  813. struct host_cmd_ds_txpwr_cfg {
  814. __le16 action;
  815. __le16 cfg_index;
  816. __le32 mode;
  817. } __packed;
  818. #define MWIFIEX_USER_SCAN_CHAN_MAX 50
  819. #define MWIFIEX_MAX_SSID_LIST_LENGTH 10
  820. struct mwifiex_scan_cmd_config {
  821. /*
  822. * BSS Type to be sent in the firmware command
  823. *
  824. * Field can be used to restrict the types of networks returned in the
  825. * scan. Valid settings are:
  826. *
  827. * - MWIFIEX_SCAN_MODE_BSS (infrastructure)
  828. * - MWIFIEX_SCAN_MODE_IBSS (adhoc)
  829. * - MWIFIEX_SCAN_MODE_ANY (unrestricted, adhoc and infrastructure)
  830. */
  831. u8 bss_mode;
  832. /* Specific BSSID used to filter scan results in the firmware */
  833. u8 specific_bssid[ETH_ALEN];
  834. /* Length of TLVs sent in command starting at tlvBuffer */
  835. u32 tlv_buf_len;
  836. /*
  837. * SSID TLV(s) and ChanList TLVs to be sent in the firmware command
  838. *
  839. * TLV_TYPE_CHANLIST, mwifiex_ie_types_chan_list_param_set
  840. * WLAN_EID_SSID, mwifiex_ie_types_ssid_param_set
  841. */
  842. u8 tlv_buf[1]; /* SSID TLV(s) and ChanList TLVs are stored
  843. here */
  844. } __packed;
  845. struct mwifiex_user_scan_chan {
  846. u8 chan_number;
  847. u8 radio_type;
  848. u8 scan_type;
  849. u8 reserved;
  850. u32 scan_time;
  851. } __packed;
  852. struct mwifiex_user_scan_ssid {
  853. u8 ssid[IEEE80211_MAX_SSID_LEN + 1];
  854. u8 max_len;
  855. } __packed;
  856. struct mwifiex_user_scan_cfg {
  857. /*
  858. * Flag set to keep the previous scan table intact
  859. *
  860. * If set, the scan results will accumulate, replacing any previous
  861. * matched entries for a BSS with the new scan data
  862. */
  863. u8 keep_previous_scan;
  864. /*
  865. * BSS mode to be sent in the firmware command
  866. *
  867. * Field can be used to restrict the types of networks returned in the
  868. * scan. Valid settings are:
  869. *
  870. * - MWIFIEX_SCAN_MODE_BSS (infrastructure)
  871. * - MWIFIEX_SCAN_MODE_IBSS (adhoc)
  872. * - MWIFIEX_SCAN_MODE_ANY (unrestricted, adhoc and infrastructure)
  873. */
  874. u8 bss_mode;
  875. /* Configure the number of probe requests for active chan scans */
  876. u8 num_probes;
  877. u8 reserved;
  878. /* BSSID filter sent in the firmware command to limit the results */
  879. u8 specific_bssid[ETH_ALEN];
  880. /* SSID filter list used in the to limit the scan results */
  881. struct mwifiex_user_scan_ssid ssid_list[MWIFIEX_MAX_SSID_LIST_LENGTH];
  882. /* Variable number (fixed maximum) of channels to scan up */
  883. struct mwifiex_user_scan_chan chan_list[MWIFIEX_USER_SCAN_CHAN_MAX];
  884. } __packed;
  885. struct ie_body {
  886. u8 grp_key_oui[4];
  887. u8 ptk_cnt[2];
  888. u8 ptk_body[4];
  889. } __packed;
  890. struct host_cmd_ds_802_11_scan {
  891. u8 bss_mode;
  892. u8 bssid[ETH_ALEN];
  893. u8 tlv_buffer[1];
  894. } __packed;
  895. struct host_cmd_ds_802_11_scan_rsp {
  896. __le16 bss_descript_size;
  897. u8 number_of_sets;
  898. u8 bss_desc_and_tlv_buffer[1];
  899. } __packed;
  900. struct host_cmd_ds_802_11_bg_scan_query {
  901. u8 flush;
  902. } __packed;
  903. struct host_cmd_ds_802_11_bg_scan_query_rsp {
  904. u32 report_condition;
  905. struct host_cmd_ds_802_11_scan_rsp scan_resp;
  906. } __packed;
  907. struct mwifiex_ietypes_domain_param_set {
  908. struct mwifiex_ie_types_header header;
  909. u8 country_code[IEEE80211_COUNTRY_STRING_LEN];
  910. struct ieee80211_country_ie_triplet triplet[1];
  911. } __packed;
  912. struct host_cmd_ds_802_11d_domain_info {
  913. __le16 action;
  914. struct mwifiex_ietypes_domain_param_set domain;
  915. } __packed;
  916. struct host_cmd_ds_802_11d_domain_info_rsp {
  917. __le16 action;
  918. struct mwifiex_ietypes_domain_param_set domain;
  919. } __packed;
  920. struct host_cmd_ds_11n_addba_req {
  921. u8 add_req_result;
  922. u8 peer_mac_addr[ETH_ALEN];
  923. u8 dialog_token;
  924. __le16 block_ack_param_set;
  925. __le16 block_ack_tmo;
  926. __le16 ssn;
  927. } __packed;
  928. struct host_cmd_ds_11n_addba_rsp {
  929. u8 add_rsp_result;
  930. u8 peer_mac_addr[ETH_ALEN];
  931. u8 dialog_token;
  932. __le16 status_code;
  933. __le16 block_ack_param_set;
  934. __le16 block_ack_tmo;
  935. __le16 ssn;
  936. } __packed;
  937. struct host_cmd_ds_11n_delba {
  938. u8 del_result;
  939. u8 peer_mac_addr[ETH_ALEN];
  940. __le16 del_ba_param_set;
  941. __le16 reason_code;
  942. u8 reserved;
  943. } __packed;
  944. struct host_cmd_ds_11n_batimeout {
  945. u8 tid;
  946. u8 peer_mac_addr[ETH_ALEN];
  947. u8 origninator;
  948. } __packed;
  949. struct host_cmd_ds_11n_cfg {
  950. __le16 action;
  951. __le16 ht_tx_cap;
  952. __le16 ht_tx_info;
  953. } __packed;
  954. struct host_cmd_ds_txbuf_cfg {
  955. __le16 action;
  956. __le16 buff_size;
  957. __le16 mp_end_port; /* SDIO only, reserved for other interfacces */
  958. __le16 reserved3;
  959. } __packed;
  960. struct host_cmd_ds_amsdu_aggr_ctrl {
  961. __le16 action;
  962. __le16 enable;
  963. __le16 curr_buf_size;
  964. } __packed;
  965. struct mwifiex_ie_types_wmm_param_set {
  966. struct mwifiex_ie_types_header header;
  967. u8 wmm_ie[1];
  968. };
  969. struct mwifiex_ie_types_wmm_queue_status {
  970. struct mwifiex_ie_types_header header;
  971. u8 queue_index;
  972. u8 disabled;
  973. u16 medium_time;
  974. u8 flow_required;
  975. u8 flow_created;
  976. u32 reserved;
  977. };
  978. struct ieee_types_vendor_header {
  979. u8 element_id;
  980. u8 len;
  981. u8 oui[3];
  982. u8 oui_type;
  983. u8 oui_subtype;
  984. u8 version;
  985. } __packed;
  986. struct ieee_types_wmm_ac_parameters {
  987. u8 aci_aifsn_bitmap;
  988. u8 ecw_bitmap;
  989. __le16 tx_op_limit;
  990. } __packed;
  991. struct ieee_types_wmm_parameter {
  992. /*
  993. * WMM Parameter IE - Vendor Specific Header:
  994. * element_id [221/0xdd]
  995. * Len [24]
  996. * Oui [00:50:f2]
  997. * OuiType [2]
  998. * OuiSubType [1]
  999. * Version [1]
  1000. */
  1001. struct ieee_types_vendor_header vend_hdr;
  1002. u8 qos_info_bitmap;
  1003. u8 reserved;
  1004. struct ieee_types_wmm_ac_parameters ac_params[IEEE80211_MAX_QUEUES];
  1005. } __packed;
  1006. struct ieee_types_wmm_info {
  1007. /*
  1008. * WMM Info IE - Vendor Specific Header:
  1009. * element_id [221/0xdd]
  1010. * Len [7]
  1011. * Oui [00:50:f2]
  1012. * OuiType [2]
  1013. * OuiSubType [0]
  1014. * Version [1]
  1015. */
  1016. struct ieee_types_vendor_header vend_hdr;
  1017. u8 qos_info_bitmap;
  1018. } __packed;
  1019. struct host_cmd_ds_wmm_get_status {
  1020. u8 queue_status_tlv[sizeof(struct mwifiex_ie_types_wmm_queue_status) *
  1021. IEEE80211_MAX_QUEUES];
  1022. u8 wmm_param_tlv[sizeof(struct ieee_types_wmm_parameter) + 2];
  1023. } __packed;
  1024. struct mwifiex_wmm_ac_status {
  1025. u8 disabled;
  1026. u8 flow_required;
  1027. u8 flow_created;
  1028. };
  1029. struct mwifiex_ie_types_htcap {
  1030. struct mwifiex_ie_types_header header;
  1031. struct ieee80211_ht_cap ht_cap;
  1032. } __packed;
  1033. struct mwifiex_ie_types_htinfo {
  1034. struct mwifiex_ie_types_header header;
  1035. struct ieee80211_ht_info ht_info;
  1036. } __packed;
  1037. struct mwifiex_ie_types_2040bssco {
  1038. struct mwifiex_ie_types_header header;
  1039. u8 bss_co_2040;
  1040. } __packed;
  1041. struct mwifiex_ie_types_extcap {
  1042. struct mwifiex_ie_types_header header;
  1043. u8 ext_cap;
  1044. } __packed;
  1045. struct host_cmd_ds_mac_reg_access {
  1046. __le16 action;
  1047. __le16 offset;
  1048. __le32 value;
  1049. } __packed;
  1050. struct host_cmd_ds_bbp_reg_access {
  1051. __le16 action;
  1052. __le16 offset;
  1053. u8 value;
  1054. u8 reserved[3];
  1055. } __packed;
  1056. struct host_cmd_ds_rf_reg_access {
  1057. __le16 action;
  1058. __le16 offset;
  1059. u8 value;
  1060. u8 reserved[3];
  1061. } __packed;
  1062. struct host_cmd_ds_pmic_reg_access {
  1063. __le16 action;
  1064. __le16 offset;
  1065. u8 value;
  1066. u8 reserved[3];
  1067. } __packed;
  1068. struct host_cmd_ds_802_11_eeprom_access {
  1069. __le16 action;
  1070. __le16 offset;
  1071. __le16 byte_count;
  1072. u8 value;
  1073. } __packed;
  1074. struct host_cmd_ds_802_11_rf_channel {
  1075. __le16 action;
  1076. __le16 current_channel;
  1077. __le16 rf_type;
  1078. __le16 reserved;
  1079. u8 reserved_1[32];
  1080. } __packed;
  1081. struct host_cmd_ds_version_ext {
  1082. u8 version_str_sel;
  1083. char version_str[128];
  1084. } __packed;
  1085. struct host_cmd_ds_802_11_ibss_status {
  1086. __le16 action;
  1087. __le16 enable;
  1088. u8 bssid[ETH_ALEN];
  1089. __le16 beacon_interval;
  1090. __le16 atim_window;
  1091. __le16 use_g_rate_protect;
  1092. } __packed;
  1093. #define CONNECTION_TYPE_INFRA 0
  1094. #define CONNECTION_TYPE_ADHOC 1
  1095. struct host_cmd_ds_set_bss_mode {
  1096. u8 con_type;
  1097. } __packed;
  1098. struct host_cmd_ds_command {
  1099. __le16 command;
  1100. __le16 size;
  1101. __le16 seq_num;
  1102. __le16 result;
  1103. union {
  1104. struct host_cmd_ds_get_hw_spec hw_spec;
  1105. struct host_cmd_ds_mac_control mac_ctrl;
  1106. struct host_cmd_ds_802_11_mac_address mac_addr;
  1107. struct host_cmd_ds_mac_multicast_adr mc_addr;
  1108. struct host_cmd_ds_802_11_get_log get_log;
  1109. struct host_cmd_ds_802_11_rssi_info rssi_info;
  1110. struct host_cmd_ds_802_11_rssi_info_rsp rssi_info_rsp;
  1111. struct host_cmd_ds_802_11_snmp_mib smib;
  1112. struct host_cmd_ds_802_11_rf_channel rf_channel;
  1113. struct host_cmd_ds_tx_rate_query tx_rate;
  1114. struct host_cmd_ds_tx_rate_cfg tx_rate_cfg;
  1115. struct host_cmd_ds_txpwr_cfg txp_cfg;
  1116. struct host_cmd_ds_802_11_ps_mode_enh psmode_enh;
  1117. struct host_cmd_ds_802_11_hs_cfg_enh opt_hs_cfg;
  1118. struct host_cmd_ds_802_11_scan scan;
  1119. struct host_cmd_ds_802_11_scan_rsp scan_resp;
  1120. struct host_cmd_ds_802_11_bg_scan_query bg_scan_query;
  1121. struct host_cmd_ds_802_11_bg_scan_query_rsp bg_scan_query_resp;
  1122. struct host_cmd_ds_802_11_associate associate;
  1123. struct host_cmd_ds_802_11_associate_rsp associate_rsp;
  1124. struct host_cmd_ds_802_11_deauthenticate deauth;
  1125. struct host_cmd_ds_802_11_ad_hoc_start adhoc_start;
  1126. struct host_cmd_ds_802_11_ad_hoc_result adhoc_result;
  1127. struct host_cmd_ds_802_11_ad_hoc_join adhoc_join;
  1128. struct host_cmd_ds_802_11d_domain_info domain_info;
  1129. struct host_cmd_ds_802_11d_domain_info_rsp domain_info_resp;
  1130. struct host_cmd_ds_11n_addba_req add_ba_req;
  1131. struct host_cmd_ds_11n_addba_rsp add_ba_rsp;
  1132. struct host_cmd_ds_11n_delba del_ba;
  1133. struct host_cmd_ds_txbuf_cfg tx_buf;
  1134. struct host_cmd_ds_amsdu_aggr_ctrl amsdu_aggr_ctrl;
  1135. struct host_cmd_ds_11n_cfg htcfg;
  1136. struct host_cmd_ds_wmm_get_status get_wmm_status;
  1137. struct host_cmd_ds_802_11_key_material key_material;
  1138. struct host_cmd_ds_version_ext verext;
  1139. struct host_cmd_ds_802_11_ibss_status ibss_coalescing;
  1140. struct host_cmd_ds_mac_reg_access mac_reg;
  1141. struct host_cmd_ds_bbp_reg_access bbp_reg;
  1142. struct host_cmd_ds_rf_reg_access rf_reg;
  1143. struct host_cmd_ds_pmic_reg_access pmic_reg;
  1144. struct host_cmd_ds_set_bss_mode bss_mode;
  1145. struct host_cmd_ds_802_11_eeprom_access eeprom;
  1146. } params;
  1147. } __packed;
  1148. struct mwifiex_opt_sleep_confirm {
  1149. __le16 command;
  1150. __le16 size;
  1151. __le16 seq_num;
  1152. __le16 result;
  1153. __le16 action;
  1154. struct sleep_confirm_param sleep_cfm;
  1155. } __packed;
  1156. struct mwifiex_opt_sleep_confirm_buffer {
  1157. u8 hdr[4];
  1158. struct mwifiex_opt_sleep_confirm ps_cfm_sleep;
  1159. } __packed;
  1160. #endif /* !_MWIFIEX_FW_H_ */