fw.h 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428
  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_RF_TX_PWR 0x001e
  190. #define HostCmd_CMD_RF_ANTENNA 0x0020
  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_ACT_SET_RX 0x0001
  274. #define HostCmd_ACT_SET_TX 0x0002
  275. #define HostCmd_ACT_SET_BOTH 0x0003
  276. #define RF_ANTENNA_AUTO 0xFFFF
  277. #define HostCmd_SET_SEQ_NO_BSS_INFO(seq, num, type) { \
  278. (((seq) & 0x00ff) | \
  279. (((num) & 0x000f) << 8)) | \
  280. (((type) & 0x000f) << 12); }
  281. #define HostCmd_GET_SEQ_NO(seq) \
  282. ((seq) & HostCmd_SEQ_NUM_MASK)
  283. #define HostCmd_GET_BSS_NO(seq) \
  284. (((seq) & HostCmd_BSS_NUM_MASK) >> 8)
  285. #define HostCmd_GET_BSS_TYPE(seq) \
  286. (((seq) & HostCmd_BSS_TYPE_MASK) >> 12)
  287. #define EVENT_DUMMY_HOST_WAKEUP_SIGNAL 0x00000001
  288. #define EVENT_LINK_LOST 0x00000003
  289. #define EVENT_LINK_SENSED 0x00000004
  290. #define EVENT_MIB_CHANGED 0x00000006
  291. #define EVENT_INIT_DONE 0x00000007
  292. #define EVENT_DEAUTHENTICATED 0x00000008
  293. #define EVENT_DISASSOCIATED 0x00000009
  294. #define EVENT_PS_AWAKE 0x0000000a
  295. #define EVENT_PS_SLEEP 0x0000000b
  296. #define EVENT_MIC_ERR_MULTICAST 0x0000000d
  297. #define EVENT_MIC_ERR_UNICAST 0x0000000e
  298. #define EVENT_DEEP_SLEEP_AWAKE 0x00000010
  299. #define EVENT_ADHOC_BCN_LOST 0x00000011
  300. #define EVENT_WMM_STATUS_CHANGE 0x00000017
  301. #define EVENT_BG_SCAN_REPORT 0x00000018
  302. #define EVENT_RSSI_LOW 0x00000019
  303. #define EVENT_SNR_LOW 0x0000001a
  304. #define EVENT_MAX_FAIL 0x0000001b
  305. #define EVENT_RSSI_HIGH 0x0000001c
  306. #define EVENT_SNR_HIGH 0x0000001d
  307. #define EVENT_IBSS_COALESCED 0x0000001e
  308. #define EVENT_DATA_RSSI_LOW 0x00000024
  309. #define EVENT_DATA_SNR_LOW 0x00000025
  310. #define EVENT_DATA_RSSI_HIGH 0x00000026
  311. #define EVENT_DATA_SNR_HIGH 0x00000027
  312. #define EVENT_LINK_QUALITY 0x00000028
  313. #define EVENT_PORT_RELEASE 0x0000002b
  314. #define EVENT_UAP_STA_DEAUTH 0x0000002c
  315. #define EVENT_UAP_STA_ASSOC 0x0000002d
  316. #define EVENT_UAP_BSS_START 0x0000002e
  317. #define EVENT_PRE_BEACON_LOST 0x00000031
  318. #define EVENT_ADDBA 0x00000033
  319. #define EVENT_DELBA 0x00000034
  320. #define EVENT_BA_STREAM_TIEMOUT 0x00000037
  321. #define EVENT_AMSDU_AGGR_CTRL 0x00000042
  322. #define EVENT_UAP_BSS_IDLE 0x00000043
  323. #define EVENT_UAP_BSS_ACTIVE 0x00000044
  324. #define EVENT_WEP_ICV_ERR 0x00000046
  325. #define EVENT_HS_ACT_REQ 0x00000047
  326. #define EVENT_BW_CHANGE 0x00000048
  327. #define EVENT_UAP_MIC_COUNTERMEASURES 0x0000004c
  328. #define EVENT_HOSTWAKE_STAIE 0x0000004d
  329. #define EVENT_ID_MASK 0xffff
  330. #define BSS_NUM_MASK 0xf
  331. #define EVENT_GET_BSS_NUM(event_cause) \
  332. (((event_cause) >> 16) & BSS_NUM_MASK)
  333. #define EVENT_GET_BSS_TYPE(event_cause) \
  334. (((event_cause) >> 24) & 0x00ff)
  335. struct mwifiex_ie_types_header {
  336. __le16 type;
  337. __le16 len;
  338. } __packed;
  339. struct mwifiex_ie_types_data {
  340. struct mwifiex_ie_types_header header;
  341. u8 data[1];
  342. } __packed;
  343. #define MWIFIEX_TxPD_POWER_MGMT_NULL_PACKET 0x01
  344. #define MWIFIEX_TxPD_POWER_MGMT_LAST_PACKET 0x08
  345. struct txpd {
  346. u8 bss_type;
  347. u8 bss_num;
  348. __le16 tx_pkt_length;
  349. __le16 tx_pkt_offset;
  350. __le16 tx_pkt_type;
  351. __le32 tx_control;
  352. u8 priority;
  353. u8 flags;
  354. u8 pkt_delay_2ms;
  355. u8 reserved1;
  356. } __packed;
  357. struct rxpd {
  358. u8 bss_type;
  359. u8 bss_num;
  360. u16 rx_pkt_length;
  361. u16 rx_pkt_offset;
  362. u16 rx_pkt_type;
  363. u16 seq_num;
  364. u8 priority;
  365. u8 rx_rate;
  366. s8 snr;
  367. s8 nf;
  368. /* Ht Info [Bit 0] RxRate format: LG=0, HT=1
  369. * [Bit 1] HT Bandwidth: BW20 = 0, BW40 = 1
  370. * [Bit 2] HT Guard Interval: LGI = 0, SGI = 1 */
  371. u8 ht_info;
  372. u8 reserved;
  373. } __packed;
  374. enum mwifiex_chan_scan_mode_bitmasks {
  375. MWIFIEX_PASSIVE_SCAN = BIT(0),
  376. MWIFIEX_DISABLE_CHAN_FILT = BIT(1),
  377. };
  378. struct mwifiex_chan_scan_param_set {
  379. u8 radio_type;
  380. u8 chan_number;
  381. u8 chan_scan_mode_bitmap;
  382. __le16 min_scan_time;
  383. __le16 max_scan_time;
  384. } __packed;
  385. struct mwifiex_ie_types_chan_list_param_set {
  386. struct mwifiex_ie_types_header header;
  387. struct mwifiex_chan_scan_param_set chan_scan_param[1];
  388. } __packed;
  389. struct chan_band_param_set {
  390. u8 radio_type;
  391. u8 chan_number;
  392. };
  393. struct mwifiex_ie_types_chan_band_list_param_set {
  394. struct mwifiex_ie_types_header header;
  395. struct chan_band_param_set chan_band_param[1];
  396. } __packed;
  397. struct mwifiex_ie_types_rates_param_set {
  398. struct mwifiex_ie_types_header header;
  399. u8 rates[1];
  400. } __packed;
  401. struct mwifiex_ie_types_ssid_param_set {
  402. struct mwifiex_ie_types_header header;
  403. u8 ssid[1];
  404. } __packed;
  405. struct mwifiex_ie_types_num_probes {
  406. struct mwifiex_ie_types_header header;
  407. __le16 num_probes;
  408. } __packed;
  409. struct mwifiex_ie_types_wildcard_ssid_params {
  410. struct mwifiex_ie_types_header header;
  411. u8 max_ssid_length;
  412. u8 ssid[1];
  413. } __packed;
  414. #define TSF_DATA_SIZE 8
  415. struct mwifiex_ie_types_tsf_timestamp {
  416. struct mwifiex_ie_types_header header;
  417. u8 tsf_data[1];
  418. } __packed;
  419. struct mwifiex_cf_param_set {
  420. u8 cfp_cnt;
  421. u8 cfp_period;
  422. u16 cfp_max_duration;
  423. u16 cfp_duration_remaining;
  424. } __packed;
  425. struct mwifiex_ibss_param_set {
  426. u16 atim_window;
  427. } __packed;
  428. struct mwifiex_ie_types_ss_param_set {
  429. struct mwifiex_ie_types_header header;
  430. union {
  431. struct mwifiex_cf_param_set cf_param_set[1];
  432. struct mwifiex_ibss_param_set ibss_param_set[1];
  433. } cf_ibss;
  434. } __packed;
  435. struct mwifiex_fh_param_set {
  436. u16 dwell_time;
  437. u8 hop_set;
  438. u8 hop_pattern;
  439. u8 hop_index;
  440. } __packed;
  441. struct mwifiex_ds_param_set {
  442. u8 current_chan;
  443. } __packed;
  444. struct mwifiex_ie_types_phy_param_set {
  445. struct mwifiex_ie_types_header header;
  446. union {
  447. struct mwifiex_fh_param_set fh_param_set[1];
  448. struct mwifiex_ds_param_set ds_param_set[1];
  449. } fh_ds;
  450. } __packed;
  451. struct mwifiex_ie_types_auth_type {
  452. struct mwifiex_ie_types_header header;
  453. __le16 auth_type;
  454. } __packed;
  455. struct mwifiex_ie_types_vendor_param_set {
  456. struct mwifiex_ie_types_header header;
  457. u8 ie[MWIFIEX_MAX_VSIE_LEN];
  458. };
  459. struct mwifiex_ie_types_rsn_param_set {
  460. struct mwifiex_ie_types_header header;
  461. u8 rsn_ie[1];
  462. } __packed;
  463. #define KEYPARAMSET_FIXED_LEN 6
  464. struct mwifiex_ie_type_key_param_set {
  465. __le16 type;
  466. __le16 length;
  467. __le16 key_type_id;
  468. __le16 key_info;
  469. __le16 key_len;
  470. u8 key[50];
  471. } __packed;
  472. struct host_cmd_ds_802_11_key_material {
  473. __le16 action;
  474. struct mwifiex_ie_type_key_param_set key_param_set;
  475. } __packed;
  476. struct host_cmd_ds_gen {
  477. u16 command;
  478. u16 size;
  479. u16 seq_num;
  480. u16 result;
  481. };
  482. #define S_DS_GEN sizeof(struct host_cmd_ds_gen)
  483. enum sleep_resp_ctrl {
  484. RESP_NOT_NEEDED = 0,
  485. RESP_NEEDED,
  486. };
  487. struct mwifiex_ps_param {
  488. __le16 null_pkt_interval;
  489. __le16 multiple_dtims;
  490. __le16 bcn_miss_timeout;
  491. __le16 local_listen_interval;
  492. __le16 adhoc_wake_period;
  493. __le16 mode;
  494. __le16 delay_to_ps;
  495. };
  496. #define BITMAP_AUTO_DS 0x01
  497. #define BITMAP_STA_PS 0x10
  498. struct mwifiex_ie_types_auto_ds_param {
  499. struct mwifiex_ie_types_header header;
  500. __le16 deep_sleep_timeout;
  501. } __packed;
  502. struct mwifiex_ie_types_ps_param {
  503. struct mwifiex_ie_types_header header;
  504. struct mwifiex_ps_param param;
  505. } __packed;
  506. struct host_cmd_ds_802_11_ps_mode_enh {
  507. __le16 action;
  508. union {
  509. struct mwifiex_ps_param opt_ps;
  510. __le16 ps_bitmap;
  511. } params;
  512. } __packed;
  513. struct host_cmd_ds_get_hw_spec {
  514. __le16 hw_if_version;
  515. __le16 version;
  516. __le16 reserved;
  517. __le16 num_of_mcast_adr;
  518. u8 permanent_addr[ETH_ALEN];
  519. __le16 region_code;
  520. __le16 number_of_antenna;
  521. __le32 fw_release_number;
  522. __le32 reserved_1;
  523. __le32 reserved_2;
  524. __le32 reserved_3;
  525. __le32 fw_cap_info;
  526. __le32 dot_11n_dev_cap;
  527. u8 dev_mcs_support;
  528. __le16 mp_end_port; /* SDIO only, reserved for other interfacces */
  529. __le16 reserved_4;
  530. } __packed;
  531. struct host_cmd_ds_802_11_rssi_info {
  532. __le16 action;
  533. __le16 ndata;
  534. __le16 nbcn;
  535. __le16 reserved[9];
  536. long long reserved_1;
  537. };
  538. struct host_cmd_ds_802_11_rssi_info_rsp {
  539. __le16 action;
  540. __le16 ndata;
  541. __le16 nbcn;
  542. __le16 data_rssi_last;
  543. __le16 data_nf_last;
  544. __le16 data_rssi_avg;
  545. __le16 data_nf_avg;
  546. __le16 bcn_rssi_last;
  547. __le16 bcn_nf_last;
  548. __le16 bcn_rssi_avg;
  549. __le16 bcn_nf_avg;
  550. long long tsf_bcn;
  551. };
  552. struct host_cmd_ds_802_11_mac_address {
  553. __le16 action;
  554. u8 mac_addr[ETH_ALEN];
  555. };
  556. struct host_cmd_ds_mac_control {
  557. __le16 action;
  558. __le16 reserved;
  559. };
  560. struct host_cmd_ds_mac_multicast_adr {
  561. __le16 action;
  562. __le16 num_of_adrs;
  563. u8 mac_list[MWIFIEX_MAX_MULTICAST_LIST_SIZE][ETH_ALEN];
  564. } __packed;
  565. struct host_cmd_ds_802_11_deauthenticate {
  566. u8 mac_addr[ETH_ALEN];
  567. __le16 reason_code;
  568. } __packed;
  569. struct host_cmd_ds_802_11_associate {
  570. u8 peer_sta_addr[ETH_ALEN];
  571. __le16 cap_info_bitmap;
  572. __le16 listen_interval;
  573. __le16 beacon_period;
  574. u8 dtim_period;
  575. } __packed;
  576. struct ieee_types_assoc_rsp {
  577. __le16 cap_info_bitmap;
  578. __le16 status_code;
  579. __le16 a_id;
  580. u8 ie_buffer[1];
  581. } __packed;
  582. struct host_cmd_ds_802_11_associate_rsp {
  583. struct ieee_types_assoc_rsp assoc_rsp;
  584. } __packed;
  585. struct ieee_types_cf_param_set {
  586. u8 element_id;
  587. u8 len;
  588. u8 cfp_cnt;
  589. u8 cfp_period;
  590. u16 cfp_max_duration;
  591. u16 cfp_duration_remaining;
  592. } __packed;
  593. struct ieee_types_ibss_param_set {
  594. u8 element_id;
  595. u8 len;
  596. __le16 atim_window;
  597. } __packed;
  598. union ieee_types_ss_param_set {
  599. struct ieee_types_cf_param_set cf_param_set;
  600. struct ieee_types_ibss_param_set ibss_param_set;
  601. } __packed;
  602. struct ieee_types_fh_param_set {
  603. u8 element_id;
  604. u8 len;
  605. __le16 dwell_time;
  606. u8 hop_set;
  607. u8 hop_pattern;
  608. u8 hop_index;
  609. } __packed;
  610. struct ieee_types_ds_param_set {
  611. u8 element_id;
  612. u8 len;
  613. u8 current_chan;
  614. } __packed;
  615. union ieee_types_phy_param_set {
  616. struct ieee_types_fh_param_set fh_param_set;
  617. struct ieee_types_ds_param_set ds_param_set;
  618. } __packed;
  619. struct host_cmd_ds_802_11_ad_hoc_start {
  620. u8 ssid[IEEE80211_MAX_SSID_LEN];
  621. u8 bss_mode;
  622. __le16 beacon_period;
  623. u8 dtim_period;
  624. union ieee_types_ss_param_set ss_param_set;
  625. union ieee_types_phy_param_set phy_param_set;
  626. u16 reserved1;
  627. __le16 cap_info_bitmap;
  628. u8 data_rate[HOSTCMD_SUPPORTED_RATES];
  629. } __packed;
  630. struct host_cmd_ds_802_11_ad_hoc_result {
  631. u8 pad[3];
  632. u8 bssid[ETH_ALEN];
  633. } __packed;
  634. struct adhoc_bss_desc {
  635. u8 bssid[ETH_ALEN];
  636. u8 ssid[IEEE80211_MAX_SSID_LEN];
  637. u8 bss_mode;
  638. __le16 beacon_period;
  639. u8 dtim_period;
  640. u8 time_stamp[8];
  641. u8 local_time[8];
  642. union ieee_types_phy_param_set phy_param_set;
  643. union ieee_types_ss_param_set ss_param_set;
  644. __le16 cap_info_bitmap;
  645. u8 data_rates[HOSTCMD_SUPPORTED_RATES];
  646. /*
  647. * DO NOT ADD ANY FIELDS TO THIS STRUCTURE.
  648. * It is used in the Adhoc join command and will cause a
  649. * binary layout mismatch with the firmware
  650. */
  651. } __packed;
  652. struct host_cmd_ds_802_11_ad_hoc_join {
  653. struct adhoc_bss_desc bss_descriptor;
  654. u16 reserved1;
  655. u16 reserved2;
  656. } __packed;
  657. struct host_cmd_ds_802_11_get_log {
  658. __le32 mcast_tx_frame;
  659. __le32 failed;
  660. __le32 retry;
  661. __le32 multi_retry;
  662. __le32 frame_dup;
  663. __le32 rts_success;
  664. __le32 rts_failure;
  665. __le32 ack_failure;
  666. __le32 rx_frag;
  667. __le32 mcast_rx_frame;
  668. __le32 fcs_error;
  669. __le32 tx_frame;
  670. __le32 reserved;
  671. __le32 wep_icv_err_cnt[4];
  672. };
  673. struct host_cmd_ds_tx_rate_query {
  674. u8 tx_rate;
  675. /* Ht Info [Bit 0] RxRate format: LG=0, HT=1
  676. * [Bit 1] HT Bandwidth: BW20 = 0, BW40 = 1
  677. * [Bit 2] HT Guard Interval: LGI = 0, SGI = 1 */
  678. u8 ht_info;
  679. } __packed;
  680. enum Host_Sleep_Action {
  681. HS_CONFIGURE = 0x0001,
  682. HS_ACTIVATE = 0x0002,
  683. };
  684. struct mwifiex_hs_config_param {
  685. __le32 conditions;
  686. u8 gpio;
  687. u8 gap;
  688. } __packed;
  689. struct hs_activate_param {
  690. u16 resp_ctrl;
  691. } __packed;
  692. struct host_cmd_ds_802_11_hs_cfg_enh {
  693. __le16 action;
  694. union {
  695. struct mwifiex_hs_config_param hs_config;
  696. struct hs_activate_param hs_activate;
  697. } params;
  698. } __packed;
  699. enum SNMP_MIB_INDEX {
  700. OP_RATE_SET_I = 1,
  701. DTIM_PERIOD_I = 3,
  702. RTS_THRESH_I = 5,
  703. SHORT_RETRY_LIM_I = 6,
  704. LONG_RETRY_LIM_I = 7,
  705. FRAG_THRESH_I = 8,
  706. DOT11D_I = 9,
  707. };
  708. #define MAX_SNMP_BUF_SIZE 128
  709. struct host_cmd_ds_802_11_snmp_mib {
  710. __le16 query_type;
  711. __le16 oid;
  712. __le16 buf_size;
  713. u8 value[1];
  714. } __packed;
  715. struct mwifiex_rate_scope {
  716. __le16 type;
  717. __le16 length;
  718. __le16 hr_dsss_rate_bitmap;
  719. __le16 ofdm_rate_bitmap;
  720. __le16 ht_mcs_rate_bitmap[8];
  721. } __packed;
  722. struct mwifiex_rate_drop_pattern {
  723. __le16 type;
  724. __le16 length;
  725. __le32 rate_drop_mode;
  726. } __packed;
  727. struct host_cmd_ds_tx_rate_cfg {
  728. __le16 action;
  729. __le16 cfg_index;
  730. } __packed;
  731. struct mwifiex_power_group {
  732. u8 modulation_class;
  733. u8 first_rate_code;
  734. u8 last_rate_code;
  735. s8 power_step;
  736. s8 power_min;
  737. s8 power_max;
  738. u8 ht_bandwidth;
  739. u8 reserved;
  740. } __packed;
  741. struct mwifiex_types_power_group {
  742. u16 type;
  743. u16 length;
  744. } __packed;
  745. struct host_cmd_ds_txpwr_cfg {
  746. __le16 action;
  747. __le16 cfg_index;
  748. __le32 mode;
  749. } __packed;
  750. struct host_cmd_ds_rf_tx_pwr {
  751. __le16 action;
  752. __le16 cur_level;
  753. u8 max_power;
  754. u8 min_power;
  755. } __packed;
  756. struct host_cmd_ds_rf_ant_mimo {
  757. __le16 action_tx;
  758. __le16 tx_ant_mode;
  759. __le16 action_rx;
  760. __le16 rx_ant_mode;
  761. };
  762. struct host_cmd_ds_rf_ant_siso {
  763. __le16 action;
  764. __le16 ant_mode;
  765. };
  766. struct mwifiex_bcn_param {
  767. u8 bssid[ETH_ALEN];
  768. u8 rssi;
  769. __le64 timestamp;
  770. __le16 beacon_period;
  771. __le16 cap_info_bitmap;
  772. } __packed;
  773. #define MWIFIEX_USER_SCAN_CHAN_MAX 50
  774. #define MWIFIEX_MAX_SSID_LIST_LENGTH 10
  775. struct mwifiex_scan_cmd_config {
  776. /*
  777. * BSS mode to be sent in the firmware command
  778. */
  779. u8 bss_mode;
  780. /* Specific BSSID used to filter scan results in the firmware */
  781. u8 specific_bssid[ETH_ALEN];
  782. /* Length of TLVs sent in command starting at tlvBuffer */
  783. u32 tlv_buf_len;
  784. /*
  785. * SSID TLV(s) and ChanList TLVs to be sent in the firmware command
  786. *
  787. * TLV_TYPE_CHANLIST, mwifiex_ie_types_chan_list_param_set
  788. * WLAN_EID_SSID, mwifiex_ie_types_ssid_param_set
  789. */
  790. u8 tlv_buf[1]; /* SSID TLV(s) and ChanList TLVs are stored
  791. here */
  792. } __packed;
  793. struct mwifiex_user_scan_chan {
  794. u8 chan_number;
  795. u8 radio_type;
  796. u8 scan_type;
  797. u8 reserved;
  798. u32 scan_time;
  799. } __packed;
  800. struct mwifiex_user_scan_cfg {
  801. /*
  802. * BSS mode to be sent in the firmware command
  803. */
  804. u8 bss_mode;
  805. /* Configure the number of probe requests for active chan scans */
  806. u8 num_probes;
  807. u8 reserved;
  808. /* BSSID filter sent in the firmware command to limit the results */
  809. u8 specific_bssid[ETH_ALEN];
  810. /* SSID filter list used in the firmware to limit the scan results */
  811. struct cfg80211_ssid *ssid_list;
  812. u8 num_ssids;
  813. /* Variable number (fixed maximum) of channels to scan up */
  814. struct mwifiex_user_scan_chan chan_list[MWIFIEX_USER_SCAN_CHAN_MAX];
  815. } __packed;
  816. struct ie_body {
  817. u8 grp_key_oui[4];
  818. u8 ptk_cnt[2];
  819. u8 ptk_body[4];
  820. } __packed;
  821. struct host_cmd_ds_802_11_scan {
  822. u8 bss_mode;
  823. u8 bssid[ETH_ALEN];
  824. u8 tlv_buffer[1];
  825. } __packed;
  826. struct host_cmd_ds_802_11_scan_rsp {
  827. __le16 bss_descript_size;
  828. u8 number_of_sets;
  829. u8 bss_desc_and_tlv_buffer[1];
  830. } __packed;
  831. struct host_cmd_ds_802_11_bg_scan_query {
  832. u8 flush;
  833. } __packed;
  834. struct host_cmd_ds_802_11_bg_scan_query_rsp {
  835. u32 report_condition;
  836. struct host_cmd_ds_802_11_scan_rsp scan_resp;
  837. } __packed;
  838. struct mwifiex_ietypes_domain_param_set {
  839. struct mwifiex_ie_types_header header;
  840. u8 country_code[IEEE80211_COUNTRY_STRING_LEN];
  841. struct ieee80211_country_ie_triplet triplet[1];
  842. } __packed;
  843. struct host_cmd_ds_802_11d_domain_info {
  844. __le16 action;
  845. struct mwifiex_ietypes_domain_param_set domain;
  846. } __packed;
  847. struct host_cmd_ds_802_11d_domain_info_rsp {
  848. __le16 action;
  849. struct mwifiex_ietypes_domain_param_set domain;
  850. } __packed;
  851. struct host_cmd_ds_11n_addba_req {
  852. u8 add_req_result;
  853. u8 peer_mac_addr[ETH_ALEN];
  854. u8 dialog_token;
  855. __le16 block_ack_param_set;
  856. __le16 block_ack_tmo;
  857. __le16 ssn;
  858. } __packed;
  859. struct host_cmd_ds_11n_addba_rsp {
  860. u8 add_rsp_result;
  861. u8 peer_mac_addr[ETH_ALEN];
  862. u8 dialog_token;
  863. __le16 status_code;
  864. __le16 block_ack_param_set;
  865. __le16 block_ack_tmo;
  866. __le16 ssn;
  867. } __packed;
  868. struct host_cmd_ds_11n_delba {
  869. u8 del_result;
  870. u8 peer_mac_addr[ETH_ALEN];
  871. __le16 del_ba_param_set;
  872. __le16 reason_code;
  873. u8 reserved;
  874. } __packed;
  875. struct host_cmd_ds_11n_batimeout {
  876. u8 tid;
  877. u8 peer_mac_addr[ETH_ALEN];
  878. u8 origninator;
  879. } __packed;
  880. struct host_cmd_ds_11n_cfg {
  881. __le16 action;
  882. __le16 ht_tx_cap;
  883. __le16 ht_tx_info;
  884. } __packed;
  885. struct host_cmd_ds_txbuf_cfg {
  886. __le16 action;
  887. __le16 buff_size;
  888. __le16 mp_end_port; /* SDIO only, reserved for other interfacces */
  889. __le16 reserved3;
  890. } __packed;
  891. struct host_cmd_ds_amsdu_aggr_ctrl {
  892. __le16 action;
  893. __le16 enable;
  894. __le16 curr_buf_size;
  895. } __packed;
  896. struct mwifiex_ie_types_wmm_param_set {
  897. struct mwifiex_ie_types_header header;
  898. u8 wmm_ie[1];
  899. };
  900. struct mwifiex_ie_types_wmm_queue_status {
  901. struct mwifiex_ie_types_header header;
  902. u8 queue_index;
  903. u8 disabled;
  904. u16 medium_time;
  905. u8 flow_required;
  906. u8 flow_created;
  907. u32 reserved;
  908. };
  909. struct ieee_types_vendor_header {
  910. u8 element_id;
  911. u8 len;
  912. u8 oui[4]; /* 0~2: oui, 3: oui_type */
  913. u8 oui_subtype;
  914. u8 version;
  915. } __packed;
  916. struct ieee_types_wmm_ac_parameters {
  917. u8 aci_aifsn_bitmap;
  918. u8 ecw_bitmap;
  919. __le16 tx_op_limit;
  920. } __packed;
  921. struct ieee_types_wmm_parameter {
  922. /*
  923. * WMM Parameter IE - Vendor Specific Header:
  924. * element_id [221/0xdd]
  925. * Len [24]
  926. * Oui [00:50:f2]
  927. * OuiType [2]
  928. * OuiSubType [1]
  929. * Version [1]
  930. */
  931. struct ieee_types_vendor_header vend_hdr;
  932. u8 qos_info_bitmap;
  933. u8 reserved;
  934. struct ieee_types_wmm_ac_parameters ac_params[IEEE80211_NUM_ACS];
  935. } __packed;
  936. struct ieee_types_wmm_info {
  937. /*
  938. * WMM Info IE - Vendor Specific Header:
  939. * element_id [221/0xdd]
  940. * Len [7]
  941. * Oui [00:50:f2]
  942. * OuiType [2]
  943. * OuiSubType [0]
  944. * Version [1]
  945. */
  946. struct ieee_types_vendor_header vend_hdr;
  947. u8 qos_info_bitmap;
  948. } __packed;
  949. struct host_cmd_ds_wmm_get_status {
  950. u8 queue_status_tlv[sizeof(struct mwifiex_ie_types_wmm_queue_status) *
  951. IEEE80211_NUM_ACS];
  952. u8 wmm_param_tlv[sizeof(struct ieee_types_wmm_parameter) + 2];
  953. } __packed;
  954. struct mwifiex_wmm_ac_status {
  955. u8 disabled;
  956. u8 flow_required;
  957. u8 flow_created;
  958. };
  959. struct mwifiex_ie_types_htcap {
  960. struct mwifiex_ie_types_header header;
  961. struct ieee80211_ht_cap ht_cap;
  962. } __packed;
  963. struct mwifiex_ie_types_htinfo {
  964. struct mwifiex_ie_types_header header;
  965. struct ieee80211_ht_operation ht_oper;
  966. } __packed;
  967. struct mwifiex_ie_types_2040bssco {
  968. struct mwifiex_ie_types_header header;
  969. u8 bss_co_2040;
  970. } __packed;
  971. struct mwifiex_ie_types_extcap {
  972. struct mwifiex_ie_types_header header;
  973. u8 ext_cap;
  974. } __packed;
  975. struct host_cmd_ds_mac_reg_access {
  976. __le16 action;
  977. __le16 offset;
  978. __le32 value;
  979. } __packed;
  980. struct host_cmd_ds_bbp_reg_access {
  981. __le16 action;
  982. __le16 offset;
  983. u8 value;
  984. u8 reserved[3];
  985. } __packed;
  986. struct host_cmd_ds_rf_reg_access {
  987. __le16 action;
  988. __le16 offset;
  989. u8 value;
  990. u8 reserved[3];
  991. } __packed;
  992. struct host_cmd_ds_pmic_reg_access {
  993. __le16 action;
  994. __le16 offset;
  995. u8 value;
  996. u8 reserved[3];
  997. } __packed;
  998. struct host_cmd_ds_802_11_eeprom_access {
  999. __le16 action;
  1000. __le16 offset;
  1001. __le16 byte_count;
  1002. u8 value;
  1003. } __packed;
  1004. struct host_cmd_tlv {
  1005. __le16 type;
  1006. __le16 len;
  1007. } __packed;
  1008. struct mwifiex_assoc_event {
  1009. u8 sta_addr[ETH_ALEN];
  1010. __le16 type;
  1011. __le16 len;
  1012. __le16 frame_control;
  1013. __le16 cap_info;
  1014. __le16 listen_interval;
  1015. u8 data[0];
  1016. } __packed;
  1017. struct host_cmd_ds_sys_config {
  1018. __le16 action;
  1019. u8 tlv[0];
  1020. };
  1021. struct host_cmd_tlv_akmp {
  1022. struct host_cmd_tlv tlv;
  1023. __le16 key_mgmt;
  1024. __le16 key_mgmt_operation;
  1025. } __packed;
  1026. struct host_cmd_tlv_pwk_cipher {
  1027. struct host_cmd_tlv tlv;
  1028. __le16 proto;
  1029. u8 cipher;
  1030. u8 reserved;
  1031. } __packed;
  1032. struct host_cmd_tlv_gwk_cipher {
  1033. struct host_cmd_tlv tlv;
  1034. u8 cipher;
  1035. u8 reserved;
  1036. } __packed;
  1037. struct host_cmd_tlv_passphrase {
  1038. struct host_cmd_tlv tlv;
  1039. u8 passphrase[0];
  1040. } __packed;
  1041. struct host_cmd_tlv_wep_key {
  1042. struct host_cmd_tlv tlv;
  1043. u8 key_index;
  1044. u8 is_default;
  1045. u8 key[1];
  1046. };
  1047. struct host_cmd_tlv_auth_type {
  1048. struct host_cmd_tlv tlv;
  1049. u8 auth_type;
  1050. } __packed;
  1051. struct host_cmd_tlv_encrypt_protocol {
  1052. struct host_cmd_tlv tlv;
  1053. __le16 proto;
  1054. } __packed;
  1055. struct host_cmd_tlv_ssid {
  1056. struct host_cmd_tlv tlv;
  1057. u8 ssid[0];
  1058. } __packed;
  1059. struct host_cmd_tlv_bcast_ssid {
  1060. struct host_cmd_tlv tlv;
  1061. u8 bcast_ctl;
  1062. } __packed;
  1063. struct host_cmd_tlv_beacon_period {
  1064. struct host_cmd_tlv tlv;
  1065. __le16 period;
  1066. } __packed;
  1067. struct host_cmd_tlv_dtim_period {
  1068. struct host_cmd_tlv tlv;
  1069. u8 period;
  1070. } __packed;
  1071. struct host_cmd_tlv_frag_threshold {
  1072. struct host_cmd_tlv tlv;
  1073. __le16 frag_thr;
  1074. } __packed;
  1075. struct host_cmd_tlv_rts_threshold {
  1076. struct host_cmd_tlv tlv;
  1077. __le16 rts_thr;
  1078. } __packed;
  1079. struct host_cmd_tlv_retry_limit {
  1080. struct host_cmd_tlv tlv;
  1081. u8 limit;
  1082. } __packed;
  1083. struct host_cmd_tlv_mac_addr {
  1084. struct host_cmd_tlv tlv;
  1085. u8 mac_addr[ETH_ALEN];
  1086. } __packed;
  1087. struct host_cmd_tlv_channel_band {
  1088. struct host_cmd_tlv tlv;
  1089. u8 band_config;
  1090. u8 channel;
  1091. } __packed;
  1092. struct host_cmd_ds_version_ext {
  1093. u8 version_str_sel;
  1094. char version_str[128];
  1095. } __packed;
  1096. struct host_cmd_ds_802_11_ibss_status {
  1097. __le16 action;
  1098. __le16 enable;
  1099. u8 bssid[ETH_ALEN];
  1100. __le16 beacon_interval;
  1101. __le16 atim_window;
  1102. __le16 use_g_rate_protect;
  1103. } __packed;
  1104. #define CONNECTION_TYPE_INFRA 0
  1105. #define CONNECTION_TYPE_ADHOC 1
  1106. struct host_cmd_ds_set_bss_mode {
  1107. u8 con_type;
  1108. } __packed;
  1109. struct host_cmd_ds_pcie_details {
  1110. /* TX buffer descriptor ring address */
  1111. u32 txbd_addr_lo;
  1112. u32 txbd_addr_hi;
  1113. /* TX buffer descriptor ring count */
  1114. u32 txbd_count;
  1115. /* RX buffer descriptor ring address */
  1116. u32 rxbd_addr_lo;
  1117. u32 rxbd_addr_hi;
  1118. /* RX buffer descriptor ring count */
  1119. u32 rxbd_count;
  1120. /* Event buffer descriptor ring address */
  1121. u32 evtbd_addr_lo;
  1122. u32 evtbd_addr_hi;
  1123. /* Event buffer descriptor ring count */
  1124. u32 evtbd_count;
  1125. /* Sleep cookie buffer physical address */
  1126. u32 sleep_cookie_addr_lo;
  1127. u32 sleep_cookie_addr_hi;
  1128. } __packed;
  1129. struct mwifiex_ie_types_rssi_threshold {
  1130. struct mwifiex_ie_types_header header;
  1131. u8 abs_value;
  1132. u8 evt_freq;
  1133. } __packed;
  1134. struct host_cmd_ds_802_11_subsc_evt {
  1135. __le16 action;
  1136. __le16 events;
  1137. } __packed;
  1138. struct mwifiex_ie {
  1139. __le16 ie_index;
  1140. __le16 mgmt_subtype_mask;
  1141. __le16 ie_length;
  1142. u8 ie_buffer[IEEE_MAX_IE_SIZE];
  1143. } __packed;
  1144. #define MAX_MGMT_IE_INDEX 16
  1145. struct mwifiex_ie_list {
  1146. __le16 type;
  1147. __le16 len;
  1148. struct mwifiex_ie ie_list[MAX_MGMT_IE_INDEX];
  1149. } __packed;
  1150. struct host_cmd_ds_command {
  1151. __le16 command;
  1152. __le16 size;
  1153. __le16 seq_num;
  1154. __le16 result;
  1155. union {
  1156. struct host_cmd_ds_get_hw_spec hw_spec;
  1157. struct host_cmd_ds_mac_control mac_ctrl;
  1158. struct host_cmd_ds_802_11_mac_address mac_addr;
  1159. struct host_cmd_ds_mac_multicast_adr mc_addr;
  1160. struct host_cmd_ds_802_11_get_log get_log;
  1161. struct host_cmd_ds_802_11_rssi_info rssi_info;
  1162. struct host_cmd_ds_802_11_rssi_info_rsp rssi_info_rsp;
  1163. struct host_cmd_ds_802_11_snmp_mib smib;
  1164. struct host_cmd_ds_tx_rate_query tx_rate;
  1165. struct host_cmd_ds_tx_rate_cfg tx_rate_cfg;
  1166. struct host_cmd_ds_txpwr_cfg txp_cfg;
  1167. struct host_cmd_ds_rf_tx_pwr txp;
  1168. struct host_cmd_ds_rf_ant_mimo ant_mimo;
  1169. struct host_cmd_ds_rf_ant_siso ant_siso;
  1170. struct host_cmd_ds_802_11_ps_mode_enh psmode_enh;
  1171. struct host_cmd_ds_802_11_hs_cfg_enh opt_hs_cfg;
  1172. struct host_cmd_ds_802_11_scan scan;
  1173. struct host_cmd_ds_802_11_scan_rsp scan_resp;
  1174. struct host_cmd_ds_802_11_bg_scan_query bg_scan_query;
  1175. struct host_cmd_ds_802_11_bg_scan_query_rsp bg_scan_query_resp;
  1176. struct host_cmd_ds_802_11_associate associate;
  1177. struct host_cmd_ds_802_11_associate_rsp associate_rsp;
  1178. struct host_cmd_ds_802_11_deauthenticate deauth;
  1179. struct host_cmd_ds_802_11_ad_hoc_start adhoc_start;
  1180. struct host_cmd_ds_802_11_ad_hoc_result adhoc_result;
  1181. struct host_cmd_ds_802_11_ad_hoc_join adhoc_join;
  1182. struct host_cmd_ds_802_11d_domain_info domain_info;
  1183. struct host_cmd_ds_802_11d_domain_info_rsp domain_info_resp;
  1184. struct host_cmd_ds_11n_addba_req add_ba_req;
  1185. struct host_cmd_ds_11n_addba_rsp add_ba_rsp;
  1186. struct host_cmd_ds_11n_delba del_ba;
  1187. struct host_cmd_ds_txbuf_cfg tx_buf;
  1188. struct host_cmd_ds_amsdu_aggr_ctrl amsdu_aggr_ctrl;
  1189. struct host_cmd_ds_11n_cfg htcfg;
  1190. struct host_cmd_ds_wmm_get_status get_wmm_status;
  1191. struct host_cmd_ds_802_11_key_material key_material;
  1192. struct host_cmd_ds_version_ext verext;
  1193. struct host_cmd_ds_802_11_ibss_status ibss_coalescing;
  1194. struct host_cmd_ds_mac_reg_access mac_reg;
  1195. struct host_cmd_ds_bbp_reg_access bbp_reg;
  1196. struct host_cmd_ds_rf_reg_access rf_reg;
  1197. struct host_cmd_ds_pmic_reg_access pmic_reg;
  1198. struct host_cmd_ds_set_bss_mode bss_mode;
  1199. struct host_cmd_ds_pcie_details pcie_host_spec;
  1200. struct host_cmd_ds_802_11_eeprom_access eeprom;
  1201. struct host_cmd_ds_802_11_subsc_evt subsc_evt;
  1202. struct host_cmd_ds_sys_config uap_sys_config;
  1203. } params;
  1204. } __packed;
  1205. struct mwifiex_opt_sleep_confirm {
  1206. __le16 command;
  1207. __le16 size;
  1208. __le16 seq_num;
  1209. __le16 result;
  1210. __le16 action;
  1211. __le16 resp_ctrl;
  1212. } __packed;
  1213. #endif /* !_MWIFIEX_FW_H_ */