fw.h 35 KB

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