fw.h 36 KB

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