fw.h 37 KB

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