wmi.h 49 KB

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