wmi.h 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037
  1. /*
  2. * Copyright (c) 2010-2011 Atheros Communications Inc.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for any
  5. * purpose with or without fee is hereby granted, provided that the above
  6. * copyright notice and this permission notice appear in all copies.
  7. *
  8. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  9. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  10. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  11. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  12. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  13. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  14. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. /*
  17. * This file contains the definitions of the WMI protocol specified in the
  18. * Wireless Module Interface (WMI). It includes definitions of all the
  19. * commands and events. Commands are messages from the host to the WM.
  20. * Events and Replies are messages from the WM to the host.
  21. */
  22. #ifndef WMI_H
  23. #define WMI_H
  24. #include <linux/ieee80211.h>
  25. #include "htc.h"
  26. #define HTC_PROTOCOL_VERSION 0x0002
  27. #define WMI_PROTOCOL_VERSION 0x0002
  28. #define WMI_CONTROL_MSG_MAX_LEN 256
  29. #define is_ethertype(type_or_len) ((type_or_len) >= 0x0600)
  30. #define IP_ETHERTYPE 0x0800
  31. #define WMI_IMPLICIT_PSTREAM 0xFF
  32. #define WMI_MAX_THINSTREAM 15
  33. #define SSID_IE_LEN_INDEX 13
  34. /* Host side link management data structures */
  35. #define SIG_QUALITY_THRESH_LVLS 6
  36. #define SIG_QUALITY_UPPER_THRESH_LVLS SIG_QUALITY_THRESH_LVLS
  37. #define SIG_QUALITY_LOWER_THRESH_LVLS SIG_QUALITY_THRESH_LVLS
  38. #define A_BAND_24GHZ 0
  39. #define A_BAND_5GHZ 1
  40. #define A_NUM_BANDS 2
  41. /* in ms */
  42. #define WMI_IMPLICIT_PSTREAM_INACTIVITY_INT 5000
  43. /*
  44. * There are no signed versions of __le16 and __le32, so for a temporary
  45. * solution come up with our own version. The idea is from fs/ntfs/types.h.
  46. *
  47. * Use a_ prefix so that it doesn't conflict if we get proper support to
  48. * linux/types.h.
  49. */
  50. typedef __s16 __bitwise a_sle16;
  51. typedef __s32 __bitwise a_sle32;
  52. static inline a_sle32 a_cpu_to_sle32(s32 val)
  53. {
  54. return (__force a_sle32) cpu_to_le32(val);
  55. }
  56. static inline s32 a_sle32_to_cpu(a_sle32 val)
  57. {
  58. return le32_to_cpu((__force __le32) val);
  59. }
  60. static inline a_sle16 a_cpu_to_sle16(s16 val)
  61. {
  62. return (__force a_sle16) cpu_to_le16(val);
  63. }
  64. static inline s16 a_sle16_to_cpu(a_sle16 val)
  65. {
  66. return le16_to_cpu((__force __le16) val);
  67. }
  68. struct sq_threshold_params {
  69. s16 upper_threshold[SIG_QUALITY_UPPER_THRESH_LVLS];
  70. s16 lower_threshold[SIG_QUALITY_LOWER_THRESH_LVLS];
  71. u32 upper_threshold_valid_count;
  72. u32 lower_threshold_valid_count;
  73. u32 polling_interval;
  74. u8 weight;
  75. u8 last_rssi;
  76. u8 last_rssi_poll_event;
  77. };
  78. struct wmi_stats {
  79. u32 cmd_len_err;
  80. u32 cmd_id_err;
  81. };
  82. struct wmi_data_sync_bufs {
  83. u8 traffic_class;
  84. struct sk_buff *skb;
  85. };
  86. /* WMM stream classes */
  87. #define WMM_NUM_AC 4
  88. #define WMM_AC_BE 0 /* best effort */
  89. #define WMM_AC_BK 1 /* background */
  90. #define WMM_AC_VI 2 /* video */
  91. #define WMM_AC_VO 3 /* voice */
  92. struct wmi {
  93. bool ready;
  94. u16 stream_exist_for_ac[WMM_NUM_AC];
  95. u8 fat_pipe_exist;
  96. struct ath6kl *parent_dev;
  97. struct wmi_stats stat;
  98. u8 pwr_mode;
  99. u8 phy_mode;
  100. u8 keep_alive_intvl;
  101. spinlock_t lock;
  102. enum htc_endpoint_id ep_id;
  103. struct sq_threshold_params
  104. sq_threshld[SIGNAL_QUALITY_METRICS_NUM_MAX];
  105. enum crypto_type pair_crypto_type;
  106. enum crypto_type grp_crypto_type;
  107. bool is_wmm_enabled;
  108. u8 ht_allowed[A_NUM_BANDS];
  109. u8 traffic_class;
  110. bool is_probe_ssid;
  111. };
  112. struct host_app_area {
  113. u32 wmi_protocol_ver;
  114. };
  115. enum wmi_msg_type {
  116. DATA_MSGTYPE = 0x0,
  117. CNTL_MSGTYPE,
  118. SYNC_MSGTYPE,
  119. OPT_MSGTYPE,
  120. };
  121. /*
  122. * Macros for operating on WMI_DATA_HDR (info) field
  123. */
  124. #define WMI_DATA_HDR_MSG_TYPE_MASK 0x03
  125. #define WMI_DATA_HDR_MSG_TYPE_SHIFT 0
  126. #define WMI_DATA_HDR_UP_MASK 0x07
  127. #define WMI_DATA_HDR_UP_SHIFT 2
  128. /* In AP mode, the same bit (b5) is used to indicate Power save state in
  129. * the Rx dir and More data bit state in the tx direction.
  130. */
  131. #define WMI_DATA_HDR_PS_MASK 0x1
  132. #define WMI_DATA_HDR_PS_SHIFT 5
  133. #define WMI_DATA_HDR_MORE_MASK 0x1
  134. #define WMI_DATA_HDR_MORE_SHIFT 5
  135. enum wmi_data_hdr_data_type {
  136. WMI_DATA_HDR_DATA_TYPE_802_3 = 0,
  137. WMI_DATA_HDR_DATA_TYPE_802_11,
  138. /* used to be used for the PAL */
  139. WMI_DATA_HDR_DATA_TYPE_ACL,
  140. };
  141. #define WMI_DATA_HDR_DATA_TYPE_MASK 0x3
  142. #define WMI_DATA_HDR_DATA_TYPE_SHIFT 6
  143. /* Macros for operating on WMI_DATA_HDR (info2) field */
  144. #define WMI_DATA_HDR_SEQNO_MASK 0xFFF
  145. #define WMI_DATA_HDR_SEQNO_SHIFT 0
  146. #define WMI_DATA_HDR_AMSDU_MASK 0x1
  147. #define WMI_DATA_HDR_AMSDU_SHIFT 12
  148. #define WMI_DATA_HDR_META_MASK 0x7
  149. #define WMI_DATA_HDR_META_SHIFT 13
  150. struct wmi_data_hdr {
  151. s8 rssi;
  152. /*
  153. * usage of 'info' field(8-bit):
  154. *
  155. * b1:b0 - WMI_MSG_TYPE
  156. * b4:b3:b2 - UP(tid)
  157. * b5 - Used in AP mode.
  158. * More-data in tx dir, PS in rx.
  159. * b7:b6 - Dot3 header(0),
  160. * Dot11 Header(1),
  161. * ACL data(2)
  162. */
  163. u8 info;
  164. /*
  165. * usage of 'info2' field(16-bit):
  166. *
  167. * b11:b0 - seq_no
  168. * b12 - A-MSDU?
  169. * b15:b13 - META_DATA_VERSION 0 - 7
  170. */
  171. __le16 info2;
  172. __le16 info3;
  173. } __packed;
  174. static inline u8 wmi_data_hdr_get_up(struct wmi_data_hdr *dhdr)
  175. {
  176. return (dhdr->info >> WMI_DATA_HDR_UP_SHIFT) & WMI_DATA_HDR_UP_MASK;
  177. }
  178. static inline void wmi_data_hdr_set_up(struct wmi_data_hdr *dhdr,
  179. u8 usr_pri)
  180. {
  181. dhdr->info &= ~(WMI_DATA_HDR_UP_MASK << WMI_DATA_HDR_UP_SHIFT);
  182. dhdr->info |= usr_pri << WMI_DATA_HDR_UP_SHIFT;
  183. }
  184. static inline u8 wmi_data_hdr_get_dot11(struct wmi_data_hdr *dhdr)
  185. {
  186. u8 data_type;
  187. data_type = (dhdr->info >> WMI_DATA_HDR_DATA_TYPE_SHIFT) &
  188. WMI_DATA_HDR_DATA_TYPE_MASK;
  189. return (data_type == WMI_DATA_HDR_DATA_TYPE_802_11);
  190. }
  191. static inline u16 wmi_data_hdr_get_seqno(struct wmi_data_hdr *dhdr)
  192. {
  193. return (le16_to_cpu(dhdr->info2) >> WMI_DATA_HDR_SEQNO_SHIFT) &
  194. WMI_DATA_HDR_SEQNO_MASK;
  195. }
  196. static inline u8 wmi_data_hdr_is_amsdu(struct wmi_data_hdr *dhdr)
  197. {
  198. return (le16_to_cpu(dhdr->info2) >> WMI_DATA_HDR_AMSDU_SHIFT) &
  199. WMI_DATA_HDR_AMSDU_MASK;
  200. }
  201. static inline u8 wmi_data_hdr_get_meta(struct wmi_data_hdr *dhdr)
  202. {
  203. return (le16_to_cpu(dhdr->info2) >> WMI_DATA_HDR_META_SHIFT) &
  204. WMI_DATA_HDR_META_MASK;
  205. }
  206. /* Tx meta version definitions */
  207. #define WMI_MAX_TX_META_SZ 12
  208. #define WMI_META_VERSION_1 0x01
  209. #define WMI_META_VERSION_2 0x02
  210. struct wmi_tx_meta_v1 {
  211. /* packet ID to identify the tx request */
  212. u8 pkt_id;
  213. /* rate policy to be used for the tx of this frame */
  214. u8 rate_plcy_id;
  215. } __packed;
  216. struct wmi_tx_meta_v2 {
  217. /*
  218. * Offset from start of the WMI header for csum calculation to
  219. * begin.
  220. */
  221. u8 csum_start;
  222. /* offset from start of WMI header where final csum goes */
  223. u8 csum_dest;
  224. /* no of bytes over which csum is calculated */
  225. u8 csum_flags;
  226. } __packed;
  227. struct wmi_rx_meta_v1 {
  228. u8 status;
  229. /* rate index mapped to rate at which this packet was received. */
  230. u8 rix;
  231. /* rssi of packet */
  232. u8 rssi;
  233. /* rf channel during packet reception */
  234. u8 channel;
  235. __le16 flags;
  236. } __packed;
  237. struct wmi_rx_meta_v2 {
  238. __le16 csum;
  239. /* bit 0 set -partial csum valid bit 1 set -test mode */
  240. u8 csum_flags;
  241. } __packed;
  242. /* Control Path */
  243. struct wmi_cmd_hdr {
  244. __le16 cmd_id;
  245. /* info1 - 16 bits
  246. * b03:b00 - id
  247. * b15:b04 - unused */
  248. __le16 info1;
  249. /* for alignment */
  250. __le16 reserved;
  251. } __packed;
  252. /* List of WMI commands */
  253. enum wmi_cmd_id {
  254. WMI_CONNECT_CMDID = 0x0001,
  255. WMI_RECONNECT_CMDID,
  256. WMI_DISCONNECT_CMDID,
  257. WMI_SYNCHRONIZE_CMDID,
  258. WMI_CREATE_PSTREAM_CMDID,
  259. WMI_DELETE_PSTREAM_CMDID,
  260. WMI_START_SCAN_CMDID,
  261. WMI_SET_SCAN_PARAMS_CMDID,
  262. WMI_SET_BSS_FILTER_CMDID,
  263. WMI_SET_PROBED_SSID_CMDID, /* 10 */
  264. WMI_SET_LISTEN_INT_CMDID,
  265. WMI_SET_BMISS_TIME_CMDID,
  266. WMI_SET_DISC_TIMEOUT_CMDID,
  267. WMI_GET_CHANNEL_LIST_CMDID,
  268. WMI_SET_BEACON_INT_CMDID,
  269. WMI_GET_STATISTICS_CMDID,
  270. WMI_SET_CHANNEL_PARAMS_CMDID,
  271. WMI_SET_POWER_MODE_CMDID,
  272. WMI_SET_IBSS_PM_CAPS_CMDID,
  273. WMI_SET_POWER_PARAMS_CMDID, /* 20 */
  274. WMI_SET_POWERSAVE_TIMERS_POLICY_CMDID,
  275. WMI_ADD_CIPHER_KEY_CMDID,
  276. WMI_DELETE_CIPHER_KEY_CMDID,
  277. WMI_ADD_KRK_CMDID,
  278. WMI_DELETE_KRK_CMDID,
  279. WMI_SET_PMKID_CMDID,
  280. WMI_SET_TX_PWR_CMDID,
  281. WMI_GET_TX_PWR_CMDID,
  282. WMI_SET_ASSOC_INFO_CMDID,
  283. WMI_ADD_BAD_AP_CMDID, /* 30 */
  284. WMI_DELETE_BAD_AP_CMDID,
  285. WMI_SET_TKIP_COUNTERMEASURES_CMDID,
  286. WMI_RSSI_THRESHOLD_PARAMS_CMDID,
  287. WMI_TARGET_ERROR_REPORT_BITMASK_CMDID,
  288. WMI_SET_ACCESS_PARAMS_CMDID,
  289. WMI_SET_RETRY_LIMITS_CMDID,
  290. WMI_SET_OPT_MODE_CMDID,
  291. WMI_OPT_TX_FRAME_CMDID,
  292. WMI_SET_VOICE_PKT_SIZE_CMDID,
  293. WMI_SET_MAX_SP_LEN_CMDID, /* 40 */
  294. WMI_SET_ROAM_CTRL_CMDID,
  295. WMI_GET_ROAM_TBL_CMDID,
  296. WMI_GET_ROAM_DATA_CMDID,
  297. WMI_ENABLE_RM_CMDID,
  298. WMI_SET_MAX_OFFHOME_DURATION_CMDID,
  299. WMI_EXTENSION_CMDID, /* Non-wireless extensions */
  300. WMI_SNR_THRESHOLD_PARAMS_CMDID,
  301. WMI_LQ_THRESHOLD_PARAMS_CMDID,
  302. WMI_SET_LPREAMBLE_CMDID,
  303. WMI_SET_RTS_CMDID, /* 50 */
  304. WMI_CLR_RSSI_SNR_CMDID,
  305. WMI_SET_FIXRATES_CMDID,
  306. WMI_GET_FIXRATES_CMDID,
  307. WMI_SET_AUTH_MODE_CMDID,
  308. WMI_SET_REASSOC_MODE_CMDID,
  309. WMI_SET_WMM_CMDID,
  310. WMI_SET_WMM_TXOP_CMDID,
  311. WMI_TEST_CMDID,
  312. /* COEX AR6002 only */
  313. WMI_SET_BT_STATUS_CMDID,
  314. WMI_SET_BT_PARAMS_CMDID, /* 60 */
  315. WMI_SET_KEEPALIVE_CMDID,
  316. WMI_GET_KEEPALIVE_CMDID,
  317. WMI_SET_APPIE_CMDID,
  318. WMI_GET_APPIE_CMDID,
  319. WMI_SET_WSC_STATUS_CMDID,
  320. /* Wake on Wireless */
  321. WMI_SET_HOST_SLEEP_MODE_CMDID,
  322. WMI_SET_WOW_MODE_CMDID,
  323. WMI_GET_WOW_LIST_CMDID,
  324. WMI_ADD_WOW_PATTERN_CMDID,
  325. WMI_DEL_WOW_PATTERN_CMDID, /* 70 */
  326. WMI_SET_FRAMERATES_CMDID,
  327. WMI_SET_AP_PS_CMDID,
  328. WMI_SET_QOS_SUPP_CMDID,
  329. /* WMI_THIN_RESERVED_... mark the start and end
  330. * values for WMI_THIN_RESERVED command IDs. These
  331. * command IDs can be found in wmi_thin.h */
  332. WMI_THIN_RESERVED_START = 0x8000,
  333. WMI_THIN_RESERVED_END = 0x8fff,
  334. /* Developer commands starts at 0xF000 */
  335. WMI_SET_BITRATE_CMDID = 0xF000,
  336. WMI_GET_BITRATE_CMDID,
  337. WMI_SET_WHALPARAM_CMDID,
  338. WMI_SET_MAC_ADDRESS_CMDID,
  339. WMI_SET_AKMP_PARAMS_CMDID,
  340. WMI_SET_PMKID_LIST_CMDID,
  341. WMI_GET_PMKID_LIST_CMDID,
  342. WMI_ABORT_SCAN_CMDID,
  343. WMI_SET_TARGET_EVENT_REPORT_CMDID,
  344. /* Unused */
  345. WMI_UNUSED1,
  346. WMI_UNUSED2,
  347. /* AP mode commands */
  348. WMI_AP_HIDDEN_SSID_CMDID,
  349. WMI_AP_SET_NUM_STA_CMDID,
  350. WMI_AP_ACL_POLICY_CMDID,
  351. WMI_AP_ACL_MAC_LIST_CMDID,
  352. WMI_AP_CONFIG_COMMIT_CMDID,
  353. WMI_AP_SET_MLME_CMDID,
  354. WMI_AP_SET_PVB_CMDID,
  355. WMI_AP_CONN_INACT_CMDID,
  356. WMI_AP_PROT_SCAN_TIME_CMDID,
  357. WMI_AP_SET_COUNTRY_CMDID,
  358. WMI_AP_SET_DTIM_CMDID,
  359. WMI_AP_MODE_STAT_CMDID,
  360. WMI_SET_IP_CMDID,
  361. WMI_SET_PARAMS_CMDID,
  362. WMI_SET_MCAST_FILTER_CMDID,
  363. WMI_DEL_MCAST_FILTER_CMDID,
  364. WMI_ALLOW_AGGR_CMDID,
  365. WMI_ADDBA_REQ_CMDID,
  366. WMI_DELBA_REQ_CMDID,
  367. WMI_SET_HT_CAP_CMDID,
  368. WMI_SET_HT_OP_CMDID,
  369. WMI_SET_TX_SELECT_RATES_CMDID,
  370. WMI_SET_TX_SGI_PARAM_CMDID,
  371. WMI_SET_RATE_POLICY_CMDID,
  372. WMI_HCI_CMD_CMDID,
  373. WMI_RX_FRAME_FORMAT_CMDID,
  374. WMI_SET_THIN_MODE_CMDID,
  375. WMI_SET_BT_WLAN_CONN_PRECEDENCE_CMDID,
  376. WMI_AP_SET_11BG_RATESET_CMDID,
  377. WMI_SET_PMK_CMDID,
  378. WMI_MCAST_FILTER_CMDID,
  379. /* COEX CMDID AR6003 */
  380. WMI_SET_BTCOEX_FE_ANT_CMDID,
  381. WMI_SET_BTCOEX_COLOCATED_BT_DEV_CMDID,
  382. WMI_SET_BTCOEX_SCO_CONFIG_CMDID,
  383. WMI_SET_BTCOEX_A2DP_CONFIG_CMDID,
  384. WMI_SET_BTCOEX_ACLCOEX_CONFIG_CMDID,
  385. WMI_SET_BTCOEX_BTINQUIRY_PAGE_CONFIG_CMDID,
  386. WMI_SET_BTCOEX_DEBUG_CMDID,
  387. WMI_SET_BTCOEX_BT_OPERATING_STATUS_CMDID,
  388. WMI_GET_BTCOEX_STATS_CMDID,
  389. WMI_GET_BTCOEX_CONFIG_CMDID,
  390. WMI_SET_DFS_ENABLE_CMDID, /* F034 */
  391. WMI_SET_DFS_MINRSSITHRESH_CMDID,
  392. WMI_SET_DFS_MAXPULSEDUR_CMDID,
  393. WMI_DFS_RADAR_DETECTED_CMDID,
  394. /* P2P commands */
  395. WMI_P2P_SET_CONFIG_CMDID, /* F038 */
  396. WMI_WPS_SET_CONFIG_CMDID,
  397. WMI_SET_REQ_DEV_ATTR_CMDID,
  398. WMI_P2P_FIND_CMDID,
  399. WMI_P2P_STOP_FIND_CMDID,
  400. WMI_P2P_GO_NEG_START_CMDID,
  401. WMI_P2P_LISTEN_CMDID,
  402. WMI_CONFIG_TX_MAC_RULES_CMDID, /* F040 */
  403. WMI_SET_PROMISCUOUS_MODE_CMDID,
  404. WMI_RX_FRAME_FILTER_CMDID,
  405. WMI_SET_CHANNEL_CMDID,
  406. /* WAC commands */
  407. WMI_ENABLE_WAC_CMDID,
  408. WMI_WAC_SCAN_REPLY_CMDID,
  409. WMI_WAC_CTRL_REQ_CMDID,
  410. WMI_SET_DIV_PARAMS_CMDID,
  411. WMI_GET_PMK_CMDID,
  412. WMI_SET_PASSPHRASE_CMDID,
  413. WMI_SEND_ASSOC_RES_CMDID,
  414. WMI_SET_ASSOC_REQ_RELAY_CMDID,
  415. WMI_GET_RFKILL_MODE_CMDID,
  416. /* ACS command, consists of sub-commands */
  417. WMI_ACS_CTRL_CMDID,
  418. /* Ultra low power store / recall commands */
  419. WMI_STORERECALL_CONFIGURE_CMDID,
  420. WMI_STORERECALL_RECALL_CMDID,
  421. WMI_STORERECALL_HOST_READY_CMDID,
  422. WMI_FORCE_TARGET_ASSERT_CMDID,
  423. WMI_SET_EXCESS_TX_RETRY_THRES_CMDID,
  424. };
  425. enum wmi_mgmt_frame_type {
  426. WMI_FRAME_BEACON = 0,
  427. WMI_FRAME_PROBE_REQ,
  428. WMI_FRAME_PROBE_RESP,
  429. WMI_FRAME_ASSOC_REQ,
  430. WMI_FRAME_ASSOC_RESP,
  431. WMI_NUM_MGMT_FRAME
  432. };
  433. /* WMI_CONNECT_CMDID */
  434. enum network_type {
  435. INFRA_NETWORK = 0x01,
  436. ADHOC_NETWORK = 0x02,
  437. ADHOC_CREATOR = 0x04,
  438. AP_NETWORK = 0x10,
  439. };
  440. enum dot11_auth_mode {
  441. OPEN_AUTH = 0x01,
  442. SHARED_AUTH = 0x02,
  443. /* different from IEEE_AUTH_MODE definitions */
  444. LEAP_AUTH = 0x04,
  445. };
  446. enum {
  447. AUTH_IDLE,
  448. AUTH_OPEN_IN_PROGRESS,
  449. };
  450. enum auth_mode {
  451. NONE_AUTH = 0x01,
  452. WPA_AUTH = 0x02,
  453. WPA2_AUTH = 0x04,
  454. WPA_PSK_AUTH = 0x08,
  455. WPA2_PSK_AUTH = 0x10,
  456. WPA_AUTH_CCKM = 0x20,
  457. WPA2_AUTH_CCKM = 0x40,
  458. };
  459. #define WMI_MIN_CRYPTO_TYPE NONE_CRYPT
  460. #define WMI_MAX_CRYPTO_TYPE (AES_CRYPT + 1)
  461. #define WMI_MIN_KEY_INDEX 0
  462. #define WMI_MAX_KEY_INDEX 3
  463. #define WMI_MAX_KEY_LEN 32
  464. /*
  465. * NB: these values are ordered carefully; there are lots of
  466. * of implications in any reordering. In particular beware
  467. * that 4 is not used to avoid conflicting with IEEE80211_F_PRIVACY.
  468. */
  469. #define ATH6KL_CIPHER_WEP 0
  470. #define ATH6KL_CIPHER_TKIP 1
  471. #define ATH6KL_CIPHER_AES_OCB 2
  472. #define ATH6KL_CIPHER_AES_CCM 3
  473. #define ATH6KL_CIPHER_CKIP 5
  474. #define ATH6KL_CIPHER_CCKM_KRK 6
  475. #define ATH6KL_CIPHER_NONE 7 /* pseudo value */
  476. /*
  477. * 802.11 rate set.
  478. */
  479. #define ATH6KL_RATE_MAXSIZE 15 /* max rates we'll handle */
  480. #define ATH_OUI_TYPE 0x01
  481. #define WPA_OUI_TYPE 0x01
  482. #define WMM_PARAM_OUI_SUBTYPE 0x01
  483. #define WMM_OUI_TYPE 0x02
  484. #define WSC_OUT_TYPE 0x04
  485. enum wmi_connect_ctrl_flags_bits {
  486. CONNECT_ASSOC_POLICY_USER = 0x0001,
  487. CONNECT_SEND_REASSOC = 0x0002,
  488. CONNECT_IGNORE_WPAx_GROUP_CIPHER = 0x0004,
  489. CONNECT_PROFILE_MATCH_DONE = 0x0008,
  490. CONNECT_IGNORE_AAC_BEACON = 0x0010,
  491. CONNECT_CSA_FOLLOW_BSS = 0x0020,
  492. CONNECT_DO_WPA_OFFLOAD = 0x0040,
  493. CONNECT_DO_NOT_DEAUTH = 0x0080,
  494. };
  495. struct wmi_connect_cmd {
  496. u8 nw_type;
  497. u8 dot11_auth_mode;
  498. u8 auth_mode;
  499. u8 prwise_crypto_type;
  500. u8 prwise_crypto_len;
  501. u8 grp_crypto_type;
  502. u8 grp_crypto_len;
  503. u8 ssid_len;
  504. u8 ssid[IEEE80211_MAX_SSID_LEN];
  505. __le16 ch;
  506. u8 bssid[ETH_ALEN];
  507. __le32 ctrl_flags;
  508. } __packed;
  509. /* WMI_RECONNECT_CMDID */
  510. struct wmi_reconnect_cmd {
  511. /* channel hint */
  512. __le16 channel;
  513. /* mandatory if set */
  514. u8 bssid[ETH_ALEN];
  515. } __packed;
  516. /* WMI_ADD_CIPHER_KEY_CMDID */
  517. enum key_usage {
  518. PAIRWISE_USAGE = 0x00,
  519. GROUP_USAGE = 0x01,
  520. /* default Tx Key - static WEP only */
  521. TX_USAGE = 0x02,
  522. };
  523. /*
  524. * Bit Flag
  525. * Bit 0 - Initialise TSC - default is Initialize
  526. */
  527. #define KEY_OP_INIT_TSC 0x01
  528. #define KEY_OP_INIT_RSC 0x02
  529. /* default initialise the TSC & RSC */
  530. #define KEY_OP_INIT_VAL 0x03
  531. #define KEY_OP_VALID_MASK 0x03
  532. struct wmi_add_cipher_key_cmd {
  533. u8 key_index;
  534. u8 key_type;
  535. /* enum key_usage */
  536. u8 key_usage;
  537. u8 key_len;
  538. /* key replay sequence counter */
  539. u8 key_rsc[8];
  540. u8 key[WLAN_MAX_KEY_LEN];
  541. /* additional key control info */
  542. u8 key_op_ctrl;
  543. u8 key_mac_addr[ETH_ALEN];
  544. } __packed;
  545. /* WMI_DELETE_CIPHER_KEY_CMDID */
  546. struct wmi_delete_cipher_key_cmd {
  547. u8 key_index;
  548. } __packed;
  549. #define WMI_KRK_LEN 16
  550. /* WMI_ADD_KRK_CMDID */
  551. struct wmi_add_krk_cmd {
  552. u8 krk[WMI_KRK_LEN];
  553. } __packed;
  554. /* WMI_SETPMKID_CMDID */
  555. #define WMI_PMKID_LEN 16
  556. enum pmkid_enable_flg {
  557. PMKID_DISABLE = 0,
  558. PMKID_ENABLE = 1,
  559. };
  560. struct wmi_setpmkid_cmd {
  561. u8 bssid[ETH_ALEN];
  562. /* enum pmkid_enable_flg */
  563. u8 enable;
  564. u8 pmkid[WMI_PMKID_LEN];
  565. } __packed;
  566. /* WMI_START_SCAN_CMD */
  567. enum wmi_scan_type {
  568. WMI_LONG_SCAN = 0,
  569. WMI_SHORT_SCAN = 1,
  570. };
  571. struct wmi_start_scan_cmd {
  572. __le32 force_fg_scan;
  573. /* for legacy cisco AP compatibility */
  574. __le32 is_legacy;
  575. /* max duration in the home channel(msec) */
  576. __le32 home_dwell_time;
  577. /* time interval between scans (msec) */
  578. __le32 force_scan_intvl;
  579. /* enum wmi_scan_type */
  580. u8 scan_type;
  581. /* how many channels follow */
  582. u8 num_ch;
  583. /* channels in Mhz */
  584. __le16 ch_list[1];
  585. } __packed;
  586. /* WMI_SET_SCAN_PARAMS_CMDID */
  587. #define WMI_SHORTSCANRATIO_DEFAULT 3
  588. /*
  589. * Warning: scan control flag value of 0xFF is used to disable
  590. * all flags in WMI_SCAN_PARAMS_CMD. Do not add any more
  591. * flags here
  592. */
  593. enum wmi_scan_ctrl_flags_bits {
  594. /* set if can scan in the connect cmd */
  595. CONNECT_SCAN_CTRL_FLAGS = 0x01,
  596. /* set if scan for the SSID it is already connected to */
  597. SCAN_CONNECTED_CTRL_FLAGS = 0x02,
  598. /* set if enable active scan */
  599. ACTIVE_SCAN_CTRL_FLAGS = 0x04,
  600. /* set if enable roam scan when bmiss and lowrssi */
  601. ROAM_SCAN_CTRL_FLAGS = 0x08,
  602. /* set if follows customer BSSINFO reporting rule */
  603. REPORT_BSSINFO_CTRL_FLAGS = 0x10,
  604. /* if disabled, target doesn't scan after a disconnect event */
  605. ENABLE_AUTO_CTRL_FLAGS = 0x20,
  606. /*
  607. * Scan complete event with canceled status will be generated when
  608. * a scan is prempted before it gets completed.
  609. */
  610. ENABLE_SCAN_ABORT_EVENT = 0x40
  611. };
  612. #define DEFAULT_SCAN_CTRL_FLAGS \
  613. (CONNECT_SCAN_CTRL_FLAGS | \
  614. SCAN_CONNECTED_CTRL_FLAGS | \
  615. ACTIVE_SCAN_CTRL_FLAGS | \
  616. ROAM_SCAN_CTRL_FLAGS | \
  617. ENABLE_AUTO_CTRL_FLAGS)
  618. struct wmi_scan_params_cmd {
  619. /* sec */
  620. __le16 fg_start_period;
  621. /* sec */
  622. __le16 fg_end_period;
  623. /* sec */
  624. __le16 bg_period;
  625. /* msec */
  626. __le16 maxact_chdwell_time;
  627. /* msec */
  628. __le16 pas_chdwell_time;
  629. /* how many shorts scan for one long */
  630. u8 short_scan_ratio;
  631. u8 scan_ctrl_flags;
  632. /* msec */
  633. __le16 minact_chdwell_time;
  634. /* max active scans per ssid */
  635. __le16 maxact_scan_per_ssid;
  636. /* msecs */
  637. __le32 max_dfsch_act_time;
  638. } __packed;
  639. /* WMI_SET_BSS_FILTER_CMDID */
  640. enum wmi_bss_filter {
  641. /* no beacons forwarded */
  642. NONE_BSS_FILTER = 0x0,
  643. /* all beacons forwarded */
  644. ALL_BSS_FILTER,
  645. /* only beacons matching profile */
  646. PROFILE_FILTER,
  647. /* all but beacons matching profile */
  648. ALL_BUT_PROFILE_FILTER,
  649. /* only beacons matching current BSS */
  650. CURRENT_BSS_FILTER,
  651. /* all but beacons matching BSS */
  652. ALL_BUT_BSS_FILTER,
  653. /* beacons matching probed ssid */
  654. PROBED_SSID_FILTER,
  655. /* marker only */
  656. LAST_BSS_FILTER,
  657. };
  658. struct wmi_bss_filter_cmd {
  659. /* see, enum wmi_bss_filter */
  660. u8 bss_filter;
  661. /* for alignment */
  662. u8 reserved1;
  663. /* for alignment */
  664. __le16 reserved2;
  665. __le32 ie_mask;
  666. } __packed;
  667. /* WMI_SET_PROBED_SSID_CMDID */
  668. #define MAX_PROBED_SSID_INDEX 9
  669. enum wmi_ssid_flag {
  670. /* disables entry */
  671. DISABLE_SSID_FLAG = 0,
  672. /* probes specified ssid */
  673. SPECIFIC_SSID_FLAG = 0x01,
  674. /* probes for any ssid */
  675. ANY_SSID_FLAG = 0x02,
  676. };
  677. struct wmi_probed_ssid_cmd {
  678. /* 0 to MAX_PROBED_SSID_INDEX */
  679. u8 entry_index;
  680. /* see, enum wmi_ssid_flg */
  681. u8 flag;
  682. u8 ssid_len;
  683. u8 ssid[IEEE80211_MAX_SSID_LEN];
  684. } __packed;
  685. /*
  686. * WMI_SET_LISTEN_INT_CMDID
  687. * The Listen interval is between 15 and 3000 TUs
  688. */
  689. struct wmi_listen_int_cmd {
  690. __le16 listen_intvl;
  691. __le16 num_beacons;
  692. } __packed;
  693. /* WMI_SET_POWER_MODE_CMDID */
  694. enum wmi_power_mode {
  695. REC_POWER = 0x01,
  696. MAX_PERF_POWER,
  697. };
  698. struct wmi_power_mode_cmd {
  699. /* see, enum wmi_power_mode */
  700. u8 pwr_mode;
  701. } __packed;
  702. /*
  703. * Policy to determnine whether power save failure event should be sent to
  704. * host during scanning
  705. */
  706. enum power_save_fail_event_policy {
  707. SEND_POWER_SAVE_FAIL_EVENT_ALWAYS = 1,
  708. IGNORE_POWER_SAVE_FAIL_EVENT_DURING_SCAN = 2,
  709. };
  710. struct wmi_power_params_cmd {
  711. /* msec */
  712. __le16 idle_period;
  713. __le16 pspoll_number;
  714. __le16 dtim_policy;
  715. __le16 tx_wakeup_policy;
  716. __le16 num_tx_to_wakeup;
  717. __le16 ps_fail_event_policy;
  718. } __packed;
  719. /* WMI_SET_DISC_TIMEOUT_CMDID */
  720. struct wmi_disc_timeout_cmd {
  721. /* seconds */
  722. u8 discon_timeout;
  723. } __packed;
  724. enum dir_type {
  725. UPLINK_TRAFFIC = 0,
  726. DNLINK_TRAFFIC = 1,
  727. BIDIR_TRAFFIC = 2,
  728. };
  729. enum voiceps_cap_type {
  730. DISABLE_FOR_THIS_AC = 0,
  731. ENABLE_FOR_THIS_AC = 1,
  732. ENABLE_FOR_ALL_AC = 2,
  733. };
  734. enum traffic_type {
  735. TRAFFIC_TYPE_APERIODIC = 0,
  736. TRAFFIC_TYPE_PERIODIC = 1,
  737. };
  738. /* WMI_SYNCHRONIZE_CMDID */
  739. struct wmi_sync_cmd {
  740. u8 data_sync_map;
  741. } __packed;
  742. /* WMI_CREATE_PSTREAM_CMDID */
  743. struct wmi_create_pstream_cmd {
  744. /* msec */
  745. __le32 min_service_int;
  746. /* msec */
  747. __le32 max_service_int;
  748. /* msec */
  749. __le32 inactivity_int;
  750. /* msec */
  751. __le32 suspension_int;
  752. __le32 service_start_time;
  753. /* in bps */
  754. __le32 min_data_rate;
  755. /* in bps */
  756. __le32 mean_data_rate;
  757. /* in bps */
  758. __le32 peak_data_rate;
  759. __le32 max_burst_size;
  760. __le32 delay_bound;
  761. /* in bps */
  762. __le32 min_phy_rate;
  763. __le32 sba;
  764. __le32 medium_time;
  765. /* in octects */
  766. __le16 nominal_msdu;
  767. /* in octects */
  768. __le16 max_msdu;
  769. u8 traffic_class;
  770. /* see, enum dir_type */
  771. u8 traffic_direc;
  772. u8 rx_queue_num;
  773. /* see, enum traffic_type */
  774. u8 traffic_type;
  775. /* see, enum voiceps_cap_type */
  776. u8 voice_psc_cap;
  777. u8 tsid;
  778. /* 802.1D user priority */
  779. u8 user_pri;
  780. /* nominal phy rate */
  781. u8 nominal_phy;
  782. } __packed;
  783. /* WMI_DELETE_PSTREAM_CMDID */
  784. struct wmi_delete_pstream_cmd {
  785. u8 tx_queue_num;
  786. u8 rx_queue_num;
  787. u8 traffic_direc;
  788. u8 traffic_class;
  789. u8 tsid;
  790. } __packed;
  791. /* WMI_SET_CHANNEL_PARAMS_CMDID */
  792. enum wmi_phy_mode {
  793. WMI_11A_MODE = 0x1,
  794. WMI_11G_MODE = 0x2,
  795. WMI_11AG_MODE = 0x3,
  796. WMI_11B_MODE = 0x4,
  797. WMI_11GONLY_MODE = 0x5,
  798. };
  799. #define WMI_MAX_CHANNELS 32
  800. /*
  801. * WMI_RSSI_THRESHOLD_PARAMS_CMDID
  802. * Setting the polltime to 0 would disable polling. Threshold values are
  803. * in the ascending order, and should agree to:
  804. * (lowThreshold_lowerVal < lowThreshold_upperVal < highThreshold_lowerVal
  805. * < highThreshold_upperVal)
  806. */
  807. struct wmi_rssi_threshold_params_cmd {
  808. /* polling time as a factor of LI */
  809. __le32 poll_time;
  810. /* lowest of upper */
  811. a_sle16 thresh_above1_val;
  812. a_sle16 thresh_above2_val;
  813. a_sle16 thresh_above3_val;
  814. a_sle16 thresh_above4_val;
  815. a_sle16 thresh_above5_val;
  816. /* highest of upper */
  817. a_sle16 thresh_above6_val;
  818. /* lowest of bellow */
  819. a_sle16 thresh_below1_val;
  820. a_sle16 thresh_below2_val;
  821. a_sle16 thresh_below3_val;
  822. a_sle16 thresh_below4_val;
  823. a_sle16 thresh_below5_val;
  824. /* highest of bellow */
  825. a_sle16 thresh_below6_val;
  826. /* "alpha" */
  827. u8 weight;
  828. u8 reserved[3];
  829. } __packed;
  830. /*
  831. * WMI_SNR_THRESHOLD_PARAMS_CMDID
  832. * Setting the polltime to 0 would disable polling.
  833. */
  834. struct wmi_snr_threshold_params_cmd {
  835. /* polling time as a factor of LI */
  836. __le32 poll_time;
  837. /* "alpha" */
  838. u8 weight;
  839. /* lowest of uppper */
  840. u8 thresh_above1_val;
  841. u8 thresh_above2_val;
  842. u8 thresh_above3_val;
  843. /* highest of upper */
  844. u8 thresh_above4_val;
  845. /* lowest of bellow */
  846. u8 thresh_below1_val;
  847. u8 thresh_below2_val;
  848. u8 thresh_below3_val;
  849. /* highest of bellow */
  850. u8 thresh_below4_val;
  851. u8 reserved[3];
  852. } __packed;
  853. enum wmi_preamble_policy {
  854. WMI_IGNORE_BARKER_IN_ERP = 0,
  855. WMI_DONOT_IGNORE_BARKER_IN_ERP
  856. };
  857. struct wmi_set_lpreamble_cmd {
  858. u8 status;
  859. u8 preamble_policy;
  860. } __packed;
  861. struct wmi_set_rts_cmd {
  862. __le16 threshold;
  863. } __packed;
  864. /* WMI_SET_TX_PWR_CMDID */
  865. struct wmi_set_tx_pwr_cmd {
  866. /* in dbM units */
  867. u8 dbM;
  868. } __packed;
  869. struct wmi_tx_pwr_reply {
  870. /* in dbM units */
  871. u8 dbM;
  872. } __packed;
  873. struct wmi_report_sleep_state_event {
  874. __le32 sleep_state;
  875. };
  876. enum wmi_report_sleep_status {
  877. WMI_REPORT_SLEEP_STATUS_IS_DEEP_SLEEP = 0,
  878. WMI_REPORT_SLEEP_STATUS_IS_AWAKE
  879. };
  880. enum target_event_report_config {
  881. /* default */
  882. DISCONN_EVT_IN_RECONN = 0,
  883. NO_DISCONN_EVT_IN_RECONN
  884. };
  885. /* Command Replies */
  886. /* WMI_GET_CHANNEL_LIST_CMDID reply */
  887. struct wmi_channel_list_reply {
  888. u8 reserved;
  889. /* number of channels in reply */
  890. u8 num_ch;
  891. /* channel in Mhz */
  892. __le16 ch_list[1];
  893. } __packed;
  894. /* List of Events (target to host) */
  895. enum wmi_event_id {
  896. WMI_READY_EVENTID = 0x1001,
  897. WMI_CONNECT_EVENTID,
  898. WMI_DISCONNECT_EVENTID,
  899. WMI_BSSINFO_EVENTID,
  900. WMI_CMDERROR_EVENTID,
  901. WMI_REGDOMAIN_EVENTID,
  902. WMI_PSTREAM_TIMEOUT_EVENTID,
  903. WMI_NEIGHBOR_REPORT_EVENTID,
  904. WMI_TKIP_MICERR_EVENTID,
  905. WMI_SCAN_COMPLETE_EVENTID, /* 0x100a */
  906. WMI_REPORT_STATISTICS_EVENTID,
  907. WMI_RSSI_THRESHOLD_EVENTID,
  908. WMI_ERROR_REPORT_EVENTID,
  909. WMI_OPT_RX_FRAME_EVENTID,
  910. WMI_REPORT_ROAM_TBL_EVENTID,
  911. WMI_EXTENSION_EVENTID,
  912. WMI_CAC_EVENTID,
  913. WMI_SNR_THRESHOLD_EVENTID,
  914. WMI_LQ_THRESHOLD_EVENTID,
  915. WMI_TX_RETRY_ERR_EVENTID, /* 0x1014 */
  916. WMI_REPORT_ROAM_DATA_EVENTID,
  917. WMI_TEST_EVENTID,
  918. WMI_APLIST_EVENTID,
  919. WMI_GET_WOW_LIST_EVENTID,
  920. WMI_GET_PMKID_LIST_EVENTID,
  921. WMI_CHANNEL_CHANGE_EVENTID,
  922. WMI_PEER_NODE_EVENTID,
  923. WMI_PSPOLL_EVENTID,
  924. WMI_DTIMEXPIRY_EVENTID,
  925. WMI_WLAN_VERSION_EVENTID,
  926. WMI_SET_PARAMS_REPLY_EVENTID,
  927. WMI_ADDBA_REQ_EVENTID, /*0x1020 */
  928. WMI_ADDBA_RESP_EVENTID,
  929. WMI_DELBA_REQ_EVENTID,
  930. WMI_TX_COMPLETE_EVENTID,
  931. WMI_HCI_EVENT_EVENTID,
  932. WMI_ACL_DATA_EVENTID,
  933. WMI_REPORT_SLEEP_STATE_EVENTID,
  934. WMI_REPORT_BTCOEX_STATS_EVENTID,
  935. WMI_REPORT_BTCOEX_CONFIG_EVENTID,
  936. WMI_GET_PMK_EVENTID,
  937. /* DFS Events */
  938. WMI_DFS_HOST_ATTACH_EVENTID,
  939. WMI_DFS_HOST_INIT_EVENTID,
  940. WMI_DFS_RESET_DELAYLINES_EVENTID,
  941. WMI_DFS_RESET_RADARQ_EVENTID,
  942. WMI_DFS_RESET_AR_EVENTID,
  943. WMI_DFS_RESET_ARQ_EVENTID,
  944. WMI_DFS_SET_DUR_MULTIPLIER_EVENTID,
  945. WMI_DFS_SET_BANGRADAR_EVENTID,
  946. WMI_DFS_SET_DEBUGLEVEL_EVENTID,
  947. WMI_DFS_PHYERR_EVENTID,
  948. /* CCX Evants */
  949. WMI_CCX_RM_STATUS_EVENTID,
  950. /* P2P Events */
  951. WMI_P2P_GO_NEG_RESULT_EVENTID,
  952. WMI_WAC_SCAN_DONE_EVENTID,
  953. WMI_WAC_REPORT_BSS_EVENTID,
  954. WMI_WAC_START_WPS_EVENTID,
  955. WMI_WAC_CTRL_REQ_REPLY_EVENTID,
  956. /* RFKILL Events */
  957. WMI_RFKILL_STATE_CHANGE_EVENTID,
  958. WMI_RFKILL_GET_MODE_CMD_EVENTID,
  959. WMI_THIN_RESERVED_START_EVENTID = 0x8000,
  960. /*
  961. * Events in this range are reserved for thinmode
  962. * See wmi_thin.h for actual definitions
  963. */
  964. WMI_THIN_RESERVED_END_EVENTID = 0x8fff,
  965. WMI_SET_CHANNEL_EVENTID,
  966. WMI_ASSOC_REQ_EVENTID,
  967. /* Generic ACS event */
  968. WMI_ACS_EVENTID,
  969. WMI_REPORT_WMM_PARAMS_EVENTID
  970. };
  971. struct wmi_ready_event_2 {
  972. __le32 sw_version;
  973. __le32 abi_version;
  974. u8 mac_addr[ETH_ALEN];
  975. u8 phy_cap;
  976. } __packed;
  977. /* Connect Event */
  978. struct wmi_connect_event {
  979. __le16 ch;
  980. u8 bssid[ETH_ALEN];
  981. __le16 listen_intvl;
  982. __le16 beacon_intvl;
  983. __le32 nw_type;
  984. u8 beacon_ie_len;
  985. u8 assoc_req_len;
  986. u8 assoc_resp_len;
  987. u8 assoc_info[1];
  988. } __packed;
  989. /* Disconnect Event */
  990. enum wmi_disconnect_reason {
  991. NO_NETWORK_AVAIL = 0x01,
  992. /* bmiss */
  993. LOST_LINK = 0x02,
  994. DISCONNECT_CMD = 0x03,
  995. BSS_DISCONNECTED = 0x04,
  996. AUTH_FAILED = 0x05,
  997. ASSOC_FAILED = 0x06,
  998. NO_RESOURCES_AVAIL = 0x07,
  999. CSERV_DISCONNECT = 0x08,
  1000. INVALID_PROFILE = 0x0a,
  1001. DOT11H_CHANNEL_SWITCH = 0x0b,
  1002. PROFILE_MISMATCH = 0x0c,
  1003. CONNECTION_EVICTED = 0x0d,
  1004. IBSS_MERGE = 0xe,
  1005. };
  1006. struct wmi_disconnect_event {
  1007. /* reason code, see 802.11 spec. */
  1008. __le16 proto_reason_status;
  1009. /* set if known */
  1010. u8 bssid[ETH_ALEN];
  1011. /* see WMI_DISCONNECT_REASON */
  1012. u8 disconn_reason;
  1013. u8 assoc_resp_len;
  1014. u8 assoc_info[1];
  1015. } __packed;
  1016. /*
  1017. * BSS Info Event.
  1018. * Mechanism used to inform host of the presence and characteristic of
  1019. * wireless networks present. Consists of bss info header followed by
  1020. * the beacon or probe-response frame body. The 802.11 header is no included.
  1021. */
  1022. enum wmi_bi_ftype {
  1023. BEACON_FTYPE = 0x1,
  1024. PROBERESP_FTYPE,
  1025. ACTION_MGMT_FTYPE,
  1026. PROBEREQ_FTYPE,
  1027. };
  1028. struct wmi_bss_info_hdr {
  1029. __le16 ch;
  1030. /* see, enum wmi_bi_ftype */
  1031. u8 frame_type;
  1032. u8 snr;
  1033. a_sle16 rssi;
  1034. u8 bssid[ETH_ALEN];
  1035. __le32 ie_mask;
  1036. } __packed;
  1037. /*
  1038. * BSS INFO HDR version 2.0
  1039. * With 6 bytes HTC header and 6 bytes of WMI header
  1040. * WMI_BSS_INFO_HDR cannot be accommodated in the removed 802.11 management
  1041. * header space.
  1042. * - Reduce the ie_mask to 2 bytes as only two bit flags are used
  1043. * - Remove rssi and compute it on the host. rssi = snr - 95
  1044. */
  1045. struct wmi_bss_info_hdr2 {
  1046. __le16 ch;
  1047. /* see, enum wmi_bi_ftype */
  1048. u8 frame_type;
  1049. u8 snr;
  1050. u8 bssid[ETH_ALEN];
  1051. __le16 ie_mask;
  1052. } __packed;
  1053. /* Command Error Event */
  1054. enum wmi_error_code {
  1055. INVALID_PARAM = 0x01,
  1056. ILLEGAL_STATE = 0x02,
  1057. INTERNAL_ERROR = 0x03,
  1058. };
  1059. struct wmi_cmd_error_event {
  1060. __le16 cmd_id;
  1061. u8 err_code;
  1062. } __packed;
  1063. struct wmi_pstream_timeout_event {
  1064. u8 tx_queue_num;
  1065. u8 rx_queue_num;
  1066. u8 traffic_direc;
  1067. u8 traffic_class;
  1068. } __packed;
  1069. /*
  1070. * The WMI_NEIGHBOR_REPORT Event is generated by the target to inform
  1071. * the host of BSS's it has found that matches the current profile.
  1072. * It can be used by the host to cache PMKs and/to initiate pre-authentication
  1073. * if the BSS supports it. The first bssid is always the current associated
  1074. * BSS.
  1075. * The bssid and bssFlags information repeats according to the number
  1076. * or APs reported.
  1077. */
  1078. enum wmi_bss_flags {
  1079. WMI_DEFAULT_BSS_FLAGS = 0x00,
  1080. WMI_PREAUTH_CAPABLE_BSS = 0x01,
  1081. WMI_PMKID_VALID_BSS = 0x02,
  1082. };
  1083. /* TKIP MIC Error Event */
  1084. struct wmi_tkip_micerr_event {
  1085. u8 key_id;
  1086. u8 is_mcast;
  1087. } __packed;
  1088. /* WMI_SCAN_COMPLETE_EVENTID */
  1089. struct wmi_scan_complete_event {
  1090. a_sle32 status;
  1091. } __packed;
  1092. #define MAX_OPT_DATA_LEN 1400
  1093. /*
  1094. * Special frame receive Event.
  1095. * Mechanism used to inform host of the receiption of the special frames.
  1096. * Consists of special frame info header followed by special frame body.
  1097. * The 802.11 header is not included.
  1098. */
  1099. struct wmi_opt_rx_info_hdr {
  1100. __le16 ch;
  1101. u8 frame_type;
  1102. s8 snr;
  1103. u8 src_addr[ETH_ALEN];
  1104. u8 bssid[ETH_ALEN];
  1105. } __packed;
  1106. /* Reporting statistic */
  1107. struct tx_stats {
  1108. __le32 pkt;
  1109. __le32 byte;
  1110. __le32 ucast_pkt;
  1111. __le32 ucast_byte;
  1112. __le32 mcast_pkt;
  1113. __le32 mcast_byte;
  1114. __le32 bcast_pkt;
  1115. __le32 bcast_byte;
  1116. __le32 rts_success_cnt;
  1117. __le32 pkt_per_ac[4];
  1118. __le32 err_per_ac[4];
  1119. __le32 err;
  1120. __le32 fail_cnt;
  1121. __le32 retry_cnt;
  1122. __le32 mult_retry_cnt;
  1123. __le32 rts_fail_cnt;
  1124. a_sle32 ucast_rate;
  1125. } __packed;
  1126. struct rx_stats {
  1127. __le32 pkt;
  1128. __le32 byte;
  1129. __le32 ucast_pkt;
  1130. __le32 ucast_byte;
  1131. __le32 mcast_pkt;
  1132. __le32 mcast_byte;
  1133. __le32 bcast_pkt;
  1134. __le32 bcast_byte;
  1135. __le32 frgment_pkt;
  1136. __le32 err;
  1137. __le32 crc_err;
  1138. __le32 key_cache_miss;
  1139. __le32 decrypt_err;
  1140. __le32 dupl_frame;
  1141. a_sle32 ucast_rate;
  1142. } __packed;
  1143. struct tkip_ccmp_stats {
  1144. __le32 tkip_local_mic_fail;
  1145. __le32 tkip_cnter_measures_invoked;
  1146. __le32 tkip_replays;
  1147. __le32 tkip_fmt_err;
  1148. __le32 ccmp_fmt_err;
  1149. __le32 ccmp_replays;
  1150. } __packed;
  1151. struct pm_stats {
  1152. __le32 pwr_save_failure_cnt;
  1153. __le16 stop_tx_failure_cnt;
  1154. __le16 atim_tx_failure_cnt;
  1155. __le16 atim_rx_failure_cnt;
  1156. __le16 bcn_rx_failure_cnt;
  1157. } __packed;
  1158. struct cserv_stats {
  1159. __le32 cs_bmiss_cnt;
  1160. __le32 cs_low_rssi_cnt;
  1161. __le16 cs_connect_cnt;
  1162. __le16 cs_discon_cnt;
  1163. a_sle16 cs_ave_beacon_rssi;
  1164. __le16 cs_roam_count;
  1165. a_sle16 cs_rssi;
  1166. u8 cs_snr;
  1167. u8 cs_ave_beacon_snr;
  1168. u8 cs_last_roam_msec;
  1169. } __packed;
  1170. struct wlan_net_stats {
  1171. struct tx_stats tx;
  1172. struct rx_stats rx;
  1173. struct tkip_ccmp_stats tkip_ccmp_stats;
  1174. } __packed;
  1175. struct arp_stats {
  1176. __le32 arp_received;
  1177. __le32 arp_matched;
  1178. __le32 arp_replied;
  1179. } __packed;
  1180. struct wlan_wow_stats {
  1181. __le32 wow_pkt_dropped;
  1182. __le16 wow_evt_discarded;
  1183. u8 wow_host_pkt_wakeups;
  1184. u8 wow_host_evt_wakeups;
  1185. } __packed;
  1186. struct wmi_target_stats {
  1187. __le32 lq_val;
  1188. a_sle32 noise_floor_calib;
  1189. struct pm_stats pm_stats;
  1190. struct wlan_net_stats stats;
  1191. struct wlan_wow_stats wow_stats;
  1192. struct arp_stats arp_stats;
  1193. struct cserv_stats cserv_stats;
  1194. } __packed;
  1195. /*
  1196. * WMI_RSSI_THRESHOLD_EVENTID.
  1197. * Indicate the RSSI events to host. Events are indicated when we breach a
  1198. * thresold value.
  1199. */
  1200. enum wmi_rssi_threshold_val {
  1201. WMI_RSSI_THRESHOLD1_ABOVE = 0,
  1202. WMI_RSSI_THRESHOLD2_ABOVE,
  1203. WMI_RSSI_THRESHOLD3_ABOVE,
  1204. WMI_RSSI_THRESHOLD4_ABOVE,
  1205. WMI_RSSI_THRESHOLD5_ABOVE,
  1206. WMI_RSSI_THRESHOLD6_ABOVE,
  1207. WMI_RSSI_THRESHOLD1_BELOW,
  1208. WMI_RSSI_THRESHOLD2_BELOW,
  1209. WMI_RSSI_THRESHOLD3_BELOW,
  1210. WMI_RSSI_THRESHOLD4_BELOW,
  1211. WMI_RSSI_THRESHOLD5_BELOW,
  1212. WMI_RSSI_THRESHOLD6_BELOW
  1213. };
  1214. struct wmi_rssi_threshold_event {
  1215. a_sle16 rssi;
  1216. u8 range;
  1217. } __packed;
  1218. enum wmi_snr_threshold_val {
  1219. WMI_SNR_THRESHOLD1_ABOVE = 1,
  1220. WMI_SNR_THRESHOLD1_BELOW,
  1221. WMI_SNR_THRESHOLD2_ABOVE,
  1222. WMI_SNR_THRESHOLD2_BELOW,
  1223. WMI_SNR_THRESHOLD3_ABOVE,
  1224. WMI_SNR_THRESHOLD3_BELOW,
  1225. WMI_SNR_THRESHOLD4_ABOVE,
  1226. WMI_SNR_THRESHOLD4_BELOW
  1227. };
  1228. struct wmi_snr_threshold_event {
  1229. /* see, enum wmi_snr_threshold_val */
  1230. u8 range;
  1231. u8 snr;
  1232. } __packed;
  1233. /* WMI_REPORT_ROAM_TBL_EVENTID */
  1234. #define MAX_ROAM_TBL_CAND 5
  1235. struct wmi_bss_roam_info {
  1236. a_sle32 roam_util;
  1237. u8 bssid[ETH_ALEN];
  1238. s8 rssi;
  1239. s8 rssidt;
  1240. s8 last_rssi;
  1241. s8 util;
  1242. s8 bias;
  1243. /* for alignment */
  1244. u8 reserved;
  1245. } __packed;
  1246. /* WMI_CAC_EVENTID */
  1247. enum cac_indication {
  1248. CAC_INDICATION_ADMISSION = 0x00,
  1249. CAC_INDICATION_ADMISSION_RESP = 0x01,
  1250. CAC_INDICATION_DELETE = 0x02,
  1251. CAC_INDICATION_NO_RESP = 0x03,
  1252. };
  1253. #define WMM_TSPEC_IE_LEN 63
  1254. struct wmi_cac_event {
  1255. u8 ac;
  1256. u8 cac_indication;
  1257. u8 status_code;
  1258. u8 tspec_suggestion[WMM_TSPEC_IE_LEN];
  1259. } __packed;
  1260. /* WMI_APLIST_EVENTID */
  1261. enum aplist_ver {
  1262. APLIST_VER1 = 1,
  1263. };
  1264. struct wmi_ap_info_v1 {
  1265. u8 bssid[ETH_ALEN];
  1266. __le16 channel;
  1267. } __packed;
  1268. union wmi_ap_info {
  1269. struct wmi_ap_info_v1 ap_info_v1;
  1270. } __packed;
  1271. struct wmi_aplist_event {
  1272. u8 ap_list_ver;
  1273. u8 num_ap;
  1274. union wmi_ap_info ap_list[1];
  1275. } __packed;
  1276. /* Developer Commands */
  1277. /*
  1278. * WMI_SET_BITRATE_CMDID
  1279. *
  1280. * Get bit rate cmd uses same definition as set bit rate cmd
  1281. */
  1282. enum wmi_bit_rate {
  1283. RATE_AUTO = -1,
  1284. RATE_1Mb = 0,
  1285. RATE_2Mb = 1,
  1286. RATE_5_5Mb = 2,
  1287. RATE_11Mb = 3,
  1288. RATE_6Mb = 4,
  1289. RATE_9Mb = 5,
  1290. RATE_12Mb = 6,
  1291. RATE_18Mb = 7,
  1292. RATE_24Mb = 8,
  1293. RATE_36Mb = 9,
  1294. RATE_48Mb = 10,
  1295. RATE_54Mb = 11,
  1296. RATE_MCS_0_20 = 12,
  1297. RATE_MCS_1_20 = 13,
  1298. RATE_MCS_2_20 = 14,
  1299. RATE_MCS_3_20 = 15,
  1300. RATE_MCS_4_20 = 16,
  1301. RATE_MCS_5_20 = 17,
  1302. RATE_MCS_6_20 = 18,
  1303. RATE_MCS_7_20 = 19,
  1304. RATE_MCS_0_40 = 20,
  1305. RATE_MCS_1_40 = 21,
  1306. RATE_MCS_2_40 = 22,
  1307. RATE_MCS_3_40 = 23,
  1308. RATE_MCS_4_40 = 24,
  1309. RATE_MCS_5_40 = 25,
  1310. RATE_MCS_6_40 = 26,
  1311. RATE_MCS_7_40 = 27,
  1312. };
  1313. struct wmi_bit_rate_reply {
  1314. /* see, enum wmi_bit_rate */
  1315. s8 rate_index;
  1316. } __packed;
  1317. /*
  1318. * WMI_SET_FIXRATES_CMDID
  1319. *
  1320. * Get fix rates cmd uses same definition as set fix rates cmd
  1321. */
  1322. struct wmi_fix_rates_reply {
  1323. /* see wmi_bit_rate */
  1324. __le32 fix_rate_mask;
  1325. } __packed;
  1326. enum roam_data_type {
  1327. /* get the roam time data */
  1328. ROAM_DATA_TIME = 1,
  1329. };
  1330. struct wmi_target_roam_time {
  1331. __le32 disassoc_time;
  1332. __le32 no_txrx_time;
  1333. __le32 assoc_time;
  1334. __le32 allow_txrx_time;
  1335. u8 disassoc_bssid[ETH_ALEN];
  1336. s8 disassoc_bss_rssi;
  1337. u8 assoc_bssid[ETH_ALEN];
  1338. s8 assoc_bss_rssi;
  1339. } __packed;
  1340. enum wmi_txop_cfg {
  1341. WMI_TXOP_DISABLED = 0,
  1342. WMI_TXOP_ENABLED
  1343. };
  1344. struct wmi_set_wmm_txop_cmd {
  1345. u8 txop_enable;
  1346. } __packed;
  1347. struct wmi_set_keepalive_cmd {
  1348. u8 keep_alive_intvl;
  1349. } __packed;
  1350. struct wmi_get_keepalive_cmd {
  1351. __le32 configured;
  1352. u8 keep_alive_intvl;
  1353. } __packed;
  1354. struct wmi_set_appie_cmd {
  1355. u8 mgmt_frm_type; /* enum wmi_mgmt_frame_type */
  1356. u8 ie_len;
  1357. u8 ie_info[0];
  1358. } __packed;
  1359. /* Notify the WSC registration status to the target */
  1360. #define WSC_REG_ACTIVE 1
  1361. #define WSC_REG_INACTIVE 0
  1362. #define WOW_MAX_FILTER_LISTS 1
  1363. #define WOW_MAX_FILTERS_PER_LIST 4
  1364. #define WOW_PATTERN_SIZE 64
  1365. #define WOW_MASK_SIZE 64
  1366. #define MAC_MAX_FILTERS_PER_LIST 4
  1367. struct wow_filter {
  1368. u8 wow_valid_filter;
  1369. u8 wow_filter_id;
  1370. u8 wow_filter_size;
  1371. u8 wow_filter_offset;
  1372. u8 wow_filter_mask[WOW_MASK_SIZE];
  1373. u8 wow_filter_pattern[WOW_PATTERN_SIZE];
  1374. } __packed;
  1375. #define MAX_IP_ADDRS 2
  1376. struct wmi_set_ip_cmd {
  1377. /* IP in network byte order */
  1378. __le32 ips[MAX_IP_ADDRS];
  1379. } __packed;
  1380. /* WMI_GET_WOW_LIST_CMD reply */
  1381. struct wmi_get_wow_list_reply {
  1382. /* number of patterns in reply */
  1383. u8 num_filters;
  1384. /* this is filter # x of total num_filters */
  1385. u8 this_filter_num;
  1386. u8 wow_mode;
  1387. u8 host_mode;
  1388. struct wow_filter wow_filters[1];
  1389. } __packed;
  1390. /* WMI_SET_AKMP_PARAMS_CMD */
  1391. struct wmi_pmkid {
  1392. u8 pmkid[WMI_PMKID_LEN];
  1393. } __packed;
  1394. /* WMI_GET_PMKID_LIST_CMD Reply */
  1395. struct wmi_pmkid_list_reply {
  1396. __le32 num_pmkid;
  1397. u8 bssid_list[ETH_ALEN][1];
  1398. struct wmi_pmkid pmkid_list[1];
  1399. } __packed;
  1400. /* WMI_ADDBA_REQ_EVENTID */
  1401. struct wmi_addba_req_event {
  1402. u8 tid;
  1403. u8 win_sz;
  1404. __le16 st_seq_no;
  1405. /* f/w response for ADDBA Req; OK (0) or failure (!=0) */
  1406. u8 status;
  1407. } __packed;
  1408. /* WMI_ADDBA_RESP_EVENTID */
  1409. struct wmi_addba_resp_event {
  1410. u8 tid;
  1411. /* OK (0), failure (!=0) */
  1412. u8 status;
  1413. /* three values: not supported(0), 3839, 8k */
  1414. __le16 amsdu_sz;
  1415. } __packed;
  1416. /* WMI_DELBA_EVENTID
  1417. * f/w received a DELBA for peer and processed it.
  1418. * Host is notified of this
  1419. */
  1420. struct wmi_delba_event {
  1421. u8 tid;
  1422. u8 is_peer_initiator;
  1423. __le16 reason_code;
  1424. } __packed;
  1425. #define PEER_NODE_JOIN_EVENT 0x00
  1426. #define PEER_NODE_LEAVE_EVENT 0x01
  1427. #define PEER_FIRST_NODE_JOIN_EVENT 0x10
  1428. #define PEER_LAST_NODE_LEAVE_EVENT 0x11
  1429. struct wmi_peer_node_event {
  1430. u8 event_code;
  1431. u8 peer_mac_addr[ETH_ALEN];
  1432. } __packed;
  1433. /* Transmit complete event data structure(s) */
  1434. /* version 1 of tx complete msg */
  1435. struct tx_complete_msg_v1 {
  1436. #define TX_COMPLETE_STATUS_SUCCESS 0
  1437. #define TX_COMPLETE_STATUS_RETRIES 1
  1438. #define TX_COMPLETE_STATUS_NOLINK 2
  1439. #define TX_COMPLETE_STATUS_TIMEOUT 3
  1440. #define TX_COMPLETE_STATUS_OTHER 4
  1441. u8 status;
  1442. /* packet ID to identify parent packet */
  1443. u8 pkt_id;
  1444. /* rate index on successful transmission */
  1445. u8 rate_idx;
  1446. /* number of ACK failures in tx attempt */
  1447. u8 ack_failures;
  1448. } __packed;
  1449. struct wmi_tx_complete_event {
  1450. /* no of tx comp msgs following this struct */
  1451. u8 num_msg;
  1452. /* length in bytes for each individual msg following this struct */
  1453. u8 msg_len;
  1454. /* version of tx complete msg data following this struct */
  1455. u8 msg_type;
  1456. /* individual messages follow this header */
  1457. u8 reserved;
  1458. } __packed;
  1459. /*
  1460. * ------- AP Mode definitions --------------
  1461. */
  1462. /*
  1463. * !!! Warning !!!
  1464. * -Changing the following values needs compilation of both driver and firmware
  1465. */
  1466. #define AP_MAX_NUM_STA 8
  1467. /* Spl. AID used to set DTIM flag in the beacons */
  1468. #define MCAST_AID 0xFF
  1469. #define DEF_AP_COUNTRY_CODE "US "
  1470. /* Used with WMI_AP_SET_NUM_STA_CMDID */
  1471. struct wmi_ap_set_pvb_cmd {
  1472. __le32 flag;
  1473. __le16 aid;
  1474. } __packed;
  1475. struct wmi_rx_frame_format_cmd {
  1476. /* version of meta data for rx packets <0 = default> (0-7 = valid) */
  1477. u8 meta_ver;
  1478. /*
  1479. * 1 == leave .11 header intact,
  1480. * 0 == replace .11 header with .3 <default>
  1481. */
  1482. u8 dot11_hdr;
  1483. /*
  1484. * 1 == defragmentation is performed by host,
  1485. * 0 == performed by target <default>
  1486. */
  1487. u8 defrag_on_host;
  1488. /* for alignment */
  1489. u8 reserved[1];
  1490. } __packed;
  1491. /* AP mode events */
  1492. /* WMI_PS_POLL_EVENT */
  1493. struct wmi_pspoll_event {
  1494. __le16 aid;
  1495. } __packed;
  1496. struct wmi_per_sta_stat {
  1497. __le32 tx_bytes;
  1498. __le32 tx_pkts;
  1499. __le32 tx_error;
  1500. __le32 tx_discard;
  1501. __le32 rx_bytes;
  1502. __le32 rx_pkts;
  1503. __le32 rx_error;
  1504. __le32 rx_discard;
  1505. __le32 aid;
  1506. } __packed;
  1507. struct wmi_ap_mode_stat {
  1508. __le32 action;
  1509. struct wmi_per_sta_stat sta[AP_MAX_NUM_STA + 1];
  1510. } __packed;
  1511. /* End of AP mode definitions */
  1512. /* Extended WMI (WMIX)
  1513. *
  1514. * Extended WMIX commands are encapsulated in a WMI message with
  1515. * cmd=WMI_EXTENSION_CMD.
  1516. *
  1517. * Extended WMI commands are those that are needed during wireless
  1518. * operation, but which are not really wireless commands. This allows,
  1519. * for instance, platform-specific commands. Extended WMI commands are
  1520. * embedded in a WMI command message with WMI_COMMAND_ID=WMI_EXTENSION_CMDID.
  1521. * Extended WMI events are similarly embedded in a WMI event message with
  1522. * WMI_EVENT_ID=WMI_EXTENSION_EVENTID.
  1523. */
  1524. struct wmix_cmd_hdr {
  1525. __le32 cmd_id;
  1526. } __packed;
  1527. enum wmix_command_id {
  1528. WMIX_DSETOPEN_REPLY_CMDID = 0x2001,
  1529. WMIX_DSETDATA_REPLY_CMDID,
  1530. WMIX_GPIO_OUTPUT_SET_CMDID,
  1531. WMIX_GPIO_INPUT_GET_CMDID,
  1532. WMIX_GPIO_REGISTER_SET_CMDID,
  1533. WMIX_GPIO_REGISTER_GET_CMDID,
  1534. WMIX_GPIO_INTR_ACK_CMDID,
  1535. WMIX_HB_CHALLENGE_RESP_CMDID,
  1536. WMIX_DBGLOG_CFG_MODULE_CMDID,
  1537. WMIX_PROF_CFG_CMDID, /* 0x200a */
  1538. WMIX_PROF_ADDR_SET_CMDID,
  1539. WMIX_PROF_START_CMDID,
  1540. WMIX_PROF_STOP_CMDID,
  1541. WMIX_PROF_COUNT_GET_CMDID,
  1542. };
  1543. enum wmix_event_id {
  1544. WMIX_DSETOPENREQ_EVENTID = 0x3001,
  1545. WMIX_DSETCLOSE_EVENTID,
  1546. WMIX_DSETDATAREQ_EVENTID,
  1547. WMIX_GPIO_INTR_EVENTID,
  1548. WMIX_GPIO_DATA_EVENTID,
  1549. WMIX_GPIO_ACK_EVENTID,
  1550. WMIX_HB_CHALLENGE_RESP_EVENTID,
  1551. WMIX_DBGLOG_EVENTID,
  1552. WMIX_PROF_COUNT_EVENTID,
  1553. };
  1554. /*
  1555. * ------Error Detection support-------
  1556. */
  1557. /*
  1558. * WMIX_HB_CHALLENGE_RESP_CMDID
  1559. * Heartbeat Challenge Response command
  1560. */
  1561. struct wmix_hb_challenge_resp_cmd {
  1562. __le32 cookie;
  1563. __le32 source;
  1564. } __packed;
  1565. /* End of Extended WMI (WMIX) */
  1566. enum wmi_sync_flag {
  1567. NO_SYNC_WMIFLAG = 0,
  1568. /* transmit all queued data before cmd */
  1569. SYNC_BEFORE_WMIFLAG,
  1570. /* any new data waits until cmd execs */
  1571. SYNC_AFTER_WMIFLAG,
  1572. SYNC_BOTH_WMIFLAG,
  1573. /* end marker */
  1574. END_WMIFLAG
  1575. };
  1576. enum htc_endpoint_id ath6kl_wmi_get_control_ep(struct wmi *wmi);
  1577. void ath6kl_wmi_set_control_ep(struct wmi *wmi, enum htc_endpoint_id ep_id);
  1578. int ath6kl_wmi_dix_2_dot3(struct wmi *wmi, struct sk_buff *skb);
  1579. int ath6kl_wmi_data_hdr_add(struct wmi *wmi, struct sk_buff *skb,
  1580. u8 msg_type, bool more_data,
  1581. enum wmi_data_hdr_data_type data_type,
  1582. u8 meta_ver, void *tx_meta_info);
  1583. int ath6kl_wmi_dot11_hdr_remove(struct wmi *wmi, struct sk_buff *skb);
  1584. int ath6kl_wmi_dot3_2_dix(struct sk_buff *skb);
  1585. int ath6kl_wmi_implicit_create_pstream(struct wmi *wmi, struct sk_buff *skb,
  1586. u32 layer2_priority, bool wmm_enabled,
  1587. u8 *ac);
  1588. int ath6kl_wmi_control_rx(struct wmi *wmi, struct sk_buff *skb);
  1589. struct bss *ath6kl_wmi_find_node(struct wmi *wmi, const u8 *mac_addr);
  1590. void ath6kl_wmi_node_free(struct wmi *wmi, const u8 *mac_addr);
  1591. int ath6kl_wmi_cmd_send(struct wmi *wmi, struct sk_buff *skb,
  1592. enum wmi_cmd_id cmd_id, enum wmi_sync_flag sync_flag);
  1593. int ath6kl_wmi_connect_cmd(struct wmi *wmi, enum network_type nw_type,
  1594. enum dot11_auth_mode dot11_auth_mode,
  1595. enum auth_mode auth_mode,
  1596. enum crypto_type pairwise_crypto,
  1597. u8 pairwise_crypto_len,
  1598. enum crypto_type group_crypto,
  1599. u8 group_crypto_len, int ssid_len, u8 *ssid,
  1600. u8 *bssid, u16 channel, u32 ctrl_flags);
  1601. int ath6kl_wmi_reconnect_cmd(struct wmi *wmi, u8 *bssid, u16 channel);
  1602. int ath6kl_wmi_disconnect_cmd(struct wmi *wmi);
  1603. int ath6kl_wmi_startscan_cmd(struct wmi *wmi, enum wmi_scan_type scan_type,
  1604. u32 force_fgscan, u32 is_legacy,
  1605. u32 home_dwell_time, u32 force_scan_interval,
  1606. s8 num_chan, u16 *ch_list);
  1607. int ath6kl_wmi_scanparams_cmd(struct wmi *wmi, u16 fg_start_sec,
  1608. u16 fg_end_sec, u16 bg_sec,
  1609. u16 minact_chdw_msec, u16 maxact_chdw_msec,
  1610. u16 pas_chdw_msec, u8 short_scan_ratio,
  1611. u8 scan_ctrl_flag, u32 max_dfsch_act_time,
  1612. u16 maxact_scan_per_ssid);
  1613. int ath6kl_wmi_bssfilter_cmd(struct wmi *wmi, u8 filter, u32 ie_mask);
  1614. int ath6kl_wmi_probedssid_cmd(struct wmi *wmi, u8 index, u8 flag,
  1615. u8 ssid_len, u8 *ssid);
  1616. int ath6kl_wmi_listeninterval_cmd(struct wmi *wmi, u16 listen_interval,
  1617. u16 listen_beacons);
  1618. int ath6kl_wmi_powermode_cmd(struct wmi *wmi, u8 pwr_mode);
  1619. int ath6kl_wmi_pmparams_cmd(struct wmi *wmi, u16 idle_period,
  1620. u16 ps_poll_num, u16 dtim_policy,
  1621. u16 tx_wakup_policy, u16 num_tx_to_wakeup,
  1622. u16 ps_fail_event_policy);
  1623. int ath6kl_wmi_disctimeout_cmd(struct wmi *wmi, u8 timeout);
  1624. int ath6kl_wmi_create_pstream_cmd(struct wmi *wmi,
  1625. struct wmi_create_pstream_cmd *pstream);
  1626. int ath6kl_wmi_delete_pstream_cmd(struct wmi *wmi, u8 traffic_class, u8 tsid);
  1627. int ath6kl_wmi_set_rts_cmd(struct wmi *wmi, u16 threshold);
  1628. int ath6kl_wmi_set_lpreamble_cmd(struct wmi *wmi, u8 status,
  1629. u8 preamble_policy);
  1630. int ath6kl_wmi_get_challenge_resp_cmd(struct wmi *wmi, u32 cookie, u32 source);
  1631. int ath6kl_wmi_get_stats_cmd(struct wmi *wmi);
  1632. int ath6kl_wmi_addkey_cmd(struct wmi *wmi, u8 key_index,
  1633. enum crypto_type key_type,
  1634. u8 key_usage, u8 key_len,
  1635. u8 *key_rsc, u8 *key_material,
  1636. u8 key_op_ctrl, u8 *mac_addr,
  1637. enum wmi_sync_flag sync_flag);
  1638. int ath6kl_wmi_add_krk_cmd(struct wmi *wmi, u8 *krk);
  1639. int ath6kl_wmi_deletekey_cmd(struct wmi *wmi, u8 key_index);
  1640. int ath6kl_wmi_setpmkid_cmd(struct wmi *wmi, const u8 *bssid,
  1641. const u8 *pmkid, bool set);
  1642. int ath6kl_wmi_set_tx_pwr_cmd(struct wmi *wmi, u8 dbM);
  1643. int ath6kl_wmi_get_tx_pwr_cmd(struct wmi *wmi);
  1644. int ath6kl_wmi_set_wmm_txop(struct wmi *wmi, enum wmi_txop_cfg cfg);
  1645. int ath6kl_wmi_set_keepalive_cmd(struct wmi *wmi, u8 keep_alive_intvl);
  1646. s32 ath6kl_wmi_get_rate(s8 rate_index);
  1647. int ath6kl_wmi_set_ip_cmd(struct wmi *wmi, struct wmi_set_ip_cmd *ip_cmd);
  1648. struct bss *ath6kl_wmi_find_ssid_node(struct wmi *wmi, u8 *ssid,
  1649. u32 ssid_len, bool is_wpa2,
  1650. bool match_ssid);
  1651. void ath6kl_wmi_node_return(struct wmi *wmi, struct bss *bss);
  1652. /* AP mode */
  1653. int ath6kl_wmi_ap_profile_commit(struct wmi *wmip, struct wmi_connect_cmd *p);
  1654. int ath6kl_wmi_set_pvb_cmd(struct wmi *wmi, u16 aid, bool flag);
  1655. int ath6kl_wmi_set_rx_frame_format_cmd(struct wmi *wmi, u8 rx_meta_version,
  1656. bool rx_dot11_hdr, bool defrag_on_host);
  1657. int ath6kl_wmi_set_appie_cmd(struct wmi *wmi, u8 mgmt_frm_type, const u8 *ie,
  1658. u8 ie_len);
  1659. void *ath6kl_wmi_init(struct ath6kl *devt);
  1660. void ath6kl_wmi_shutdown(struct wmi *wmi);
  1661. #endif /* WMI_H */