fw.h 35 KB

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