fw.h 36 KB

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