fw.h 38 KB

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