fw.h 33 KB

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