fw.h 38 KB

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