fw.h 37 KB

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