fw.h 32 KB

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