fw.h 37 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462
  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 HostCmd_WEP_KEY_INDEX_MASK 0x3fff
  51. #define KEY_INFO_ENABLED 0x01
  52. enum KEY_TYPE_ID {
  53. KEY_TYPE_ID_WEP = 0,
  54. KEY_TYPE_ID_TKIP,
  55. KEY_TYPE_ID_AES,
  56. KEY_TYPE_ID_WAPI,
  57. KEY_TYPE_ID_AES_CMAC,
  58. };
  59. #define KEY_MCAST BIT(0)
  60. #define KEY_UNICAST BIT(1)
  61. #define KEY_ENABLED BIT(2)
  62. #define KEY_IGTK BIT(10)
  63. #define WAPI_KEY_LEN 50
  64. #define MAX_POLL_TRIES 100
  65. #define MAX_MULTI_INTERFACE_POLL_TRIES 1000
  66. #define MAX_FIRMWARE_POLL_TRIES 100
  67. #define FIRMWARE_READY_SDIO 0xfedc
  68. #define FIRMWARE_READY_PCIE 0xfedcba00
  69. enum mwifiex_usb_ep {
  70. MWIFIEX_USB_EP_CMD_EVENT = 1,
  71. MWIFIEX_USB_EP_DATA = 2,
  72. };
  73. enum MWIFIEX_802_11_PRIVACY_FILTER {
  74. MWIFIEX_802_11_PRIV_FILTER_ACCEPT_ALL,
  75. MWIFIEX_802_11_PRIV_FILTER_8021X_WEP
  76. };
  77. #define CAL_SNR(RSSI, NF) ((s16)((s16)(RSSI)-(s16)(NF)))
  78. #define UAP_BSS_PARAMS_I 0
  79. #define UAP_CUSTOM_IE_I 1
  80. #define MWIFIEX_AUTO_IDX_MASK 0xffff
  81. #define MWIFIEX_DELETE_MASK 0x0000
  82. #define MGMT_MASK_ASSOC_REQ 0x01
  83. #define MGMT_MASK_REASSOC_REQ 0x04
  84. #define MGMT_MASK_ASSOC_RESP 0x02
  85. #define MGMT_MASK_REASSOC_RESP 0x08
  86. #define MGMT_MASK_PROBE_REQ 0x10
  87. #define MGMT_MASK_PROBE_RESP 0x20
  88. #define MGMT_MASK_BEACON 0x100
  89. #define TLV_TYPE_UAP_SSID 0x0000
  90. #define PROPRIETARY_TLV_BASE_ID 0x0100
  91. #define TLV_TYPE_KEY_MATERIAL (PROPRIETARY_TLV_BASE_ID + 0)
  92. #define TLV_TYPE_CHANLIST (PROPRIETARY_TLV_BASE_ID + 1)
  93. #define TLV_TYPE_NUMPROBES (PROPRIETARY_TLV_BASE_ID + 2)
  94. #define TLV_TYPE_RSSI_LOW (PROPRIETARY_TLV_BASE_ID + 4)
  95. #define TLV_TYPE_PASSTHROUGH (PROPRIETARY_TLV_BASE_ID + 10)
  96. #define TLV_TYPE_WMMQSTATUS (PROPRIETARY_TLV_BASE_ID + 16)
  97. #define TLV_TYPE_WILDCARDSSID (PROPRIETARY_TLV_BASE_ID + 18)
  98. #define TLV_TYPE_TSFTIMESTAMP (PROPRIETARY_TLV_BASE_ID + 19)
  99. #define TLV_TYPE_RSSI_HIGH (PROPRIETARY_TLV_BASE_ID + 22)
  100. #define TLV_TYPE_AUTH_TYPE (PROPRIETARY_TLV_BASE_ID + 31)
  101. #define TLV_TYPE_STA_MAC_ADDR (PROPRIETARY_TLV_BASE_ID + 32)
  102. #define TLV_TYPE_CHANNELBANDLIST (PROPRIETARY_TLV_BASE_ID + 42)
  103. #define TLV_TYPE_UAP_BEACON_PERIOD (PROPRIETARY_TLV_BASE_ID + 44)
  104. #define TLV_TYPE_UAP_DTIM_PERIOD (PROPRIETARY_TLV_BASE_ID + 45)
  105. #define TLV_TYPE_UAP_BCAST_SSID (PROPRIETARY_TLV_BASE_ID + 48)
  106. #define TLV_TYPE_UAP_RTS_THRESHOLD (PROPRIETARY_TLV_BASE_ID + 51)
  107. #define TLV_TYPE_UAP_WEP_KEY (PROPRIETARY_TLV_BASE_ID + 59)
  108. #define TLV_TYPE_UAP_WPA_PASSPHRASE (PROPRIETARY_TLV_BASE_ID + 60)
  109. #define TLV_TYPE_UAP_ENCRY_PROTOCOL (PROPRIETARY_TLV_BASE_ID + 64)
  110. #define TLV_TYPE_UAP_AKMP (PROPRIETARY_TLV_BASE_ID + 65)
  111. #define TLV_TYPE_UAP_FRAG_THRESHOLD (PROPRIETARY_TLV_BASE_ID + 70)
  112. #define TLV_TYPE_RATE_DROP_CONTROL (PROPRIETARY_TLV_BASE_ID + 82)
  113. #define TLV_TYPE_RATE_SCOPE (PROPRIETARY_TLV_BASE_ID + 83)
  114. #define TLV_TYPE_POWER_GROUP (PROPRIETARY_TLV_BASE_ID + 84)
  115. #define TLV_TYPE_UAP_RETRY_LIMIT (PROPRIETARY_TLV_BASE_ID + 93)
  116. #define TLV_TYPE_WAPI_IE (PROPRIETARY_TLV_BASE_ID + 94)
  117. #define TLV_TYPE_UAP_MGMT_FRAME (PROPRIETARY_TLV_BASE_ID + 104)
  118. #define TLV_TYPE_MGMT_IE (PROPRIETARY_TLV_BASE_ID + 105)
  119. #define TLV_TYPE_AUTO_DS_PARAM (PROPRIETARY_TLV_BASE_ID + 113)
  120. #define TLV_TYPE_PS_PARAM (PROPRIETARY_TLV_BASE_ID + 114)
  121. #define TLV_TYPE_PWK_CIPHER (PROPRIETARY_TLV_BASE_ID + 145)
  122. #define TLV_TYPE_GWK_CIPHER (PROPRIETARY_TLV_BASE_ID + 146)
  123. #define MWIFIEX_TX_DATA_BUF_SIZE_2K 2048
  124. #define SSN_MASK 0xfff0
  125. #define BA_RESULT_SUCCESS 0x0
  126. #define BA_RESULT_TIMEOUT 0x2
  127. #define IS_BASTREAM_SETUP(ptr) (ptr->ba_status)
  128. #define BA_STREAM_NOT_ALLOWED 0xff
  129. #define IS_11N_ENABLED(priv) ((priv->adapter->config_bands & BAND_GN || \
  130. priv->adapter->config_bands & BAND_AN) && \
  131. priv->curr_bss_params.bss_descriptor.bcn_ht_cap)
  132. #define INITIATOR_BIT(DelBAParamSet) (((DelBAParamSet) &\
  133. BIT(DELBA_INITIATOR_POS)) >> DELBA_INITIATOR_POS)
  134. #define MWIFIEX_TX_DATA_BUF_SIZE_4K 4096
  135. #define MWIFIEX_TX_DATA_BUF_SIZE_8K 8192
  136. #define ISSUPP_11NENABLED(FwCapInfo) (FwCapInfo & BIT(11))
  137. #define MWIFIEX_DEF_HT_CAP (IEEE80211_HT_CAP_DSSSCCK40 | \
  138. (1 << IEEE80211_HT_CAP_RX_STBC_SHIFT) | \
  139. IEEE80211_HT_CAP_SM_PS)
  140. #define MWIFIEX_DEF_AMPDU IEEE80211_HT_AMPDU_PARM_FACTOR
  141. /* dev_cap bitmap
  142. * BIT
  143. * 0-16 reserved
  144. * 17 IEEE80211_HT_CAP_SUP_WIDTH_20_40
  145. * 18-22 reserved
  146. * 23 IEEE80211_HT_CAP_SGI_20
  147. * 24 IEEE80211_HT_CAP_SGI_40
  148. * 25 IEEE80211_HT_CAP_TX_STBC
  149. * 26 IEEE80211_HT_CAP_RX_STBC
  150. * 27-28 reserved
  151. * 29 IEEE80211_HT_CAP_GRN_FLD
  152. * 30-31 reserved
  153. */
  154. #define ISSUPP_CHANWIDTH40(Dot11nDevCap) (Dot11nDevCap & BIT(17))
  155. #define ISSUPP_SHORTGI20(Dot11nDevCap) (Dot11nDevCap & BIT(23))
  156. #define ISSUPP_SHORTGI40(Dot11nDevCap) (Dot11nDevCap & BIT(24))
  157. #define ISSUPP_TXSTBC(Dot11nDevCap) (Dot11nDevCap & BIT(25))
  158. #define ISSUPP_RXSTBC(Dot11nDevCap) (Dot11nDevCap & BIT(26))
  159. #define ISSUPP_GREENFIELD(Dot11nDevCap) (Dot11nDevCap & BIT(29))
  160. /* httxcfg bitmap
  161. * 0 reserved
  162. * 1 20/40 Mhz enable(1)/disable(0)
  163. * 2-3 reserved
  164. * 4 green field enable(1)/disable(0)
  165. * 5 short GI in 20 Mhz enable(1)/disable(0)
  166. * 6 short GI in 40 Mhz enable(1)/disable(0)
  167. * 7-15 reserved
  168. */
  169. #define MWIFIEX_FW_DEF_HTTXCFG (BIT(1) | BIT(4) | BIT(5) | BIT(6))
  170. #define GET_RXMCSSUPP(DevMCSSupported) (DevMCSSupported & 0x0f)
  171. #define SETHT_MCS32(x) (x[4] |= 1)
  172. #define HT_STREAM_2X2 0x22
  173. #define SET_SECONDARYCHAN(RadioType, SECCHAN) (RadioType |= (SECCHAN << 4))
  174. #define LLC_SNAP_LEN 8
  175. #define MOD_CLASS_HR_DSSS 0x03
  176. #define MOD_CLASS_OFDM 0x07
  177. #define MOD_CLASS_HT 0x08
  178. #define HT_BW_20 0
  179. #define HT_BW_40 1
  180. #define HostCmd_CMD_GET_HW_SPEC 0x0003
  181. #define HostCmd_CMD_802_11_SCAN 0x0006
  182. #define HostCmd_CMD_802_11_GET_LOG 0x000b
  183. #define HostCmd_CMD_MAC_MULTICAST_ADR 0x0010
  184. #define HostCmd_CMD_802_11_EEPROM_ACCESS 0x0059
  185. #define HostCmd_CMD_802_11_ASSOCIATE 0x0012
  186. #define HostCmd_CMD_802_11_SNMP_MIB 0x0016
  187. #define HostCmd_CMD_MAC_REG_ACCESS 0x0019
  188. #define HostCmd_CMD_BBP_REG_ACCESS 0x001a
  189. #define HostCmd_CMD_RF_REG_ACCESS 0x001b
  190. #define HostCmd_CMD_PMIC_REG_ACCESS 0x00ad
  191. #define HostCmd_CMD_RF_TX_PWR 0x001e
  192. #define HostCmd_CMD_RF_ANTENNA 0x0020
  193. #define HostCmd_CMD_802_11_DEAUTHENTICATE 0x0024
  194. #define HostCmd_CMD_MAC_CONTROL 0x0028
  195. #define HostCmd_CMD_802_11_AD_HOC_START 0x002b
  196. #define HostCmd_CMD_802_11_AD_HOC_JOIN 0x002c
  197. #define HostCmd_CMD_802_11_AD_HOC_STOP 0x0040
  198. #define HostCmd_CMD_802_11_MAC_ADDRESS 0x004D
  199. #define HostCmd_CMD_802_11D_DOMAIN_INFO 0x005b
  200. #define HostCmd_CMD_802_11_KEY_MATERIAL 0x005e
  201. #define HostCmd_CMD_802_11_BG_SCAN_QUERY 0x006c
  202. #define HostCmd_CMD_WMM_GET_STATUS 0x0071
  203. #define HostCmd_CMD_802_11_SUBSCRIBE_EVENT 0x0075
  204. #define HostCmd_CMD_802_11_TX_RATE_QUERY 0x007f
  205. #define HostCmd_CMD_802_11_IBSS_COALESCING_STATUS 0x0083
  206. #define HostCmd_CMD_VERSION_EXT 0x0097
  207. #define HostCmd_CMD_RSSI_INFO 0x00a4
  208. #define HostCmd_CMD_FUNC_INIT 0x00a9
  209. #define HostCmd_CMD_FUNC_SHUTDOWN 0x00aa
  210. #define HostCmd_CMD_UAP_SYS_CONFIG 0x00b0
  211. #define HostCmd_CMD_UAP_BSS_START 0x00b1
  212. #define HostCmd_CMD_UAP_BSS_STOP 0x00b2
  213. #define HostCmd_CMD_11N_CFG 0x00cd
  214. #define HostCmd_CMD_11N_ADDBA_REQ 0x00ce
  215. #define HostCmd_CMD_11N_ADDBA_RSP 0x00cf
  216. #define HostCmd_CMD_11N_DELBA 0x00d0
  217. #define HostCmd_CMD_RECONFIGURE_TX_BUFF 0x00d9
  218. #define HostCmd_CMD_AMSDU_AGGR_CTRL 0x00df
  219. #define HostCmd_CMD_TXPWR_CFG 0x00d1
  220. #define HostCmd_CMD_TX_RATE_CFG 0x00d6
  221. #define HostCmd_CMD_802_11_PS_MODE_ENH 0x00e4
  222. #define HostCmd_CMD_802_11_HS_CFG_ENH 0x00e5
  223. #define HostCmd_CMD_CAU_REG_ACCESS 0x00ed
  224. #define HostCmd_CMD_SET_BSS_MODE 0x00f7
  225. #define HostCmd_CMD_PCIE_DESC_DETAILS 0x00fa
  226. #define PROTOCOL_NO_SECURITY 0x01
  227. #define PROTOCOL_STATIC_WEP 0x02
  228. #define PROTOCOL_WPA 0x08
  229. #define PROTOCOL_WPA2 0x20
  230. #define PROTOCOL_WPA2_MIXED 0x28
  231. #define PROTOCOL_EAP 0x40
  232. #define KEY_MGMT_NONE 0x04
  233. #define KEY_MGMT_PSK 0x02
  234. #define KEY_MGMT_EAP 0x01
  235. #define CIPHER_TKIP 0x04
  236. #define CIPHER_AES_CCMP 0x08
  237. #define VALID_CIPHER_BITMAP 0x0c
  238. enum ENH_PS_MODES {
  239. EN_PS = 1,
  240. DIS_PS = 2,
  241. EN_AUTO_DS = 3,
  242. DIS_AUTO_DS = 4,
  243. SLEEP_CONFIRM = 5,
  244. GET_PS = 0,
  245. EN_AUTO_PS = 0xff,
  246. DIS_AUTO_PS = 0xfe,
  247. };
  248. #define HostCmd_RET_BIT 0x8000
  249. #define HostCmd_ACT_GEN_GET 0x0000
  250. #define HostCmd_ACT_GEN_SET 0x0001
  251. #define HostCmd_ACT_BITWISE_SET 0x0002
  252. #define HostCmd_ACT_BITWISE_CLR 0x0003
  253. #define HostCmd_RESULT_OK 0x0000
  254. #define HostCmd_ACT_MAC_RX_ON 0x0001
  255. #define HostCmd_ACT_MAC_TX_ON 0x0002
  256. #define HostCmd_ACT_MAC_WEP_ENABLE 0x0008
  257. #define HostCmd_ACT_MAC_ETHERNETII_ENABLE 0x0010
  258. #define HostCmd_ACT_MAC_PROMISCUOUS_ENABLE 0x0080
  259. #define HostCmd_ACT_MAC_ALL_MULTICAST_ENABLE 0x0100
  260. #define HostCmd_ACT_MAC_ADHOC_G_PROTECTION_ON 0x2000
  261. #define HostCmd_BSS_MODE_IBSS 0x0002
  262. #define HostCmd_BSS_MODE_ANY 0x0003
  263. #define HostCmd_SCAN_RADIO_TYPE_BG 0
  264. #define HostCmd_SCAN_RADIO_TYPE_A 1
  265. #define HOST_SLEEP_CFG_CANCEL 0xffffffff
  266. #define HOST_SLEEP_CFG_COND_DEF 0x0000000f
  267. #define HOST_SLEEP_CFG_GPIO_DEF 0xff
  268. #define HOST_SLEEP_CFG_GAP_DEF 0
  269. #define CMD_F_HOSTCMD (1 << 0)
  270. #define CMD_F_CANCELED (1 << 1)
  271. #define HostCmd_CMD_ID_MASK 0x0fff
  272. #define HostCmd_SEQ_NUM_MASK 0x00ff
  273. #define HostCmd_BSS_NUM_MASK 0x0f00
  274. #define HostCmd_BSS_TYPE_MASK 0xf000
  275. #define HostCmd_ACT_SET_RX 0x0001
  276. #define HostCmd_ACT_SET_TX 0x0002
  277. #define HostCmd_ACT_SET_BOTH 0x0003
  278. #define RF_ANTENNA_AUTO 0xFFFF
  279. #define HostCmd_SET_SEQ_NO_BSS_INFO(seq, num, type) { \
  280. (((seq) & 0x00ff) | \
  281. (((num) & 0x000f) << 8)) | \
  282. (((type) & 0x000f) << 12); }
  283. #define HostCmd_GET_SEQ_NO(seq) \
  284. ((seq) & HostCmd_SEQ_NUM_MASK)
  285. #define HostCmd_GET_BSS_NO(seq) \
  286. (((seq) & HostCmd_BSS_NUM_MASK) >> 8)
  287. #define HostCmd_GET_BSS_TYPE(seq) \
  288. (((seq) & HostCmd_BSS_TYPE_MASK) >> 12)
  289. #define EVENT_DUMMY_HOST_WAKEUP_SIGNAL 0x00000001
  290. #define EVENT_LINK_LOST 0x00000003
  291. #define EVENT_LINK_SENSED 0x00000004
  292. #define EVENT_MIB_CHANGED 0x00000006
  293. #define EVENT_INIT_DONE 0x00000007
  294. #define EVENT_DEAUTHENTICATED 0x00000008
  295. #define EVENT_DISASSOCIATED 0x00000009
  296. #define EVENT_PS_AWAKE 0x0000000a
  297. #define EVENT_PS_SLEEP 0x0000000b
  298. #define EVENT_MIC_ERR_MULTICAST 0x0000000d
  299. #define EVENT_MIC_ERR_UNICAST 0x0000000e
  300. #define EVENT_DEEP_SLEEP_AWAKE 0x00000010
  301. #define EVENT_ADHOC_BCN_LOST 0x00000011
  302. #define EVENT_WMM_STATUS_CHANGE 0x00000017
  303. #define EVENT_BG_SCAN_REPORT 0x00000018
  304. #define EVENT_RSSI_LOW 0x00000019
  305. #define EVENT_SNR_LOW 0x0000001a
  306. #define EVENT_MAX_FAIL 0x0000001b
  307. #define EVENT_RSSI_HIGH 0x0000001c
  308. #define EVENT_SNR_HIGH 0x0000001d
  309. #define EVENT_IBSS_COALESCED 0x0000001e
  310. #define EVENT_DATA_RSSI_LOW 0x00000024
  311. #define EVENT_DATA_SNR_LOW 0x00000025
  312. #define EVENT_DATA_RSSI_HIGH 0x00000026
  313. #define EVENT_DATA_SNR_HIGH 0x00000027
  314. #define EVENT_LINK_QUALITY 0x00000028
  315. #define EVENT_PORT_RELEASE 0x0000002b
  316. #define EVENT_UAP_STA_DEAUTH 0x0000002c
  317. #define EVENT_UAP_STA_ASSOC 0x0000002d
  318. #define EVENT_UAP_BSS_START 0x0000002e
  319. #define EVENT_PRE_BEACON_LOST 0x00000031
  320. #define EVENT_ADDBA 0x00000033
  321. #define EVENT_DELBA 0x00000034
  322. #define EVENT_BA_STREAM_TIEMOUT 0x00000037
  323. #define EVENT_AMSDU_AGGR_CTRL 0x00000042
  324. #define EVENT_UAP_BSS_IDLE 0x00000043
  325. #define EVENT_UAP_BSS_ACTIVE 0x00000044
  326. #define EVENT_WEP_ICV_ERR 0x00000046
  327. #define EVENT_HS_ACT_REQ 0x00000047
  328. #define EVENT_BW_CHANGE 0x00000048
  329. #define EVENT_UAP_MIC_COUNTERMEASURES 0x0000004c
  330. #define EVENT_HOSTWAKE_STAIE 0x0000004d
  331. #define EVENT_ID_MASK 0xffff
  332. #define BSS_NUM_MASK 0xf
  333. #define EVENT_GET_BSS_NUM(event_cause) \
  334. (((event_cause) >> 16) & BSS_NUM_MASK)
  335. #define EVENT_GET_BSS_TYPE(event_cause) \
  336. (((event_cause) >> 24) & 0x00ff)
  337. struct mwifiex_ie_types_header {
  338. __le16 type;
  339. __le16 len;
  340. } __packed;
  341. struct mwifiex_ie_types_data {
  342. struct mwifiex_ie_types_header header;
  343. u8 data[1];
  344. } __packed;
  345. #define MWIFIEX_TxPD_POWER_MGMT_NULL_PACKET 0x01
  346. #define MWIFIEX_TxPD_POWER_MGMT_LAST_PACKET 0x08
  347. struct txpd {
  348. u8 bss_type;
  349. u8 bss_num;
  350. __le16 tx_pkt_length;
  351. __le16 tx_pkt_offset;
  352. __le16 tx_pkt_type;
  353. __le32 tx_control;
  354. u8 priority;
  355. u8 flags;
  356. u8 pkt_delay_2ms;
  357. u8 reserved1;
  358. } __packed;
  359. struct rxpd {
  360. u8 bss_type;
  361. u8 bss_num;
  362. __le16 rx_pkt_length;
  363. __le16 rx_pkt_offset;
  364. __le16 rx_pkt_type;
  365. __le16 seq_num;
  366. u8 priority;
  367. u8 rx_rate;
  368. s8 snr;
  369. s8 nf;
  370. /* Ht Info [Bit 0] RxRate format: LG=0, HT=1
  371. * [Bit 1] HT Bandwidth: BW20 = 0, BW40 = 1
  372. * [Bit 2] HT Guard Interval: LGI = 0, SGI = 1 */
  373. u8 ht_info;
  374. u8 reserved;
  375. } __packed;
  376. struct uap_txpd {
  377. u8 bss_type;
  378. u8 bss_num;
  379. __le16 tx_pkt_length;
  380. __le16 tx_pkt_offset;
  381. __le16 tx_pkt_type;
  382. __le32 tx_control;
  383. u8 priority;
  384. u8 flags;
  385. u8 pkt_delay_2ms;
  386. u8 reserved1;
  387. __le32 reserved2;
  388. };
  389. struct uap_rxpd {
  390. u8 bss_type;
  391. u8 bss_num;
  392. __le16 rx_pkt_length;
  393. __le16 rx_pkt_offset;
  394. __le16 rx_pkt_type;
  395. __le16 seq_num;
  396. u8 priority;
  397. u8 reserved1;
  398. };
  399. enum mwifiex_chan_scan_mode_bitmasks {
  400. MWIFIEX_PASSIVE_SCAN = BIT(0),
  401. MWIFIEX_DISABLE_CHAN_FILT = BIT(1),
  402. };
  403. struct mwifiex_chan_scan_param_set {
  404. u8 radio_type;
  405. u8 chan_number;
  406. u8 chan_scan_mode_bitmap;
  407. __le16 min_scan_time;
  408. __le16 max_scan_time;
  409. } __packed;
  410. struct mwifiex_ie_types_chan_list_param_set {
  411. struct mwifiex_ie_types_header header;
  412. struct mwifiex_chan_scan_param_set chan_scan_param[1];
  413. } __packed;
  414. struct chan_band_param_set {
  415. u8 radio_type;
  416. u8 chan_number;
  417. };
  418. struct mwifiex_ie_types_chan_band_list_param_set {
  419. struct mwifiex_ie_types_header header;
  420. struct chan_band_param_set chan_band_param[1];
  421. } __packed;
  422. struct mwifiex_ie_types_rates_param_set {
  423. struct mwifiex_ie_types_header header;
  424. u8 rates[1];
  425. } __packed;
  426. struct mwifiex_ie_types_ssid_param_set {
  427. struct mwifiex_ie_types_header header;
  428. u8 ssid[1];
  429. } __packed;
  430. struct mwifiex_ie_types_num_probes {
  431. struct mwifiex_ie_types_header header;
  432. __le16 num_probes;
  433. } __packed;
  434. struct mwifiex_ie_types_wildcard_ssid_params {
  435. struct mwifiex_ie_types_header header;
  436. u8 max_ssid_length;
  437. u8 ssid[1];
  438. } __packed;
  439. #define TSF_DATA_SIZE 8
  440. struct mwifiex_ie_types_tsf_timestamp {
  441. struct mwifiex_ie_types_header header;
  442. u8 tsf_data[1];
  443. } __packed;
  444. struct mwifiex_cf_param_set {
  445. u8 cfp_cnt;
  446. u8 cfp_period;
  447. u16 cfp_max_duration;
  448. u16 cfp_duration_remaining;
  449. } __packed;
  450. struct mwifiex_ibss_param_set {
  451. u16 atim_window;
  452. } __packed;
  453. struct mwifiex_ie_types_ss_param_set {
  454. struct mwifiex_ie_types_header header;
  455. union {
  456. struct mwifiex_cf_param_set cf_param_set[1];
  457. struct mwifiex_ibss_param_set ibss_param_set[1];
  458. } cf_ibss;
  459. } __packed;
  460. struct mwifiex_fh_param_set {
  461. u16 dwell_time;
  462. u8 hop_set;
  463. u8 hop_pattern;
  464. u8 hop_index;
  465. } __packed;
  466. struct mwifiex_ds_param_set {
  467. u8 current_chan;
  468. } __packed;
  469. struct mwifiex_ie_types_phy_param_set {
  470. struct mwifiex_ie_types_header header;
  471. union {
  472. struct mwifiex_fh_param_set fh_param_set[1];
  473. struct mwifiex_ds_param_set ds_param_set[1];
  474. } fh_ds;
  475. } __packed;
  476. struct mwifiex_ie_types_auth_type {
  477. struct mwifiex_ie_types_header header;
  478. __le16 auth_type;
  479. } __packed;
  480. struct mwifiex_ie_types_vendor_param_set {
  481. struct mwifiex_ie_types_header header;
  482. u8 ie[MWIFIEX_MAX_VSIE_LEN];
  483. };
  484. struct mwifiex_ie_types_rsn_param_set {
  485. struct mwifiex_ie_types_header header;
  486. u8 rsn_ie[1];
  487. } __packed;
  488. #define KEYPARAMSET_FIXED_LEN 6
  489. struct mwifiex_ie_type_key_param_set {
  490. __le16 type;
  491. __le16 length;
  492. __le16 key_type_id;
  493. __le16 key_info;
  494. __le16 key_len;
  495. u8 key[50];
  496. } __packed;
  497. #define IGTK_PN_LEN 8
  498. struct mwifiex_cmac_param {
  499. u8 ipn[IGTK_PN_LEN];
  500. u8 key[WLAN_KEY_LEN_AES_CMAC];
  501. } __packed;
  502. struct host_cmd_ds_802_11_key_material {
  503. __le16 action;
  504. struct mwifiex_ie_type_key_param_set key_param_set;
  505. } __packed;
  506. struct host_cmd_ds_gen {
  507. u16 command;
  508. u16 size;
  509. u16 seq_num;
  510. u16 result;
  511. };
  512. #define S_DS_GEN sizeof(struct host_cmd_ds_gen)
  513. enum sleep_resp_ctrl {
  514. RESP_NOT_NEEDED = 0,
  515. RESP_NEEDED,
  516. };
  517. struct mwifiex_ps_param {
  518. __le16 null_pkt_interval;
  519. __le16 multiple_dtims;
  520. __le16 bcn_miss_timeout;
  521. __le16 local_listen_interval;
  522. __le16 adhoc_wake_period;
  523. __le16 mode;
  524. __le16 delay_to_ps;
  525. };
  526. #define BITMAP_AUTO_DS 0x01
  527. #define BITMAP_STA_PS 0x10
  528. struct mwifiex_ie_types_auto_ds_param {
  529. struct mwifiex_ie_types_header header;
  530. __le16 deep_sleep_timeout;
  531. } __packed;
  532. struct mwifiex_ie_types_ps_param {
  533. struct mwifiex_ie_types_header header;
  534. struct mwifiex_ps_param param;
  535. } __packed;
  536. struct host_cmd_ds_802_11_ps_mode_enh {
  537. __le16 action;
  538. union {
  539. struct mwifiex_ps_param opt_ps;
  540. __le16 ps_bitmap;
  541. } params;
  542. } __packed;
  543. struct host_cmd_ds_get_hw_spec {
  544. __le16 hw_if_version;
  545. __le16 version;
  546. __le16 reserved;
  547. __le16 num_of_mcast_adr;
  548. u8 permanent_addr[ETH_ALEN];
  549. __le16 region_code;
  550. __le16 number_of_antenna;
  551. __le32 fw_release_number;
  552. __le32 reserved_1;
  553. __le32 reserved_2;
  554. __le32 reserved_3;
  555. __le32 fw_cap_info;
  556. __le32 dot_11n_dev_cap;
  557. u8 dev_mcs_support;
  558. __le16 mp_end_port; /* SDIO only, reserved for other interfacces */
  559. __le16 reserved_4;
  560. } __packed;
  561. struct host_cmd_ds_802_11_rssi_info {
  562. __le16 action;
  563. __le16 ndata;
  564. __le16 nbcn;
  565. __le16 reserved[9];
  566. long long reserved_1;
  567. };
  568. struct host_cmd_ds_802_11_rssi_info_rsp {
  569. __le16 action;
  570. __le16 ndata;
  571. __le16 nbcn;
  572. __le16 data_rssi_last;
  573. __le16 data_nf_last;
  574. __le16 data_rssi_avg;
  575. __le16 data_nf_avg;
  576. __le16 bcn_rssi_last;
  577. __le16 bcn_nf_last;
  578. __le16 bcn_rssi_avg;
  579. __le16 bcn_nf_avg;
  580. long long tsf_bcn;
  581. };
  582. struct host_cmd_ds_802_11_mac_address {
  583. __le16 action;
  584. u8 mac_addr[ETH_ALEN];
  585. };
  586. struct host_cmd_ds_mac_control {
  587. __le16 action;
  588. __le16 reserved;
  589. };
  590. struct host_cmd_ds_mac_multicast_adr {
  591. __le16 action;
  592. __le16 num_of_adrs;
  593. u8 mac_list[MWIFIEX_MAX_MULTICAST_LIST_SIZE][ETH_ALEN];
  594. } __packed;
  595. struct host_cmd_ds_802_11_deauthenticate {
  596. u8 mac_addr[ETH_ALEN];
  597. __le16 reason_code;
  598. } __packed;
  599. struct host_cmd_ds_802_11_associate {
  600. u8 peer_sta_addr[ETH_ALEN];
  601. __le16 cap_info_bitmap;
  602. __le16 listen_interval;
  603. __le16 beacon_period;
  604. u8 dtim_period;
  605. } __packed;
  606. struct ieee_types_assoc_rsp {
  607. __le16 cap_info_bitmap;
  608. __le16 status_code;
  609. __le16 a_id;
  610. u8 ie_buffer[1];
  611. } __packed;
  612. struct host_cmd_ds_802_11_associate_rsp {
  613. struct ieee_types_assoc_rsp assoc_rsp;
  614. } __packed;
  615. struct ieee_types_cf_param_set {
  616. u8 element_id;
  617. u8 len;
  618. u8 cfp_cnt;
  619. u8 cfp_period;
  620. u16 cfp_max_duration;
  621. u16 cfp_duration_remaining;
  622. } __packed;
  623. struct ieee_types_ibss_param_set {
  624. u8 element_id;
  625. u8 len;
  626. __le16 atim_window;
  627. } __packed;
  628. union ieee_types_ss_param_set {
  629. struct ieee_types_cf_param_set cf_param_set;
  630. struct ieee_types_ibss_param_set ibss_param_set;
  631. } __packed;
  632. struct ieee_types_fh_param_set {
  633. u8 element_id;
  634. u8 len;
  635. __le16 dwell_time;
  636. u8 hop_set;
  637. u8 hop_pattern;
  638. u8 hop_index;
  639. } __packed;
  640. struct ieee_types_ds_param_set {
  641. u8 element_id;
  642. u8 len;
  643. u8 current_chan;
  644. } __packed;
  645. union ieee_types_phy_param_set {
  646. struct ieee_types_fh_param_set fh_param_set;
  647. struct ieee_types_ds_param_set ds_param_set;
  648. } __packed;
  649. struct host_cmd_ds_802_11_ad_hoc_start {
  650. u8 ssid[IEEE80211_MAX_SSID_LEN];
  651. u8 bss_mode;
  652. __le16 beacon_period;
  653. u8 dtim_period;
  654. union ieee_types_ss_param_set ss_param_set;
  655. union ieee_types_phy_param_set phy_param_set;
  656. u16 reserved1;
  657. __le16 cap_info_bitmap;
  658. u8 data_rate[HOSTCMD_SUPPORTED_RATES];
  659. } __packed;
  660. struct host_cmd_ds_802_11_ad_hoc_result {
  661. u8 pad[3];
  662. u8 bssid[ETH_ALEN];
  663. } __packed;
  664. struct adhoc_bss_desc {
  665. u8 bssid[ETH_ALEN];
  666. u8 ssid[IEEE80211_MAX_SSID_LEN];
  667. u8 bss_mode;
  668. __le16 beacon_period;
  669. u8 dtim_period;
  670. u8 time_stamp[8];
  671. u8 local_time[8];
  672. union ieee_types_phy_param_set phy_param_set;
  673. union ieee_types_ss_param_set ss_param_set;
  674. __le16 cap_info_bitmap;
  675. u8 data_rates[HOSTCMD_SUPPORTED_RATES];
  676. /*
  677. * DO NOT ADD ANY FIELDS TO THIS STRUCTURE.
  678. * It is used in the Adhoc join command and will cause a
  679. * binary layout mismatch with the firmware
  680. */
  681. } __packed;
  682. struct host_cmd_ds_802_11_ad_hoc_join {
  683. struct adhoc_bss_desc bss_descriptor;
  684. u16 reserved1;
  685. u16 reserved2;
  686. } __packed;
  687. struct host_cmd_ds_802_11_get_log {
  688. __le32 mcast_tx_frame;
  689. __le32 failed;
  690. __le32 retry;
  691. __le32 multi_retry;
  692. __le32 frame_dup;
  693. __le32 rts_success;
  694. __le32 rts_failure;
  695. __le32 ack_failure;
  696. __le32 rx_frag;
  697. __le32 mcast_rx_frame;
  698. __le32 fcs_error;
  699. __le32 tx_frame;
  700. __le32 reserved;
  701. __le32 wep_icv_err_cnt[4];
  702. };
  703. struct host_cmd_ds_tx_rate_query {
  704. u8 tx_rate;
  705. /* Ht Info [Bit 0] RxRate format: LG=0, HT=1
  706. * [Bit 1] HT Bandwidth: BW20 = 0, BW40 = 1
  707. * [Bit 2] HT Guard Interval: LGI = 0, SGI = 1 */
  708. u8 ht_info;
  709. } __packed;
  710. enum Host_Sleep_Action {
  711. HS_CONFIGURE = 0x0001,
  712. HS_ACTIVATE = 0x0002,
  713. };
  714. struct mwifiex_hs_config_param {
  715. __le32 conditions;
  716. u8 gpio;
  717. u8 gap;
  718. } __packed;
  719. struct hs_activate_param {
  720. u16 resp_ctrl;
  721. } __packed;
  722. struct host_cmd_ds_802_11_hs_cfg_enh {
  723. __le16 action;
  724. union {
  725. struct mwifiex_hs_config_param hs_config;
  726. struct hs_activate_param hs_activate;
  727. } params;
  728. } __packed;
  729. enum SNMP_MIB_INDEX {
  730. OP_RATE_SET_I = 1,
  731. DTIM_PERIOD_I = 3,
  732. RTS_THRESH_I = 5,
  733. SHORT_RETRY_LIM_I = 6,
  734. LONG_RETRY_LIM_I = 7,
  735. FRAG_THRESH_I = 8,
  736. DOT11D_I = 9,
  737. };
  738. #define MAX_SNMP_BUF_SIZE 128
  739. struct host_cmd_ds_802_11_snmp_mib {
  740. __le16 query_type;
  741. __le16 oid;
  742. __le16 buf_size;
  743. u8 value[1];
  744. } __packed;
  745. struct mwifiex_rate_scope {
  746. __le16 type;
  747. __le16 length;
  748. __le16 hr_dsss_rate_bitmap;
  749. __le16 ofdm_rate_bitmap;
  750. __le16 ht_mcs_rate_bitmap[8];
  751. } __packed;
  752. struct mwifiex_rate_drop_pattern {
  753. __le16 type;
  754. __le16 length;
  755. __le32 rate_drop_mode;
  756. } __packed;
  757. struct host_cmd_ds_tx_rate_cfg {
  758. __le16 action;
  759. __le16 cfg_index;
  760. } __packed;
  761. struct mwifiex_power_group {
  762. u8 modulation_class;
  763. u8 first_rate_code;
  764. u8 last_rate_code;
  765. s8 power_step;
  766. s8 power_min;
  767. s8 power_max;
  768. u8 ht_bandwidth;
  769. u8 reserved;
  770. } __packed;
  771. struct mwifiex_types_power_group {
  772. u16 type;
  773. u16 length;
  774. } __packed;
  775. struct host_cmd_ds_txpwr_cfg {
  776. __le16 action;
  777. __le16 cfg_index;
  778. __le32 mode;
  779. } __packed;
  780. struct host_cmd_ds_rf_tx_pwr {
  781. __le16 action;
  782. __le16 cur_level;
  783. u8 max_power;
  784. u8 min_power;
  785. } __packed;
  786. struct host_cmd_ds_rf_ant_mimo {
  787. __le16 action_tx;
  788. __le16 tx_ant_mode;
  789. __le16 action_rx;
  790. __le16 rx_ant_mode;
  791. };
  792. struct host_cmd_ds_rf_ant_siso {
  793. __le16 action;
  794. __le16 ant_mode;
  795. };
  796. struct mwifiex_bcn_param {
  797. u8 bssid[ETH_ALEN];
  798. u8 rssi;
  799. __le64 timestamp;
  800. __le16 beacon_period;
  801. __le16 cap_info_bitmap;
  802. } __packed;
  803. #define MWIFIEX_USER_SCAN_CHAN_MAX 50
  804. #define MWIFIEX_MAX_SSID_LIST_LENGTH 10
  805. struct mwifiex_scan_cmd_config {
  806. /*
  807. * BSS mode to be sent in the firmware command
  808. */
  809. u8 bss_mode;
  810. /* Specific BSSID used to filter scan results in the firmware */
  811. u8 specific_bssid[ETH_ALEN];
  812. /* Length of TLVs sent in command starting at tlvBuffer */
  813. u32 tlv_buf_len;
  814. /*
  815. * SSID TLV(s) and ChanList TLVs to be sent in the firmware command
  816. *
  817. * TLV_TYPE_CHANLIST, mwifiex_ie_types_chan_list_param_set
  818. * WLAN_EID_SSID, mwifiex_ie_types_ssid_param_set
  819. */
  820. u8 tlv_buf[1]; /* SSID TLV(s) and ChanList TLVs are stored
  821. here */
  822. } __packed;
  823. struct mwifiex_user_scan_chan {
  824. u8 chan_number;
  825. u8 radio_type;
  826. u8 scan_type;
  827. u8 reserved;
  828. u32 scan_time;
  829. } __packed;
  830. struct mwifiex_user_scan_cfg {
  831. /*
  832. * BSS mode to be sent in the firmware command
  833. */
  834. u8 bss_mode;
  835. /* Configure the number of probe requests for active chan scans */
  836. u8 num_probes;
  837. u8 reserved;
  838. /* BSSID filter sent in the firmware command to limit the results */
  839. u8 specific_bssid[ETH_ALEN];
  840. /* SSID filter list used in the firmware to limit the scan results */
  841. struct cfg80211_ssid *ssid_list;
  842. u8 num_ssids;
  843. /* Variable number (fixed maximum) of channels to scan up */
  844. struct mwifiex_user_scan_chan chan_list[MWIFIEX_USER_SCAN_CHAN_MAX];
  845. } __packed;
  846. struct ie_body {
  847. u8 grp_key_oui[4];
  848. u8 ptk_cnt[2];
  849. u8 ptk_body[4];
  850. } __packed;
  851. struct host_cmd_ds_802_11_scan {
  852. u8 bss_mode;
  853. u8 bssid[ETH_ALEN];
  854. u8 tlv_buffer[1];
  855. } __packed;
  856. struct host_cmd_ds_802_11_scan_rsp {
  857. __le16 bss_descript_size;
  858. u8 number_of_sets;
  859. u8 bss_desc_and_tlv_buffer[1];
  860. } __packed;
  861. struct host_cmd_ds_802_11_bg_scan_query {
  862. u8 flush;
  863. } __packed;
  864. struct host_cmd_ds_802_11_bg_scan_query_rsp {
  865. u32 report_condition;
  866. struct host_cmd_ds_802_11_scan_rsp scan_resp;
  867. } __packed;
  868. struct mwifiex_ietypes_domain_param_set {
  869. struct mwifiex_ie_types_header header;
  870. u8 country_code[IEEE80211_COUNTRY_STRING_LEN];
  871. struct ieee80211_country_ie_triplet triplet[1];
  872. } __packed;
  873. struct host_cmd_ds_802_11d_domain_info {
  874. __le16 action;
  875. struct mwifiex_ietypes_domain_param_set domain;
  876. } __packed;
  877. struct host_cmd_ds_802_11d_domain_info_rsp {
  878. __le16 action;
  879. struct mwifiex_ietypes_domain_param_set domain;
  880. } __packed;
  881. struct host_cmd_ds_11n_addba_req {
  882. u8 add_req_result;
  883. u8 peer_mac_addr[ETH_ALEN];
  884. u8 dialog_token;
  885. __le16 block_ack_param_set;
  886. __le16 block_ack_tmo;
  887. __le16 ssn;
  888. } __packed;
  889. struct host_cmd_ds_11n_addba_rsp {
  890. u8 add_rsp_result;
  891. u8 peer_mac_addr[ETH_ALEN];
  892. u8 dialog_token;
  893. __le16 status_code;
  894. __le16 block_ack_param_set;
  895. __le16 block_ack_tmo;
  896. __le16 ssn;
  897. } __packed;
  898. struct host_cmd_ds_11n_delba {
  899. u8 del_result;
  900. u8 peer_mac_addr[ETH_ALEN];
  901. __le16 del_ba_param_set;
  902. __le16 reason_code;
  903. u8 reserved;
  904. } __packed;
  905. struct host_cmd_ds_11n_batimeout {
  906. u8 tid;
  907. u8 peer_mac_addr[ETH_ALEN];
  908. u8 origninator;
  909. } __packed;
  910. struct host_cmd_ds_11n_cfg {
  911. __le16 action;
  912. __le16 ht_tx_cap;
  913. __le16 ht_tx_info;
  914. } __packed;
  915. struct host_cmd_ds_txbuf_cfg {
  916. __le16 action;
  917. __le16 buff_size;
  918. __le16 mp_end_port; /* SDIO only, reserved for other interfacces */
  919. __le16 reserved3;
  920. } __packed;
  921. struct host_cmd_ds_amsdu_aggr_ctrl {
  922. __le16 action;
  923. __le16 enable;
  924. __le16 curr_buf_size;
  925. } __packed;
  926. struct mwifiex_ie_types_wmm_param_set {
  927. struct mwifiex_ie_types_header header;
  928. u8 wmm_ie[1];
  929. };
  930. struct mwifiex_ie_types_wmm_queue_status {
  931. struct mwifiex_ie_types_header header;
  932. u8 queue_index;
  933. u8 disabled;
  934. u16 medium_time;
  935. u8 flow_required;
  936. u8 flow_created;
  937. u32 reserved;
  938. };
  939. struct ieee_types_vendor_header {
  940. u8 element_id;
  941. u8 len;
  942. u8 oui[4]; /* 0~2: oui, 3: oui_type */
  943. u8 oui_subtype;
  944. u8 version;
  945. } __packed;
  946. struct ieee_types_wmm_ac_parameters {
  947. u8 aci_aifsn_bitmap;
  948. u8 ecw_bitmap;
  949. __le16 tx_op_limit;
  950. } __packed;
  951. struct ieee_types_wmm_parameter {
  952. /*
  953. * WMM Parameter IE - Vendor Specific Header:
  954. * element_id [221/0xdd]
  955. * Len [24]
  956. * Oui [00:50:f2]
  957. * OuiType [2]
  958. * OuiSubType [1]
  959. * Version [1]
  960. */
  961. struct ieee_types_vendor_header vend_hdr;
  962. u8 qos_info_bitmap;
  963. u8 reserved;
  964. struct ieee_types_wmm_ac_parameters ac_params[IEEE80211_NUM_ACS];
  965. } __packed;
  966. struct ieee_types_wmm_info {
  967. /*
  968. * WMM Info IE - Vendor Specific Header:
  969. * element_id [221/0xdd]
  970. * Len [7]
  971. * Oui [00:50:f2]
  972. * OuiType [2]
  973. * OuiSubType [0]
  974. * Version [1]
  975. */
  976. struct ieee_types_vendor_header vend_hdr;
  977. u8 qos_info_bitmap;
  978. } __packed;
  979. struct host_cmd_ds_wmm_get_status {
  980. u8 queue_status_tlv[sizeof(struct mwifiex_ie_types_wmm_queue_status) *
  981. IEEE80211_NUM_ACS];
  982. u8 wmm_param_tlv[sizeof(struct ieee_types_wmm_parameter) + 2];
  983. } __packed;
  984. struct mwifiex_wmm_ac_status {
  985. u8 disabled;
  986. u8 flow_required;
  987. u8 flow_created;
  988. };
  989. struct mwifiex_ie_types_htcap {
  990. struct mwifiex_ie_types_header header;
  991. struct ieee80211_ht_cap ht_cap;
  992. } __packed;
  993. struct mwifiex_ie_types_htinfo {
  994. struct mwifiex_ie_types_header header;
  995. struct ieee80211_ht_operation ht_oper;
  996. } __packed;
  997. struct mwifiex_ie_types_2040bssco {
  998. struct mwifiex_ie_types_header header;
  999. u8 bss_co_2040;
  1000. } __packed;
  1001. struct mwifiex_ie_types_extcap {
  1002. struct mwifiex_ie_types_header header;
  1003. u8 ext_cap;
  1004. } __packed;
  1005. struct host_cmd_ds_mac_reg_access {
  1006. __le16 action;
  1007. __le16 offset;
  1008. __le32 value;
  1009. } __packed;
  1010. struct host_cmd_ds_bbp_reg_access {
  1011. __le16 action;
  1012. __le16 offset;
  1013. u8 value;
  1014. u8 reserved[3];
  1015. } __packed;
  1016. struct host_cmd_ds_rf_reg_access {
  1017. __le16 action;
  1018. __le16 offset;
  1019. u8 value;
  1020. u8 reserved[3];
  1021. } __packed;
  1022. struct host_cmd_ds_pmic_reg_access {
  1023. __le16 action;
  1024. __le16 offset;
  1025. u8 value;
  1026. u8 reserved[3];
  1027. } __packed;
  1028. struct host_cmd_ds_802_11_eeprom_access {
  1029. __le16 action;
  1030. __le16 offset;
  1031. __le16 byte_count;
  1032. u8 value;
  1033. } __packed;
  1034. struct host_cmd_tlv {
  1035. __le16 type;
  1036. __le16 len;
  1037. } __packed;
  1038. struct mwifiex_assoc_event {
  1039. u8 sta_addr[ETH_ALEN];
  1040. __le16 type;
  1041. __le16 len;
  1042. __le16 frame_control;
  1043. __le16 cap_info;
  1044. __le16 listen_interval;
  1045. u8 data[0];
  1046. } __packed;
  1047. struct host_cmd_ds_sys_config {
  1048. __le16 action;
  1049. u8 tlv[0];
  1050. };
  1051. struct host_cmd_tlv_akmp {
  1052. struct host_cmd_tlv tlv;
  1053. __le16 key_mgmt;
  1054. __le16 key_mgmt_operation;
  1055. } __packed;
  1056. struct host_cmd_tlv_pwk_cipher {
  1057. struct host_cmd_tlv tlv;
  1058. __le16 proto;
  1059. u8 cipher;
  1060. u8 reserved;
  1061. } __packed;
  1062. struct host_cmd_tlv_gwk_cipher {
  1063. struct host_cmd_tlv tlv;
  1064. u8 cipher;
  1065. u8 reserved;
  1066. } __packed;
  1067. struct host_cmd_tlv_passphrase {
  1068. struct host_cmd_tlv tlv;
  1069. u8 passphrase[0];
  1070. } __packed;
  1071. struct host_cmd_tlv_wep_key {
  1072. struct host_cmd_tlv tlv;
  1073. u8 key_index;
  1074. u8 is_default;
  1075. u8 key[1];
  1076. };
  1077. struct host_cmd_tlv_auth_type {
  1078. struct host_cmd_tlv tlv;
  1079. u8 auth_type;
  1080. } __packed;
  1081. struct host_cmd_tlv_encrypt_protocol {
  1082. struct host_cmd_tlv tlv;
  1083. __le16 proto;
  1084. } __packed;
  1085. struct host_cmd_tlv_ssid {
  1086. struct host_cmd_tlv tlv;
  1087. u8 ssid[0];
  1088. } __packed;
  1089. struct host_cmd_tlv_bcast_ssid {
  1090. struct host_cmd_tlv tlv;
  1091. u8 bcast_ctl;
  1092. } __packed;
  1093. struct host_cmd_tlv_beacon_period {
  1094. struct host_cmd_tlv tlv;
  1095. __le16 period;
  1096. } __packed;
  1097. struct host_cmd_tlv_dtim_period {
  1098. struct host_cmd_tlv tlv;
  1099. u8 period;
  1100. } __packed;
  1101. struct host_cmd_tlv_frag_threshold {
  1102. struct host_cmd_tlv tlv;
  1103. __le16 frag_thr;
  1104. } __packed;
  1105. struct host_cmd_tlv_rts_threshold {
  1106. struct host_cmd_tlv tlv;
  1107. __le16 rts_thr;
  1108. } __packed;
  1109. struct host_cmd_tlv_retry_limit {
  1110. struct host_cmd_tlv tlv;
  1111. u8 limit;
  1112. } __packed;
  1113. struct host_cmd_tlv_mac_addr {
  1114. struct host_cmd_tlv tlv;
  1115. u8 mac_addr[ETH_ALEN];
  1116. } __packed;
  1117. struct host_cmd_tlv_channel_band {
  1118. struct host_cmd_tlv tlv;
  1119. u8 band_config;
  1120. u8 channel;
  1121. } __packed;
  1122. struct host_cmd_ds_version_ext {
  1123. u8 version_str_sel;
  1124. char version_str[128];
  1125. } __packed;
  1126. struct host_cmd_ds_802_11_ibss_status {
  1127. __le16 action;
  1128. __le16 enable;
  1129. u8 bssid[ETH_ALEN];
  1130. __le16 beacon_interval;
  1131. __le16 atim_window;
  1132. __le16 use_g_rate_protect;
  1133. } __packed;
  1134. #define CONNECTION_TYPE_INFRA 0
  1135. #define CONNECTION_TYPE_ADHOC 1
  1136. struct host_cmd_ds_set_bss_mode {
  1137. u8 con_type;
  1138. } __packed;
  1139. struct host_cmd_ds_pcie_details {
  1140. /* TX buffer descriptor ring address */
  1141. u32 txbd_addr_lo;
  1142. u32 txbd_addr_hi;
  1143. /* TX buffer descriptor ring count */
  1144. u32 txbd_count;
  1145. /* RX buffer descriptor ring address */
  1146. u32 rxbd_addr_lo;
  1147. u32 rxbd_addr_hi;
  1148. /* RX buffer descriptor ring count */
  1149. u32 rxbd_count;
  1150. /* Event buffer descriptor ring address */
  1151. u32 evtbd_addr_lo;
  1152. u32 evtbd_addr_hi;
  1153. /* Event buffer descriptor ring count */
  1154. u32 evtbd_count;
  1155. /* Sleep cookie buffer physical address */
  1156. u32 sleep_cookie_addr_lo;
  1157. u32 sleep_cookie_addr_hi;
  1158. } __packed;
  1159. struct mwifiex_ie_types_rssi_threshold {
  1160. struct mwifiex_ie_types_header header;
  1161. u8 abs_value;
  1162. u8 evt_freq;
  1163. } __packed;
  1164. struct host_cmd_ds_802_11_subsc_evt {
  1165. __le16 action;
  1166. __le16 events;
  1167. } __packed;
  1168. struct mwifiex_ie {
  1169. __le16 ie_index;
  1170. __le16 mgmt_subtype_mask;
  1171. __le16 ie_length;
  1172. u8 ie_buffer[IEEE_MAX_IE_SIZE];
  1173. } __packed;
  1174. #define MAX_MGMT_IE_INDEX 16
  1175. struct mwifiex_ie_list {
  1176. __le16 type;
  1177. __le16 len;
  1178. struct mwifiex_ie ie_list[MAX_MGMT_IE_INDEX];
  1179. } __packed;
  1180. struct host_cmd_ds_command {
  1181. __le16 command;
  1182. __le16 size;
  1183. __le16 seq_num;
  1184. __le16 result;
  1185. union {
  1186. struct host_cmd_ds_get_hw_spec hw_spec;
  1187. struct host_cmd_ds_mac_control mac_ctrl;
  1188. struct host_cmd_ds_802_11_mac_address mac_addr;
  1189. struct host_cmd_ds_mac_multicast_adr mc_addr;
  1190. struct host_cmd_ds_802_11_get_log get_log;
  1191. struct host_cmd_ds_802_11_rssi_info rssi_info;
  1192. struct host_cmd_ds_802_11_rssi_info_rsp rssi_info_rsp;
  1193. struct host_cmd_ds_802_11_snmp_mib smib;
  1194. struct host_cmd_ds_tx_rate_query tx_rate;
  1195. struct host_cmd_ds_tx_rate_cfg tx_rate_cfg;
  1196. struct host_cmd_ds_txpwr_cfg txp_cfg;
  1197. struct host_cmd_ds_rf_tx_pwr txp;
  1198. struct host_cmd_ds_rf_ant_mimo ant_mimo;
  1199. struct host_cmd_ds_rf_ant_siso ant_siso;
  1200. struct host_cmd_ds_802_11_ps_mode_enh psmode_enh;
  1201. struct host_cmd_ds_802_11_hs_cfg_enh opt_hs_cfg;
  1202. struct host_cmd_ds_802_11_scan scan;
  1203. struct host_cmd_ds_802_11_scan_rsp scan_resp;
  1204. struct host_cmd_ds_802_11_bg_scan_query bg_scan_query;
  1205. struct host_cmd_ds_802_11_bg_scan_query_rsp bg_scan_query_resp;
  1206. struct host_cmd_ds_802_11_associate associate;
  1207. struct host_cmd_ds_802_11_associate_rsp associate_rsp;
  1208. struct host_cmd_ds_802_11_deauthenticate deauth;
  1209. struct host_cmd_ds_802_11_ad_hoc_start adhoc_start;
  1210. struct host_cmd_ds_802_11_ad_hoc_result adhoc_result;
  1211. struct host_cmd_ds_802_11_ad_hoc_join adhoc_join;
  1212. struct host_cmd_ds_802_11d_domain_info domain_info;
  1213. struct host_cmd_ds_802_11d_domain_info_rsp domain_info_resp;
  1214. struct host_cmd_ds_11n_addba_req add_ba_req;
  1215. struct host_cmd_ds_11n_addba_rsp add_ba_rsp;
  1216. struct host_cmd_ds_11n_delba del_ba;
  1217. struct host_cmd_ds_txbuf_cfg tx_buf;
  1218. struct host_cmd_ds_amsdu_aggr_ctrl amsdu_aggr_ctrl;
  1219. struct host_cmd_ds_11n_cfg htcfg;
  1220. struct host_cmd_ds_wmm_get_status get_wmm_status;
  1221. struct host_cmd_ds_802_11_key_material key_material;
  1222. struct host_cmd_ds_version_ext verext;
  1223. struct host_cmd_ds_802_11_ibss_status ibss_coalescing;
  1224. struct host_cmd_ds_mac_reg_access mac_reg;
  1225. struct host_cmd_ds_bbp_reg_access bbp_reg;
  1226. struct host_cmd_ds_rf_reg_access rf_reg;
  1227. struct host_cmd_ds_pmic_reg_access pmic_reg;
  1228. struct host_cmd_ds_set_bss_mode bss_mode;
  1229. struct host_cmd_ds_pcie_details pcie_host_spec;
  1230. struct host_cmd_ds_802_11_eeprom_access eeprom;
  1231. struct host_cmd_ds_802_11_subsc_evt subsc_evt;
  1232. struct host_cmd_ds_sys_config uap_sys_config;
  1233. } params;
  1234. } __packed;
  1235. struct mwifiex_opt_sleep_confirm {
  1236. __le16 command;
  1237. __le16 size;
  1238. __le16 seq_num;
  1239. __le16 result;
  1240. __le16 action;
  1241. __le16 resp_ctrl;
  1242. } __packed;
  1243. #endif /* !_MWIFIEX_FW_H_ */