wmi.h 60 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731
  1. /*
  2. * Copyright (c) 2010-2011 Atheros Communications Inc.
  3. * Copyright (c) 2011-2012 Qualcomm Atheros, Inc.
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for any
  6. * purpose with or without fee is hereby granted, provided that the above
  7. * copyright notice and this permission notice appear in all copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  10. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  11. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  12. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  13. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  14. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  15. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  16. */
  17. /*
  18. * This file contains the definitions of the WMI protocol specified in the
  19. * Wireless Module Interface (WMI). It includes definitions of all the
  20. * commands and events. Commands are messages from the host to the WM.
  21. * Events and Replies are messages from the WM to the host.
  22. */
  23. #ifndef WMI_H
  24. #define WMI_H
  25. #include <linux/ieee80211.h>
  26. #include "htc.h"
  27. #define HTC_PROTOCOL_VERSION 0x0002
  28. #define WMI_PROTOCOL_VERSION 0x0002
  29. #define WMI_CONTROL_MSG_MAX_LEN 256
  30. #define is_ethertype(type_or_len) ((type_or_len) >= 0x0600)
  31. #define IP_ETHERTYPE 0x0800
  32. #define WMI_IMPLICIT_PSTREAM 0xFF
  33. #define WMI_MAX_THINSTREAM 15
  34. #define SSID_IE_LEN_INDEX 13
  35. /* Host side link management data structures */
  36. #define SIG_QUALITY_THRESH_LVLS 6
  37. #define SIG_QUALITY_UPPER_THRESH_LVLS SIG_QUALITY_THRESH_LVLS
  38. #define SIG_QUALITY_LOWER_THRESH_LVLS SIG_QUALITY_THRESH_LVLS
  39. #define A_BAND_24GHZ 0
  40. #define A_BAND_5GHZ 1
  41. #define ATH6KL_NUM_BANDS 2
  42. /* in ms */
  43. #define WMI_IMPLICIT_PSTREAM_INACTIVITY_INT 5000
  44. /*
  45. * There are no signed versions of __le16 and __le32, so for a temporary
  46. * solution come up with our own version. The idea is from fs/ntfs/types.h.
  47. *
  48. * Use a_ prefix so that it doesn't conflict if we get proper support to
  49. * linux/types.h.
  50. */
  51. typedef __s16 __bitwise a_sle16;
  52. typedef __s32 __bitwise a_sle32;
  53. static inline a_sle32 a_cpu_to_sle32(s32 val)
  54. {
  55. return (__force a_sle32) cpu_to_le32(val);
  56. }
  57. static inline s32 a_sle32_to_cpu(a_sle32 val)
  58. {
  59. return le32_to_cpu((__force __le32) val);
  60. }
  61. static inline a_sle16 a_cpu_to_sle16(s16 val)
  62. {
  63. return (__force a_sle16) cpu_to_le16(val);
  64. }
  65. static inline s16 a_sle16_to_cpu(a_sle16 val)
  66. {
  67. return le16_to_cpu((__force __le16) val);
  68. }
  69. struct sq_threshold_params {
  70. s16 upper_threshold[SIG_QUALITY_UPPER_THRESH_LVLS];
  71. s16 lower_threshold[SIG_QUALITY_LOWER_THRESH_LVLS];
  72. u32 upper_threshold_valid_count;
  73. u32 lower_threshold_valid_count;
  74. u32 polling_interval;
  75. u8 weight;
  76. u8 last_rssi;
  77. u8 last_rssi_poll_event;
  78. };
  79. struct wmi_data_sync_bufs {
  80. u8 traffic_class;
  81. struct sk_buff *skb;
  82. };
  83. /* WMM stream classes */
  84. #define WMM_NUM_AC 4
  85. #define WMM_AC_BE 0 /* best effort */
  86. #define WMM_AC_BK 1 /* background */
  87. #define WMM_AC_VI 2 /* video */
  88. #define WMM_AC_VO 3 /* voice */
  89. #define WMI_VOICE_USER_PRIORITY 0x7
  90. struct wmi {
  91. u16 stream_exist_for_ac[WMM_NUM_AC];
  92. u8 fat_pipe_exist;
  93. struct ath6kl *parent_dev;
  94. u8 pwr_mode;
  95. /* protects fat_pipe_exist and stream_exist_for_ac */
  96. spinlock_t lock;
  97. enum htc_endpoint_id ep_id;
  98. struct sq_threshold_params
  99. sq_threshld[SIGNAL_QUALITY_METRICS_NUM_MAX];
  100. bool is_wmm_enabled;
  101. u8 traffic_class;
  102. bool is_probe_ssid;
  103. u8 *last_mgmt_tx_frame;
  104. size_t last_mgmt_tx_frame_len;
  105. u8 saved_pwr_mode;
  106. };
  107. struct host_app_area {
  108. __le32 wmi_protocol_ver;
  109. } __packed;
  110. enum wmi_msg_type {
  111. DATA_MSGTYPE = 0x0,
  112. CNTL_MSGTYPE,
  113. SYNC_MSGTYPE,
  114. OPT_MSGTYPE,
  115. };
  116. /*
  117. * Macros for operating on WMI_DATA_HDR (info) field
  118. */
  119. #define WMI_DATA_HDR_MSG_TYPE_MASK 0x03
  120. #define WMI_DATA_HDR_MSG_TYPE_SHIFT 0
  121. #define WMI_DATA_HDR_UP_MASK 0x07
  122. #define WMI_DATA_HDR_UP_SHIFT 2
  123. /* In AP mode, the same bit (b5) is used to indicate Power save state in
  124. * the Rx dir and More data bit state in the tx direction.
  125. */
  126. #define WMI_DATA_HDR_PS_MASK 0x1
  127. #define WMI_DATA_HDR_PS_SHIFT 5
  128. #define WMI_DATA_HDR_MORE 0x20
  129. enum wmi_data_hdr_data_type {
  130. WMI_DATA_HDR_DATA_TYPE_802_3 = 0,
  131. WMI_DATA_HDR_DATA_TYPE_802_11,
  132. /* used to be used for the PAL */
  133. WMI_DATA_HDR_DATA_TYPE_ACL,
  134. };
  135. /* Bitmap of data header flags */
  136. enum wmi_data_hdr_flags {
  137. WMI_DATA_HDR_FLAGS_MORE = 0x1,
  138. WMI_DATA_HDR_FLAGS_EOSP = 0x2,
  139. WMI_DATA_HDR_FLAGS_UAPSD = 0x4,
  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. #define WMI_DATA_HDR_PAD_BEFORE_DATA_MASK 0xFF
  151. #define WMI_DATA_HDR_PAD_BEFORE_DATA_SHIFT 0x8
  152. /* Macros for operating on WMI_DATA_HDR (info3) field */
  153. #define WMI_DATA_HDR_IF_IDX_MASK 0xF
  154. #define WMI_DATA_HDR_TRIG 0x10
  155. #define WMI_DATA_HDR_EOSP 0x10
  156. struct wmi_data_hdr {
  157. s8 rssi;
  158. /*
  159. * usage of 'info' field(8-bit):
  160. *
  161. * b1:b0 - WMI_MSG_TYPE
  162. * b4:b3:b2 - UP(tid)
  163. * b5 - Used in AP mode.
  164. * More-data in tx dir, PS in rx.
  165. * b7:b6 - Dot3 header(0),
  166. * Dot11 Header(1),
  167. * ACL data(2)
  168. */
  169. u8 info;
  170. /*
  171. * usage of 'info2' field(16-bit):
  172. *
  173. * b11:b0 - seq_no
  174. * b12 - A-MSDU?
  175. * b15:b13 - META_DATA_VERSION 0 - 7
  176. */
  177. __le16 info2;
  178. /*
  179. * usage of info3, 16-bit:
  180. * b3:b0 - Interface index
  181. * b4 - uAPSD trigger in rx & EOSP in tx
  182. * b15:b5 - Reserved
  183. */
  184. __le16 info3;
  185. } __packed;
  186. static inline u8 wmi_data_hdr_get_up(struct wmi_data_hdr *dhdr)
  187. {
  188. return (dhdr->info >> WMI_DATA_HDR_UP_SHIFT) & WMI_DATA_HDR_UP_MASK;
  189. }
  190. static inline void wmi_data_hdr_set_up(struct wmi_data_hdr *dhdr,
  191. u8 usr_pri)
  192. {
  193. dhdr->info &= ~(WMI_DATA_HDR_UP_MASK << WMI_DATA_HDR_UP_SHIFT);
  194. dhdr->info |= usr_pri << WMI_DATA_HDR_UP_SHIFT;
  195. }
  196. static inline u8 wmi_data_hdr_get_dot11(struct wmi_data_hdr *dhdr)
  197. {
  198. u8 data_type;
  199. data_type = (dhdr->info >> WMI_DATA_HDR_DATA_TYPE_SHIFT) &
  200. WMI_DATA_HDR_DATA_TYPE_MASK;
  201. return (data_type == WMI_DATA_HDR_DATA_TYPE_802_11);
  202. }
  203. static inline u16 wmi_data_hdr_get_seqno(struct wmi_data_hdr *dhdr)
  204. {
  205. return (le16_to_cpu(dhdr->info2) >> WMI_DATA_HDR_SEQNO_SHIFT) &
  206. WMI_DATA_HDR_SEQNO_MASK;
  207. }
  208. static inline u8 wmi_data_hdr_is_amsdu(struct wmi_data_hdr *dhdr)
  209. {
  210. return (le16_to_cpu(dhdr->info2) >> WMI_DATA_HDR_AMSDU_SHIFT) &
  211. WMI_DATA_HDR_AMSDU_MASK;
  212. }
  213. static inline u8 wmi_data_hdr_get_meta(struct wmi_data_hdr *dhdr)
  214. {
  215. return (le16_to_cpu(dhdr->info2) >> WMI_DATA_HDR_META_SHIFT) &
  216. WMI_DATA_HDR_META_MASK;
  217. }
  218. static inline u8 wmi_data_hdr_get_if_idx(struct wmi_data_hdr *dhdr)
  219. {
  220. return le16_to_cpu(dhdr->info3) & WMI_DATA_HDR_IF_IDX_MASK;
  221. }
  222. /* Tx meta version definitions */
  223. #define WMI_MAX_TX_META_SZ 12
  224. #define WMI_META_VERSION_1 0x01
  225. #define WMI_META_VERSION_2 0x02
  226. /* Flag to signal to FW to calculate TCP checksum */
  227. #define WMI_META_V2_FLAG_CSUM_OFFLOAD 0x01
  228. struct wmi_tx_meta_v1 {
  229. /* packet ID to identify the tx request */
  230. u8 pkt_id;
  231. /* rate policy to be used for the tx of this frame */
  232. u8 rate_plcy_id;
  233. } __packed;
  234. struct wmi_tx_meta_v2 {
  235. /*
  236. * Offset from start of the WMI header for csum calculation to
  237. * begin.
  238. */
  239. u8 csum_start;
  240. /* offset from start of WMI header where final csum goes */
  241. u8 csum_dest;
  242. /* no of bytes over which csum is calculated */
  243. u8 csum_flags;
  244. } __packed;
  245. struct wmi_rx_meta_v1 {
  246. u8 status;
  247. /* rate index mapped to rate at which this packet was received. */
  248. u8 rix;
  249. /* rssi of packet */
  250. u8 rssi;
  251. /* rf channel during packet reception */
  252. u8 channel;
  253. __le16 flags;
  254. } __packed;
  255. struct wmi_rx_meta_v2 {
  256. __le16 csum;
  257. /* bit 0 set -partial csum valid bit 1 set -test mode */
  258. u8 csum_flags;
  259. } __packed;
  260. #define WMI_CMD_HDR_IF_ID_MASK 0xF
  261. /* Control Path */
  262. struct wmi_cmd_hdr {
  263. __le16 cmd_id;
  264. /* info1 - 16 bits
  265. * b03:b00 - id
  266. * b15:b04 - unused */
  267. __le16 info1;
  268. /* for alignment */
  269. __le16 reserved;
  270. } __packed;
  271. static inline u8 wmi_cmd_hdr_get_if_idx(struct wmi_cmd_hdr *chdr)
  272. {
  273. return le16_to_cpu(chdr->info1) & WMI_CMD_HDR_IF_ID_MASK;
  274. }
  275. /* List of WMI commands */
  276. enum wmi_cmd_id {
  277. WMI_CONNECT_CMDID = 0x0001,
  278. WMI_RECONNECT_CMDID,
  279. WMI_DISCONNECT_CMDID,
  280. WMI_SYNCHRONIZE_CMDID,
  281. WMI_CREATE_PSTREAM_CMDID,
  282. WMI_DELETE_PSTREAM_CMDID,
  283. /* WMI_START_SCAN_CMDID is to be deprecated. Use
  284. * WMI_BEGIN_SCAN_CMDID instead. The new cmd supports P2P mgmt
  285. * operations using station interface.
  286. */
  287. WMI_START_SCAN_CMDID,
  288. WMI_SET_SCAN_PARAMS_CMDID,
  289. WMI_SET_BSS_FILTER_CMDID,
  290. WMI_SET_PROBED_SSID_CMDID, /* 10 */
  291. WMI_SET_LISTEN_INT_CMDID,
  292. WMI_SET_BMISS_TIME_CMDID,
  293. WMI_SET_DISC_TIMEOUT_CMDID,
  294. WMI_GET_CHANNEL_LIST_CMDID,
  295. WMI_SET_BEACON_INT_CMDID,
  296. WMI_GET_STATISTICS_CMDID,
  297. WMI_SET_CHANNEL_PARAMS_CMDID,
  298. WMI_SET_POWER_MODE_CMDID,
  299. WMI_SET_IBSS_PM_CAPS_CMDID,
  300. WMI_SET_POWER_PARAMS_CMDID, /* 20 */
  301. WMI_SET_POWERSAVE_TIMERS_POLICY_CMDID,
  302. WMI_ADD_CIPHER_KEY_CMDID,
  303. WMI_DELETE_CIPHER_KEY_CMDID,
  304. WMI_ADD_KRK_CMDID,
  305. WMI_DELETE_KRK_CMDID,
  306. WMI_SET_PMKID_CMDID,
  307. WMI_SET_TX_PWR_CMDID,
  308. WMI_GET_TX_PWR_CMDID,
  309. WMI_SET_ASSOC_INFO_CMDID,
  310. WMI_ADD_BAD_AP_CMDID, /* 30 */
  311. WMI_DELETE_BAD_AP_CMDID,
  312. WMI_SET_TKIP_COUNTERMEASURES_CMDID,
  313. WMI_RSSI_THRESHOLD_PARAMS_CMDID,
  314. WMI_TARGET_ERROR_REPORT_BITMASK_CMDID,
  315. WMI_SET_ACCESS_PARAMS_CMDID,
  316. WMI_SET_RETRY_LIMITS_CMDID,
  317. WMI_SET_OPT_MODE_CMDID,
  318. WMI_OPT_TX_FRAME_CMDID,
  319. WMI_SET_VOICE_PKT_SIZE_CMDID,
  320. WMI_SET_MAX_SP_LEN_CMDID, /* 40 */
  321. WMI_SET_ROAM_CTRL_CMDID,
  322. WMI_GET_ROAM_TBL_CMDID,
  323. WMI_GET_ROAM_DATA_CMDID,
  324. WMI_ENABLE_RM_CMDID,
  325. WMI_SET_MAX_OFFHOME_DURATION_CMDID,
  326. WMI_EXTENSION_CMDID, /* Non-wireless extensions */
  327. WMI_SNR_THRESHOLD_PARAMS_CMDID,
  328. WMI_LQ_THRESHOLD_PARAMS_CMDID,
  329. WMI_SET_LPREAMBLE_CMDID,
  330. WMI_SET_RTS_CMDID, /* 50 */
  331. WMI_CLR_RSSI_SNR_CMDID,
  332. WMI_SET_FIXRATES_CMDID,
  333. WMI_GET_FIXRATES_CMDID,
  334. WMI_SET_AUTH_MODE_CMDID,
  335. WMI_SET_REASSOC_MODE_CMDID,
  336. WMI_SET_WMM_CMDID,
  337. WMI_SET_WMM_TXOP_CMDID,
  338. WMI_TEST_CMDID,
  339. /* COEX AR6002 only */
  340. WMI_SET_BT_STATUS_CMDID,
  341. WMI_SET_BT_PARAMS_CMDID, /* 60 */
  342. WMI_SET_KEEPALIVE_CMDID,
  343. WMI_GET_KEEPALIVE_CMDID,
  344. WMI_SET_APPIE_CMDID,
  345. WMI_GET_APPIE_CMDID,
  346. WMI_SET_WSC_STATUS_CMDID,
  347. /* Wake on Wireless */
  348. WMI_SET_HOST_SLEEP_MODE_CMDID,
  349. WMI_SET_WOW_MODE_CMDID,
  350. WMI_GET_WOW_LIST_CMDID,
  351. WMI_ADD_WOW_PATTERN_CMDID,
  352. WMI_DEL_WOW_PATTERN_CMDID, /* 70 */
  353. WMI_SET_FRAMERATES_CMDID,
  354. WMI_SET_AP_PS_CMDID,
  355. WMI_SET_QOS_SUPP_CMDID,
  356. WMI_SET_IE_CMDID,
  357. /* WMI_THIN_RESERVED_... mark the start and end
  358. * values for WMI_THIN_RESERVED command IDs. These
  359. * command IDs can be found in wmi_thin.h */
  360. WMI_THIN_RESERVED_START = 0x8000,
  361. WMI_THIN_RESERVED_END = 0x8fff,
  362. /* Developer commands starts at 0xF000 */
  363. WMI_SET_BITRATE_CMDID = 0xF000,
  364. WMI_GET_BITRATE_CMDID,
  365. WMI_SET_WHALPARAM_CMDID,
  366. WMI_SET_MAC_ADDRESS_CMDID,
  367. WMI_SET_AKMP_PARAMS_CMDID,
  368. WMI_SET_PMKID_LIST_CMDID,
  369. WMI_GET_PMKID_LIST_CMDID,
  370. WMI_ABORT_SCAN_CMDID,
  371. WMI_SET_TARGET_EVENT_REPORT_CMDID,
  372. /* Unused */
  373. WMI_UNUSED1,
  374. WMI_UNUSED2,
  375. /* AP mode commands */
  376. WMI_AP_HIDDEN_SSID_CMDID,
  377. WMI_AP_SET_NUM_STA_CMDID,
  378. WMI_AP_ACL_POLICY_CMDID,
  379. WMI_AP_ACL_MAC_LIST_CMDID,
  380. WMI_AP_CONFIG_COMMIT_CMDID,
  381. WMI_AP_SET_MLME_CMDID,
  382. WMI_AP_SET_PVB_CMDID,
  383. WMI_AP_CONN_INACT_CMDID,
  384. WMI_AP_PROT_SCAN_TIME_CMDID,
  385. WMI_AP_SET_COUNTRY_CMDID,
  386. WMI_AP_SET_DTIM_CMDID,
  387. WMI_AP_MODE_STAT_CMDID,
  388. WMI_SET_IP_CMDID,
  389. WMI_SET_PARAMS_CMDID,
  390. WMI_SET_MCAST_FILTER_CMDID,
  391. WMI_DEL_MCAST_FILTER_CMDID,
  392. WMI_ALLOW_AGGR_CMDID,
  393. WMI_ADDBA_REQ_CMDID,
  394. WMI_DELBA_REQ_CMDID,
  395. WMI_SET_HT_CAP_CMDID,
  396. WMI_SET_HT_OP_CMDID,
  397. WMI_SET_TX_SELECT_RATES_CMDID,
  398. WMI_SET_TX_SGI_PARAM_CMDID,
  399. WMI_SET_RATE_POLICY_CMDID,
  400. WMI_HCI_CMD_CMDID,
  401. WMI_RX_FRAME_FORMAT_CMDID,
  402. WMI_SET_THIN_MODE_CMDID,
  403. WMI_SET_BT_WLAN_CONN_PRECEDENCE_CMDID,
  404. WMI_AP_SET_11BG_RATESET_CMDID,
  405. WMI_SET_PMK_CMDID,
  406. WMI_MCAST_FILTER_CMDID,
  407. /* COEX CMDID AR6003 */
  408. WMI_SET_BTCOEX_FE_ANT_CMDID,
  409. WMI_SET_BTCOEX_COLOCATED_BT_DEV_CMDID,
  410. WMI_SET_BTCOEX_SCO_CONFIG_CMDID,
  411. WMI_SET_BTCOEX_A2DP_CONFIG_CMDID,
  412. WMI_SET_BTCOEX_ACLCOEX_CONFIG_CMDID,
  413. WMI_SET_BTCOEX_BTINQUIRY_PAGE_CONFIG_CMDID,
  414. WMI_SET_BTCOEX_DEBUG_CMDID,
  415. WMI_SET_BTCOEX_BT_OPERATING_STATUS_CMDID,
  416. WMI_GET_BTCOEX_STATS_CMDID,
  417. WMI_GET_BTCOEX_CONFIG_CMDID,
  418. WMI_SET_DFS_ENABLE_CMDID, /* F034 */
  419. WMI_SET_DFS_MINRSSITHRESH_CMDID,
  420. WMI_SET_DFS_MAXPULSEDUR_CMDID,
  421. WMI_DFS_RADAR_DETECTED_CMDID,
  422. /* P2P commands */
  423. WMI_P2P_SET_CONFIG_CMDID, /* F038 */
  424. WMI_WPS_SET_CONFIG_CMDID,
  425. WMI_SET_REQ_DEV_ATTR_CMDID,
  426. WMI_P2P_FIND_CMDID,
  427. WMI_P2P_STOP_FIND_CMDID,
  428. WMI_P2P_GO_NEG_START_CMDID,
  429. WMI_P2P_LISTEN_CMDID,
  430. WMI_CONFIG_TX_MAC_RULES_CMDID, /* F040 */
  431. WMI_SET_PROMISCUOUS_MODE_CMDID,
  432. WMI_RX_FRAME_FILTER_CMDID,
  433. WMI_SET_CHANNEL_CMDID,
  434. /* WAC commands */
  435. WMI_ENABLE_WAC_CMDID,
  436. WMI_WAC_SCAN_REPLY_CMDID,
  437. WMI_WAC_CTRL_REQ_CMDID,
  438. WMI_SET_DIV_PARAMS_CMDID,
  439. WMI_GET_PMK_CMDID,
  440. WMI_SET_PASSPHRASE_CMDID,
  441. WMI_SEND_ASSOC_RES_CMDID,
  442. WMI_SET_ASSOC_REQ_RELAY_CMDID,
  443. /* ACS command, consists of sub-commands */
  444. WMI_ACS_CTRL_CMDID,
  445. WMI_SET_EXCESS_TX_RETRY_THRES_CMDID,
  446. WMI_SET_TBD_TIME_CMDID, /*added for wmiconfig command for TBD */
  447. /* Pktlog cmds */
  448. WMI_PKTLOG_ENABLE_CMDID,
  449. WMI_PKTLOG_DISABLE_CMDID,
  450. /* More P2P Cmds */
  451. WMI_P2P_GO_NEG_REQ_RSP_CMDID,
  452. WMI_P2P_GRP_INIT_CMDID,
  453. WMI_P2P_GRP_FORMATION_DONE_CMDID,
  454. WMI_P2P_INVITE_CMDID,
  455. WMI_P2P_INVITE_REQ_RSP_CMDID,
  456. WMI_P2P_PROV_DISC_REQ_CMDID,
  457. WMI_P2P_SET_CMDID,
  458. WMI_GET_RFKILL_MODE_CMDID,
  459. WMI_SET_RFKILL_MODE_CMDID,
  460. WMI_AP_SET_APSD_CMDID,
  461. WMI_AP_APSD_BUFFERED_TRAFFIC_CMDID,
  462. WMI_P2P_SDPD_TX_CMDID, /* F05C */
  463. WMI_P2P_STOP_SDPD_CMDID,
  464. WMI_P2P_CANCEL_CMDID,
  465. /* Ultra low power store / recall commands */
  466. WMI_STORERECALL_CONFIGURE_CMDID,
  467. WMI_STORERECALL_RECALL_CMDID,
  468. WMI_STORERECALL_HOST_READY_CMDID,
  469. WMI_FORCE_TARGET_ASSERT_CMDID,
  470. WMI_SET_PROBED_SSID_EX_CMDID,
  471. WMI_SET_NETWORK_LIST_OFFLOAD_CMDID,
  472. WMI_SET_ARP_NS_OFFLOAD_CMDID,
  473. WMI_ADD_WOW_EXT_PATTERN_CMDID,
  474. WMI_GTK_OFFLOAD_OP_CMDID,
  475. WMI_REMAIN_ON_CHNL_CMDID,
  476. WMI_CANCEL_REMAIN_ON_CHNL_CMDID,
  477. /* WMI_SEND_ACTION_CMDID is to be deprecated. Use
  478. * WMI_SEND_MGMT_CMDID instead. The new cmd supports P2P mgmt
  479. * operations using station interface.
  480. */
  481. WMI_SEND_ACTION_CMDID,
  482. WMI_PROBE_REQ_REPORT_CMDID,
  483. WMI_DISABLE_11B_RATES_CMDID,
  484. WMI_SEND_PROBE_RESPONSE_CMDID,
  485. WMI_GET_P2P_INFO_CMDID,
  486. WMI_AP_JOIN_BSS_CMDID,
  487. WMI_SMPS_ENABLE_CMDID,
  488. WMI_SMPS_CONFIG_CMDID,
  489. WMI_SET_RATECTRL_PARM_CMDID,
  490. /* LPL specific commands*/
  491. WMI_LPL_FORCE_ENABLE_CMDID,
  492. WMI_LPL_SET_POLICY_CMDID,
  493. WMI_LPL_GET_POLICY_CMDID,
  494. WMI_LPL_GET_HWSTATE_CMDID,
  495. WMI_LPL_SET_PARAMS_CMDID,
  496. WMI_LPL_GET_PARAMS_CMDID,
  497. WMI_SET_BUNDLE_PARAM_CMDID,
  498. /*GreenTx specific commands*/
  499. WMI_GREENTX_PARAMS_CMDID,
  500. WMI_RTT_MEASREQ_CMDID,
  501. WMI_RTT_CAPREQ_CMDID,
  502. WMI_RTT_STATUSREQ_CMDID,
  503. /* WPS Commands */
  504. WMI_WPS_START_CMDID,
  505. WMI_GET_WPS_STATUS_CMDID,
  506. /* More P2P commands */
  507. WMI_SET_NOA_CMDID,
  508. WMI_GET_NOA_CMDID,
  509. WMI_SET_OPPPS_CMDID,
  510. WMI_GET_OPPPS_CMDID,
  511. WMI_ADD_PORT_CMDID,
  512. WMI_DEL_PORT_CMDID,
  513. /* 802.11w cmd */
  514. WMI_SET_RSN_CAP_CMDID,
  515. WMI_GET_RSN_CAP_CMDID,
  516. WMI_SET_IGTK_CMDID,
  517. WMI_RX_FILTER_COALESCE_FILTER_OP_CMDID,
  518. WMI_RX_FILTER_SET_FRAME_TEST_LIST_CMDID,
  519. WMI_SEND_MGMT_CMDID,
  520. WMI_BEGIN_SCAN_CMDID,
  521. WMI_SET_BLACK_LIST,
  522. WMI_SET_MCASTRATE,
  523. WMI_STA_BMISS_ENHANCE_CMDID,
  524. WMI_SET_REGDOMAIN_CMDID,
  525. WMI_SET_RSSI_FILTER_CMDID,
  526. WMI_SET_KEEP_ALIVE_EXT,
  527. WMI_VOICE_DETECTION_ENABLE_CMDID,
  528. WMI_SET_TXE_NOTIFY_CMDID,
  529. WMI_SET_RECOVERY_TEST_PARAMETER_CMDID, /*0xf094*/
  530. WMI_ENABLE_SCHED_SCAN_CMDID,
  531. };
  532. enum wmi_mgmt_frame_type {
  533. WMI_FRAME_BEACON = 0,
  534. WMI_FRAME_PROBE_REQ,
  535. WMI_FRAME_PROBE_RESP,
  536. WMI_FRAME_ASSOC_REQ,
  537. WMI_FRAME_ASSOC_RESP,
  538. WMI_NUM_MGMT_FRAME
  539. };
  540. enum wmi_ie_field_type {
  541. WMI_RSN_IE_CAPB = 0x1,
  542. WMI_IE_FULL = 0xFF, /* indicats full IE */
  543. };
  544. /* WMI_CONNECT_CMDID */
  545. enum network_type {
  546. INFRA_NETWORK = 0x01,
  547. ADHOC_NETWORK = 0x02,
  548. ADHOC_CREATOR = 0x04,
  549. AP_NETWORK = 0x10,
  550. };
  551. enum network_subtype {
  552. SUBTYPE_NONE,
  553. SUBTYPE_BT,
  554. SUBTYPE_P2PDEV,
  555. SUBTYPE_P2PCLIENT,
  556. SUBTYPE_P2PGO,
  557. };
  558. enum dot11_auth_mode {
  559. OPEN_AUTH = 0x01,
  560. SHARED_AUTH = 0x02,
  561. /* different from IEEE_AUTH_MODE definitions */
  562. LEAP_AUTH = 0x04,
  563. };
  564. enum auth_mode {
  565. NONE_AUTH = 0x01,
  566. WPA_AUTH = 0x02,
  567. WPA2_AUTH = 0x04,
  568. WPA_PSK_AUTH = 0x08,
  569. WPA2_PSK_AUTH = 0x10,
  570. WPA_AUTH_CCKM = 0x20,
  571. WPA2_AUTH_CCKM = 0x40,
  572. };
  573. #define WMI_MAX_KEY_INDEX 3
  574. #define WMI_MAX_KEY_LEN 32
  575. /*
  576. * NB: these values are ordered carefully; there are lots of
  577. * implications in any reordering. In particular beware
  578. * that 4 is not used to avoid conflicting with IEEE80211_F_PRIVACY.
  579. */
  580. #define ATH6KL_CIPHER_WEP 0
  581. #define ATH6KL_CIPHER_TKIP 1
  582. #define ATH6KL_CIPHER_AES_OCB 2
  583. #define ATH6KL_CIPHER_AES_CCM 3
  584. #define ATH6KL_CIPHER_CKIP 5
  585. #define ATH6KL_CIPHER_CCKM_KRK 6
  586. #define ATH6KL_CIPHER_NONE 7 /* pseudo value */
  587. /*
  588. * 802.11 rate set.
  589. */
  590. #define ATH6KL_RATE_MAXSIZE 15 /* max rates we'll handle */
  591. #define ATH_OUI_TYPE 0x01
  592. #define WPA_OUI_TYPE 0x01
  593. #define WMM_PARAM_OUI_SUBTYPE 0x01
  594. #define WMM_OUI_TYPE 0x02
  595. #define WSC_OUT_TYPE 0x04
  596. enum wmi_connect_ctrl_flags_bits {
  597. CONNECT_ASSOC_POLICY_USER = 0x0001,
  598. CONNECT_SEND_REASSOC = 0x0002,
  599. CONNECT_IGNORE_WPAx_GROUP_CIPHER = 0x0004,
  600. CONNECT_PROFILE_MATCH_DONE = 0x0008,
  601. CONNECT_IGNORE_AAC_BEACON = 0x0010,
  602. CONNECT_CSA_FOLLOW_BSS = 0x0020,
  603. CONNECT_DO_WPA_OFFLOAD = 0x0040,
  604. CONNECT_DO_NOT_DEAUTH = 0x0080,
  605. CONNECT_WPS_FLAG = 0x0100,
  606. };
  607. struct wmi_connect_cmd {
  608. u8 nw_type;
  609. u8 dot11_auth_mode;
  610. u8 auth_mode;
  611. u8 prwise_crypto_type;
  612. u8 prwise_crypto_len;
  613. u8 grp_crypto_type;
  614. u8 grp_crypto_len;
  615. u8 ssid_len;
  616. u8 ssid[IEEE80211_MAX_SSID_LEN];
  617. __le16 ch;
  618. u8 bssid[ETH_ALEN];
  619. __le32 ctrl_flags;
  620. u8 nw_subtype;
  621. } __packed;
  622. /* WMI_RECONNECT_CMDID */
  623. struct wmi_reconnect_cmd {
  624. /* channel hint */
  625. __le16 channel;
  626. /* mandatory if set */
  627. u8 bssid[ETH_ALEN];
  628. } __packed;
  629. /* WMI_ADD_CIPHER_KEY_CMDID */
  630. enum key_usage {
  631. PAIRWISE_USAGE = 0x00,
  632. GROUP_USAGE = 0x01,
  633. /* default Tx Key - static WEP only */
  634. TX_USAGE = 0x02,
  635. };
  636. /*
  637. * Bit Flag
  638. * Bit 0 - Initialise TSC - default is Initialize
  639. */
  640. #define KEY_OP_INIT_TSC 0x01
  641. #define KEY_OP_INIT_RSC 0x02
  642. /* default initialise the TSC & RSC */
  643. #define KEY_OP_INIT_VAL 0x03
  644. #define KEY_OP_VALID_MASK 0x03
  645. struct wmi_add_cipher_key_cmd {
  646. u8 key_index;
  647. u8 key_type;
  648. /* enum key_usage */
  649. u8 key_usage;
  650. u8 key_len;
  651. /* key replay sequence counter */
  652. u8 key_rsc[8];
  653. u8 key[WLAN_MAX_KEY_LEN];
  654. /* additional key control info */
  655. u8 key_op_ctrl;
  656. u8 key_mac_addr[ETH_ALEN];
  657. } __packed;
  658. /* WMI_DELETE_CIPHER_KEY_CMDID */
  659. struct wmi_delete_cipher_key_cmd {
  660. u8 key_index;
  661. } __packed;
  662. #define WMI_KRK_LEN 16
  663. /* WMI_ADD_KRK_CMDID */
  664. struct wmi_add_krk_cmd {
  665. u8 krk[WMI_KRK_LEN];
  666. } __packed;
  667. /* WMI_SETPMKID_CMDID */
  668. #define WMI_PMKID_LEN 16
  669. enum pmkid_enable_flg {
  670. PMKID_DISABLE = 0,
  671. PMKID_ENABLE = 1,
  672. };
  673. struct wmi_setpmkid_cmd {
  674. u8 bssid[ETH_ALEN];
  675. /* enum pmkid_enable_flg */
  676. u8 enable;
  677. u8 pmkid[WMI_PMKID_LEN];
  678. } __packed;
  679. /* WMI_START_SCAN_CMD */
  680. enum wmi_scan_type {
  681. WMI_LONG_SCAN = 0,
  682. WMI_SHORT_SCAN = 1,
  683. };
  684. struct wmi_supp_rates {
  685. u8 nrates;
  686. u8 rates[ATH6KL_RATE_MAXSIZE];
  687. };
  688. struct wmi_begin_scan_cmd {
  689. __le32 force_fg_scan;
  690. /* for legacy cisco AP compatibility */
  691. __le32 is_legacy;
  692. /* max duration in the home channel(msec) */
  693. __le32 home_dwell_time;
  694. /* time interval between scans (msec) */
  695. __le32 force_scan_intvl;
  696. /* no CCK rates */
  697. __le32 no_cck;
  698. /* enum wmi_scan_type */
  699. u8 scan_type;
  700. /* Supported rates to advertise in the probe request frames */
  701. struct wmi_supp_rates supp_rates[ATH6KL_NUM_BANDS];
  702. /* how many channels follow */
  703. u8 num_ch;
  704. /* channels in Mhz */
  705. __le16 ch_list[];
  706. } __packed;
  707. /* wmi_start_scan_cmd is to be deprecated. Use
  708. * wmi_begin_scan_cmd instead. The new structure supports P2P mgmt
  709. * operations using station interface.
  710. */
  711. struct wmi_start_scan_cmd {
  712. __le32 force_fg_scan;
  713. /* for legacy cisco AP compatibility */
  714. __le32 is_legacy;
  715. /* max duration in the home channel(msec) */
  716. __le32 home_dwell_time;
  717. /* time interval between scans (msec) */
  718. __le32 force_scan_intvl;
  719. /* enum wmi_scan_type */
  720. u8 scan_type;
  721. /* how many channels follow */
  722. u8 num_ch;
  723. /* channels in Mhz */
  724. __le16 ch_list[];
  725. } __packed;
  726. /*
  727. * Warning: scan control flag value of 0xFF is used to disable
  728. * all flags in WMI_SCAN_PARAMS_CMD. Do not add any more
  729. * flags here
  730. */
  731. enum wmi_scan_ctrl_flags_bits {
  732. /* set if can scan in the connect cmd */
  733. CONNECT_SCAN_CTRL_FLAGS = 0x01,
  734. /* set if scan for the SSID it is already connected to */
  735. SCAN_CONNECTED_CTRL_FLAGS = 0x02,
  736. /* set if enable active scan */
  737. ACTIVE_SCAN_CTRL_FLAGS = 0x04,
  738. /* set if enable roam scan when bmiss and lowrssi */
  739. ROAM_SCAN_CTRL_FLAGS = 0x08,
  740. /* set if follows customer BSSINFO reporting rule */
  741. REPORT_BSSINFO_CTRL_FLAGS = 0x10,
  742. /* if disabled, target doesn't scan after a disconnect event */
  743. ENABLE_AUTO_CTRL_FLAGS = 0x20,
  744. /*
  745. * Scan complete event with canceled status will be generated when
  746. * a scan is prempted before it gets completed.
  747. */
  748. ENABLE_SCAN_ABORT_EVENT = 0x40
  749. };
  750. struct wmi_scan_params_cmd {
  751. /* sec */
  752. __le16 fg_start_period;
  753. /* sec */
  754. __le16 fg_end_period;
  755. /* sec */
  756. __le16 bg_period;
  757. /* msec */
  758. __le16 maxact_chdwell_time;
  759. /* msec */
  760. __le16 pas_chdwell_time;
  761. /* how many shorts scan for one long */
  762. u8 short_scan_ratio;
  763. u8 scan_ctrl_flags;
  764. /* msec */
  765. __le16 minact_chdwell_time;
  766. /* max active scans per ssid */
  767. __le16 maxact_scan_per_ssid;
  768. /* msecs */
  769. __le32 max_dfsch_act_time;
  770. } __packed;
  771. /* WMI_ENABLE_SCHED_SCAN_CMDID */
  772. struct wmi_enable_sched_scan_cmd {
  773. u8 enable;
  774. } __packed;
  775. /* WMI_SET_BSS_FILTER_CMDID */
  776. enum wmi_bss_filter {
  777. /* no beacons forwarded */
  778. NONE_BSS_FILTER = 0x0,
  779. /* all beacons forwarded */
  780. ALL_BSS_FILTER,
  781. /* only beacons matching profile */
  782. PROFILE_FILTER,
  783. /* all but beacons matching profile */
  784. ALL_BUT_PROFILE_FILTER,
  785. /* only beacons matching current BSS */
  786. CURRENT_BSS_FILTER,
  787. /* all but beacons matching BSS */
  788. ALL_BUT_BSS_FILTER,
  789. /* beacons matching probed ssid */
  790. PROBED_SSID_FILTER,
  791. /* beacons matching matched ssid */
  792. MATCHED_SSID_FILTER,
  793. /* marker only */
  794. LAST_BSS_FILTER,
  795. };
  796. struct wmi_bss_filter_cmd {
  797. /* see, enum wmi_bss_filter */
  798. u8 bss_filter;
  799. /* for alignment */
  800. u8 reserved1;
  801. /* for alignment */
  802. __le16 reserved2;
  803. __le32 ie_mask;
  804. } __packed;
  805. /* WMI_SET_PROBED_SSID_CMDID */
  806. #define MAX_PROBED_SSIDS 16
  807. enum wmi_ssid_flag {
  808. /* disables entry */
  809. DISABLE_SSID_FLAG = 0,
  810. /* probes specified ssid */
  811. SPECIFIC_SSID_FLAG = 0x01,
  812. /* probes for any ssid */
  813. ANY_SSID_FLAG = 0x02,
  814. /* match for ssid */
  815. MATCH_SSID_FLAG = 0x08,
  816. };
  817. struct wmi_probed_ssid_cmd {
  818. /* 0 to MAX_PROBED_SSIDS - 1 */
  819. u8 entry_index;
  820. /* see, enum wmi_ssid_flg */
  821. u8 flag;
  822. u8 ssid_len;
  823. u8 ssid[IEEE80211_MAX_SSID_LEN];
  824. } __packed;
  825. /*
  826. * WMI_SET_LISTEN_INT_CMDID
  827. * The Listen interval is between 15 and 3000 TUs
  828. */
  829. struct wmi_listen_int_cmd {
  830. __le16 listen_intvl;
  831. __le16 num_beacons;
  832. } __packed;
  833. /* WMI_SET_BMISS_TIME_CMDID */
  834. struct wmi_bmiss_time_cmd {
  835. __le16 bmiss_time;
  836. __le16 num_beacons;
  837. };
  838. /* WMI_STA_ENHANCE_BMISS_CMDID */
  839. struct wmi_sta_bmiss_enhance_cmd {
  840. u8 enable;
  841. } __packed;
  842. struct wmi_set_regdomain_cmd {
  843. u8 length;
  844. u8 iso_name[2];
  845. } __packed;
  846. /* WMI_SET_POWER_MODE_CMDID */
  847. enum wmi_power_mode {
  848. REC_POWER = 0x01,
  849. MAX_PERF_POWER,
  850. };
  851. struct wmi_power_mode_cmd {
  852. /* see, enum wmi_power_mode */
  853. u8 pwr_mode;
  854. } __packed;
  855. /*
  856. * Policy to determine whether power save failure event should be sent to
  857. * host during scanning
  858. */
  859. enum power_save_fail_event_policy {
  860. SEND_POWER_SAVE_FAIL_EVENT_ALWAYS = 1,
  861. IGNORE_PS_FAIL_DURING_SCAN = 2,
  862. };
  863. struct wmi_power_params_cmd {
  864. /* msec */
  865. __le16 idle_period;
  866. __le16 pspoll_number;
  867. __le16 dtim_policy;
  868. __le16 tx_wakeup_policy;
  869. __le16 num_tx_to_wakeup;
  870. __le16 ps_fail_event_policy;
  871. } __packed;
  872. /*
  873. * Ratemask for below modes should be passed
  874. * to WMI_SET_TX_SELECT_RATES_CMDID.
  875. * AR6003 has 32 bit mask for each modes.
  876. * First 12 bits for legacy rates, 13 to 20
  877. * bits for HT 20 rates and 21 to 28 bits for
  878. * HT 40 rates
  879. */
  880. enum wmi_mode_phy {
  881. WMI_RATES_MODE_11A = 0,
  882. WMI_RATES_MODE_11G,
  883. WMI_RATES_MODE_11B,
  884. WMI_RATES_MODE_11GONLY,
  885. WMI_RATES_MODE_11A_HT20,
  886. WMI_RATES_MODE_11G_HT20,
  887. WMI_RATES_MODE_11A_HT40,
  888. WMI_RATES_MODE_11G_HT40,
  889. WMI_RATES_MODE_MAX
  890. };
  891. /* WMI_SET_TX_SELECT_RATES_CMDID */
  892. struct wmi_set_tx_select_rates32_cmd {
  893. __le32 ratemask[WMI_RATES_MODE_MAX];
  894. } __packed;
  895. /* WMI_SET_TX_SELECT_RATES_CMDID */
  896. struct wmi_set_tx_select_rates64_cmd {
  897. __le64 ratemask[WMI_RATES_MODE_MAX];
  898. } __packed;
  899. /* WMI_SET_DISC_TIMEOUT_CMDID */
  900. struct wmi_disc_timeout_cmd {
  901. /* seconds */
  902. u8 discon_timeout;
  903. } __packed;
  904. enum dir_type {
  905. UPLINK_TRAFFIC = 0,
  906. DNLINK_TRAFFIC = 1,
  907. BIDIR_TRAFFIC = 2,
  908. };
  909. enum voiceps_cap_type {
  910. DISABLE_FOR_THIS_AC = 0,
  911. ENABLE_FOR_THIS_AC = 1,
  912. ENABLE_FOR_ALL_AC = 2,
  913. };
  914. enum traffic_type {
  915. TRAFFIC_TYPE_APERIODIC = 0,
  916. TRAFFIC_TYPE_PERIODIC = 1,
  917. };
  918. /* WMI_SYNCHRONIZE_CMDID */
  919. struct wmi_sync_cmd {
  920. u8 data_sync_map;
  921. } __packed;
  922. /* WMI_CREATE_PSTREAM_CMDID */
  923. struct wmi_create_pstream_cmd {
  924. /* msec */
  925. __le32 min_service_int;
  926. /* msec */
  927. __le32 max_service_int;
  928. /* msec */
  929. __le32 inactivity_int;
  930. /* msec */
  931. __le32 suspension_int;
  932. __le32 service_start_time;
  933. /* in bps */
  934. __le32 min_data_rate;
  935. /* in bps */
  936. __le32 mean_data_rate;
  937. /* in bps */
  938. __le32 peak_data_rate;
  939. __le32 max_burst_size;
  940. __le32 delay_bound;
  941. /* in bps */
  942. __le32 min_phy_rate;
  943. __le32 sba;
  944. __le32 medium_time;
  945. /* in octects */
  946. __le16 nominal_msdu;
  947. /* in octects */
  948. __le16 max_msdu;
  949. u8 traffic_class;
  950. /* see, enum dir_type */
  951. u8 traffic_direc;
  952. u8 rx_queue_num;
  953. /* see, enum traffic_type */
  954. u8 traffic_type;
  955. /* see, enum voiceps_cap_type */
  956. u8 voice_psc_cap;
  957. u8 tsid;
  958. /* 802.1D user priority */
  959. u8 user_pri;
  960. /* nominal phy rate */
  961. u8 nominal_phy;
  962. } __packed;
  963. /* WMI_DELETE_PSTREAM_CMDID */
  964. struct wmi_delete_pstream_cmd {
  965. u8 tx_queue_num;
  966. u8 rx_queue_num;
  967. u8 traffic_direc;
  968. u8 traffic_class;
  969. u8 tsid;
  970. } __packed;
  971. /* WMI_SET_CHANNEL_PARAMS_CMDID */
  972. enum wmi_phy_mode {
  973. WMI_11A_MODE = 0x1,
  974. WMI_11G_MODE = 0x2,
  975. WMI_11AG_MODE = 0x3,
  976. WMI_11B_MODE = 0x4,
  977. WMI_11GONLY_MODE = 0x5,
  978. WMI_11G_HT20 = 0x6,
  979. };
  980. #define WMI_MAX_CHANNELS 32
  981. /*
  982. * WMI_RSSI_THRESHOLD_PARAMS_CMDID
  983. * Setting the polltime to 0 would disable polling. Threshold values are
  984. * in the ascending order, and should agree to:
  985. * (lowThreshold_lowerVal < lowThreshold_upperVal < highThreshold_lowerVal
  986. * < highThreshold_upperVal)
  987. */
  988. struct wmi_rssi_threshold_params_cmd {
  989. /* polling time as a factor of LI */
  990. __le32 poll_time;
  991. /* lowest of upper */
  992. a_sle16 thresh_above1_val;
  993. a_sle16 thresh_above2_val;
  994. a_sle16 thresh_above3_val;
  995. a_sle16 thresh_above4_val;
  996. a_sle16 thresh_above5_val;
  997. /* highest of upper */
  998. a_sle16 thresh_above6_val;
  999. /* lowest of bellow */
  1000. a_sle16 thresh_below1_val;
  1001. a_sle16 thresh_below2_val;
  1002. a_sle16 thresh_below3_val;
  1003. a_sle16 thresh_below4_val;
  1004. a_sle16 thresh_below5_val;
  1005. /* highest of bellow */
  1006. a_sle16 thresh_below6_val;
  1007. /* "alpha" */
  1008. u8 weight;
  1009. u8 reserved[3];
  1010. } __packed;
  1011. /*
  1012. * WMI_SNR_THRESHOLD_PARAMS_CMDID
  1013. * Setting the polltime to 0 would disable polling.
  1014. */
  1015. struct wmi_snr_threshold_params_cmd {
  1016. /* polling time as a factor of LI */
  1017. __le32 poll_time;
  1018. /* "alpha" */
  1019. u8 weight;
  1020. /* lowest of upper */
  1021. u8 thresh_above1_val;
  1022. u8 thresh_above2_val;
  1023. u8 thresh_above3_val;
  1024. /* highest of upper */
  1025. u8 thresh_above4_val;
  1026. /* lowest of bellow */
  1027. u8 thresh_below1_val;
  1028. u8 thresh_below2_val;
  1029. u8 thresh_below3_val;
  1030. /* highest of bellow */
  1031. u8 thresh_below4_val;
  1032. u8 reserved[3];
  1033. } __packed;
  1034. /* Don't report BSSs with signal (RSSI) below this threshold */
  1035. struct wmi_set_rssi_filter_cmd {
  1036. s8 rssi;
  1037. } __packed;
  1038. enum wmi_preamble_policy {
  1039. WMI_IGNORE_BARKER_IN_ERP = 0,
  1040. WMI_FOLLOW_BARKER_IN_ERP,
  1041. };
  1042. struct wmi_set_lpreamble_cmd {
  1043. u8 status;
  1044. u8 preamble_policy;
  1045. } __packed;
  1046. struct wmi_set_rts_cmd {
  1047. __le16 threshold;
  1048. } __packed;
  1049. /* WMI_SET_TX_PWR_CMDID */
  1050. struct wmi_set_tx_pwr_cmd {
  1051. /* in dbM units */
  1052. u8 dbM;
  1053. } __packed;
  1054. struct wmi_tx_pwr_reply {
  1055. /* in dbM units */
  1056. u8 dbM;
  1057. } __packed;
  1058. struct wmi_report_sleep_state_event {
  1059. __le32 sleep_state;
  1060. };
  1061. enum wmi_report_sleep_status {
  1062. WMI_REPORT_SLEEP_STATUS_IS_DEEP_SLEEP = 0,
  1063. WMI_REPORT_SLEEP_STATUS_IS_AWAKE
  1064. };
  1065. enum target_event_report_config {
  1066. /* default */
  1067. DISCONN_EVT_IN_RECONN = 0,
  1068. NO_DISCONN_EVT_IN_RECONN
  1069. };
  1070. struct wmi_mcast_filter_cmd {
  1071. u8 mcast_all_enable;
  1072. } __packed;
  1073. #define ATH6KL_MCAST_FILTER_MAC_ADDR_SIZE 6
  1074. struct wmi_mcast_filter_add_del_cmd {
  1075. u8 mcast_mac[ATH6KL_MCAST_FILTER_MAC_ADDR_SIZE];
  1076. } __packed;
  1077. struct wmi_set_htcap_cmd {
  1078. u8 band;
  1079. u8 ht_enable;
  1080. u8 ht40_supported;
  1081. u8 ht20_sgi;
  1082. u8 ht40_sgi;
  1083. u8 intolerant_40mhz;
  1084. u8 max_ampdu_len_exp;
  1085. } __packed;
  1086. /* Command Replies */
  1087. /* WMI_GET_CHANNEL_LIST_CMDID reply */
  1088. struct wmi_channel_list_reply {
  1089. u8 reserved;
  1090. /* number of channels in reply */
  1091. u8 num_ch;
  1092. /* channel in Mhz */
  1093. __le16 ch_list[];
  1094. } __packed;
  1095. /* List of Events (target to host) */
  1096. enum wmi_event_id {
  1097. WMI_READY_EVENTID = 0x1001,
  1098. WMI_CONNECT_EVENTID,
  1099. WMI_DISCONNECT_EVENTID,
  1100. WMI_BSSINFO_EVENTID,
  1101. WMI_CMDERROR_EVENTID,
  1102. WMI_REGDOMAIN_EVENTID,
  1103. WMI_PSTREAM_TIMEOUT_EVENTID,
  1104. WMI_NEIGHBOR_REPORT_EVENTID,
  1105. WMI_TKIP_MICERR_EVENTID,
  1106. WMI_SCAN_COMPLETE_EVENTID, /* 0x100a */
  1107. WMI_REPORT_STATISTICS_EVENTID,
  1108. WMI_RSSI_THRESHOLD_EVENTID,
  1109. WMI_ERROR_REPORT_EVENTID,
  1110. WMI_OPT_RX_FRAME_EVENTID,
  1111. WMI_REPORT_ROAM_TBL_EVENTID,
  1112. WMI_EXTENSION_EVENTID,
  1113. WMI_CAC_EVENTID,
  1114. WMI_SNR_THRESHOLD_EVENTID,
  1115. WMI_LQ_THRESHOLD_EVENTID,
  1116. WMI_TX_RETRY_ERR_EVENTID, /* 0x1014 */
  1117. WMI_REPORT_ROAM_DATA_EVENTID,
  1118. WMI_TEST_EVENTID,
  1119. WMI_APLIST_EVENTID,
  1120. WMI_GET_WOW_LIST_EVENTID,
  1121. WMI_GET_PMKID_LIST_EVENTID,
  1122. WMI_CHANNEL_CHANGE_EVENTID,
  1123. WMI_PEER_NODE_EVENTID,
  1124. WMI_PSPOLL_EVENTID,
  1125. WMI_DTIMEXPIRY_EVENTID,
  1126. WMI_WLAN_VERSION_EVENTID,
  1127. WMI_SET_PARAMS_REPLY_EVENTID,
  1128. WMI_ADDBA_REQ_EVENTID, /*0x1020 */
  1129. WMI_ADDBA_RESP_EVENTID,
  1130. WMI_DELBA_REQ_EVENTID,
  1131. WMI_TX_COMPLETE_EVENTID,
  1132. WMI_HCI_EVENT_EVENTID,
  1133. WMI_ACL_DATA_EVENTID,
  1134. WMI_REPORT_SLEEP_STATE_EVENTID,
  1135. WMI_REPORT_BTCOEX_STATS_EVENTID,
  1136. WMI_REPORT_BTCOEX_CONFIG_EVENTID,
  1137. WMI_GET_PMK_EVENTID,
  1138. /* DFS Events */
  1139. WMI_DFS_HOST_ATTACH_EVENTID,
  1140. WMI_DFS_HOST_INIT_EVENTID,
  1141. WMI_DFS_RESET_DELAYLINES_EVENTID,
  1142. WMI_DFS_RESET_RADARQ_EVENTID,
  1143. WMI_DFS_RESET_AR_EVENTID,
  1144. WMI_DFS_RESET_ARQ_EVENTID,
  1145. WMI_DFS_SET_DUR_MULTIPLIER_EVENTID,
  1146. WMI_DFS_SET_BANGRADAR_EVENTID,
  1147. WMI_DFS_SET_DEBUGLEVEL_EVENTID,
  1148. WMI_DFS_PHYERR_EVENTID,
  1149. /* CCX Evants */
  1150. WMI_CCX_RM_STATUS_EVENTID,
  1151. /* P2P Events */
  1152. WMI_P2P_GO_NEG_RESULT_EVENTID,
  1153. WMI_WAC_SCAN_DONE_EVENTID,
  1154. WMI_WAC_REPORT_BSS_EVENTID,
  1155. WMI_WAC_START_WPS_EVENTID,
  1156. WMI_WAC_CTRL_REQ_REPLY_EVENTID,
  1157. WMI_REPORT_WMM_PARAMS_EVENTID,
  1158. WMI_WAC_REJECT_WPS_EVENTID,
  1159. /* More P2P Events */
  1160. WMI_P2P_GO_NEG_REQ_EVENTID,
  1161. WMI_P2P_INVITE_REQ_EVENTID,
  1162. WMI_P2P_INVITE_RCVD_RESULT_EVENTID,
  1163. WMI_P2P_INVITE_SENT_RESULT_EVENTID,
  1164. WMI_P2P_PROV_DISC_RESP_EVENTID,
  1165. WMI_P2P_PROV_DISC_REQ_EVENTID,
  1166. /* RFKILL Events */
  1167. WMI_RFKILL_STATE_CHANGE_EVENTID,
  1168. WMI_RFKILL_GET_MODE_CMD_EVENTID,
  1169. WMI_P2P_START_SDPD_EVENTID,
  1170. WMI_P2P_SDPD_RX_EVENTID,
  1171. WMI_SET_HOST_SLEEP_MODE_CMD_PROCESSED_EVENTID = 0x1047,
  1172. WMI_THIN_RESERVED_START_EVENTID = 0x8000,
  1173. /* Events in this range are reserved for thinmode */
  1174. WMI_THIN_RESERVED_END_EVENTID = 0x8fff,
  1175. WMI_SET_CHANNEL_EVENTID,
  1176. WMI_ASSOC_REQ_EVENTID,
  1177. /* Generic ACS event */
  1178. WMI_ACS_EVENTID,
  1179. WMI_STORERECALL_STORE_EVENTID,
  1180. WMI_WOW_EXT_WAKE_EVENTID,
  1181. WMI_GTK_OFFLOAD_STATUS_EVENTID,
  1182. WMI_NETWORK_LIST_OFFLOAD_EVENTID,
  1183. WMI_REMAIN_ON_CHNL_EVENTID,
  1184. WMI_CANCEL_REMAIN_ON_CHNL_EVENTID,
  1185. WMI_TX_STATUS_EVENTID,
  1186. WMI_RX_PROBE_REQ_EVENTID,
  1187. WMI_P2P_CAPABILITIES_EVENTID,
  1188. WMI_RX_ACTION_EVENTID,
  1189. WMI_P2P_INFO_EVENTID,
  1190. /* WPS Events */
  1191. WMI_WPS_GET_STATUS_EVENTID,
  1192. WMI_WPS_PROFILE_EVENTID,
  1193. /* more P2P events */
  1194. WMI_NOA_INFO_EVENTID,
  1195. WMI_OPPPS_INFO_EVENTID,
  1196. WMI_PORT_STATUS_EVENTID,
  1197. /* 802.11w */
  1198. WMI_GET_RSN_CAP_EVENTID,
  1199. WMI_TXE_NOTIFY_EVENTID,
  1200. };
  1201. struct wmi_ready_event_2 {
  1202. __le32 sw_version;
  1203. __le32 abi_version;
  1204. u8 mac_addr[ETH_ALEN];
  1205. u8 phy_cap;
  1206. } __packed;
  1207. /* WMI_PHY_CAPABILITY */
  1208. enum wmi_phy_cap {
  1209. WMI_11A_CAP = 0x01,
  1210. WMI_11G_CAP = 0x02,
  1211. WMI_11AG_CAP = 0x03,
  1212. WMI_11AN_CAP = 0x04,
  1213. WMI_11GN_CAP = 0x05,
  1214. WMI_11AGN_CAP = 0x06,
  1215. };
  1216. /* Connect Event */
  1217. struct wmi_connect_event {
  1218. union {
  1219. struct {
  1220. __le16 ch;
  1221. u8 bssid[ETH_ALEN];
  1222. __le16 listen_intvl;
  1223. __le16 beacon_intvl;
  1224. __le32 nw_type;
  1225. } sta;
  1226. struct {
  1227. u8 aid;
  1228. u8 phymode;
  1229. u8 mac_addr[ETH_ALEN];
  1230. u8 auth;
  1231. u8 keymgmt;
  1232. __le16 cipher;
  1233. u8 apsd_info;
  1234. u8 unused[3];
  1235. } ap_sta;
  1236. struct {
  1237. __le16 ch;
  1238. u8 bssid[ETH_ALEN];
  1239. u8 unused[8];
  1240. } ap_bss;
  1241. } u;
  1242. u8 beacon_ie_len;
  1243. u8 assoc_req_len;
  1244. u8 assoc_resp_len;
  1245. u8 assoc_info[];
  1246. } __packed;
  1247. /* Disconnect Event */
  1248. enum wmi_disconnect_reason {
  1249. NO_NETWORK_AVAIL = 0x01,
  1250. /* bmiss */
  1251. LOST_LINK = 0x02,
  1252. DISCONNECT_CMD = 0x03,
  1253. BSS_DISCONNECTED = 0x04,
  1254. AUTH_FAILED = 0x05,
  1255. ASSOC_FAILED = 0x06,
  1256. NO_RESOURCES_AVAIL = 0x07,
  1257. CSERV_DISCONNECT = 0x08,
  1258. INVALID_PROFILE = 0x0a,
  1259. DOT11H_CHANNEL_SWITCH = 0x0b,
  1260. PROFILE_MISMATCH = 0x0c,
  1261. CONNECTION_EVICTED = 0x0d,
  1262. IBSS_MERGE = 0xe,
  1263. };
  1264. /* AP mode disconnect proto_reasons */
  1265. enum ap_disconnect_reason {
  1266. WMI_AP_REASON_STA_LEFT = 101,
  1267. WMI_AP_REASON_FROM_HOST = 102,
  1268. WMI_AP_REASON_COMM_TIMEOUT = 103,
  1269. WMI_AP_REASON_MAX_STA = 104,
  1270. WMI_AP_REASON_ACL = 105,
  1271. WMI_AP_REASON_STA_ROAM = 106,
  1272. WMI_AP_REASON_DFS_CHANNEL = 107,
  1273. };
  1274. #define ATH6KL_COUNTRY_RD_SHIFT 16
  1275. struct ath6kl_wmi_regdomain {
  1276. __le32 reg_code;
  1277. };
  1278. struct wmi_disconnect_event {
  1279. /* reason code, see 802.11 spec. */
  1280. __le16 proto_reason_status;
  1281. /* set if known */
  1282. u8 bssid[ETH_ALEN];
  1283. /* see WMI_DISCONNECT_REASON */
  1284. u8 disconn_reason;
  1285. u8 assoc_resp_len;
  1286. u8 assoc_info[];
  1287. } __packed;
  1288. /*
  1289. * BSS Info Event.
  1290. * Mechanism used to inform host of the presence and characteristic of
  1291. * wireless networks present. Consists of bss info header followed by
  1292. * the beacon or probe-response frame body. The 802.11 header is no included.
  1293. */
  1294. enum wmi_bi_ftype {
  1295. BEACON_FTYPE = 0x1,
  1296. PROBERESP_FTYPE,
  1297. ACTION_MGMT_FTYPE,
  1298. PROBEREQ_FTYPE,
  1299. };
  1300. #define DEF_LRSSI_SCAN_PERIOD 5
  1301. #define DEF_LRSSI_ROAM_THRESHOLD 20
  1302. #define DEF_LRSSI_ROAM_FLOOR 60
  1303. #define DEF_SCAN_FOR_ROAM_INTVL 2
  1304. enum wmi_roam_ctrl {
  1305. WMI_FORCE_ROAM = 1,
  1306. WMI_SET_ROAM_MODE,
  1307. WMI_SET_HOST_BIAS,
  1308. WMI_SET_LRSSI_SCAN_PARAMS,
  1309. };
  1310. enum wmi_roam_mode {
  1311. WMI_DEFAULT_ROAM_MODE = 1, /* RSSI based roam */
  1312. WMI_HOST_BIAS_ROAM_MODE = 2, /* Host bias based roam */
  1313. WMI_LOCK_BSS_MODE = 3, /* Lock to the current BSS */
  1314. };
  1315. struct bss_bias {
  1316. u8 bssid[ETH_ALEN];
  1317. s8 bias;
  1318. } __packed;
  1319. struct bss_bias_info {
  1320. u8 num_bss;
  1321. struct bss_bias bss_bias[];
  1322. } __packed;
  1323. struct low_rssi_scan_params {
  1324. __le16 lrssi_scan_period;
  1325. a_sle16 lrssi_scan_threshold;
  1326. a_sle16 lrssi_roam_threshold;
  1327. u8 roam_rssi_floor;
  1328. u8 reserved[1];
  1329. } __packed;
  1330. struct roam_ctrl_cmd {
  1331. union {
  1332. u8 bssid[ETH_ALEN]; /* WMI_FORCE_ROAM */
  1333. u8 roam_mode; /* WMI_SET_ROAM_MODE */
  1334. struct bss_bias_info bss; /* WMI_SET_HOST_BIAS */
  1335. struct low_rssi_scan_params params; /* WMI_SET_LRSSI_SCAN_PARAMS
  1336. */
  1337. } __packed info;
  1338. u8 roam_ctrl;
  1339. } __packed;
  1340. struct set_beacon_int_cmd {
  1341. __le32 beacon_intvl;
  1342. } __packed;
  1343. struct set_dtim_cmd {
  1344. __le32 dtim_period;
  1345. } __packed;
  1346. /* BSS INFO HDR version 2.0 */
  1347. struct wmi_bss_info_hdr2 {
  1348. __le16 ch; /* frequency in MHz */
  1349. /* see, enum wmi_bi_ftype */
  1350. u8 frame_type;
  1351. u8 snr; /* note: rssi = snr - 95 dBm */
  1352. u8 bssid[ETH_ALEN];
  1353. __le16 ie_mask;
  1354. } __packed;
  1355. /* Command Error Event */
  1356. enum wmi_error_code {
  1357. INVALID_PARAM = 0x01,
  1358. ILLEGAL_STATE = 0x02,
  1359. INTERNAL_ERROR = 0x03,
  1360. };
  1361. struct wmi_cmd_error_event {
  1362. __le16 cmd_id;
  1363. u8 err_code;
  1364. } __packed;
  1365. struct wmi_pstream_timeout_event {
  1366. u8 tx_queue_num;
  1367. u8 rx_queue_num;
  1368. u8 traffic_direc;
  1369. u8 traffic_class;
  1370. } __packed;
  1371. /*
  1372. * The WMI_NEIGHBOR_REPORT Event is generated by the target to inform
  1373. * the host of BSS's it has found that matches the current profile.
  1374. * It can be used by the host to cache PMKs and/to initiate pre-authentication
  1375. * if the BSS supports it. The first bssid is always the current associated
  1376. * BSS.
  1377. * The bssid and bssFlags information repeats according to the number
  1378. * or APs reported.
  1379. */
  1380. enum wmi_bss_flags {
  1381. WMI_DEFAULT_BSS_FLAGS = 0x00,
  1382. WMI_PREAUTH_CAPABLE_BSS = 0x01,
  1383. WMI_PMKID_VALID_BSS = 0x02,
  1384. };
  1385. struct wmi_neighbor_info {
  1386. u8 bssid[ETH_ALEN];
  1387. u8 bss_flags; /* enum wmi_bss_flags */
  1388. } __packed;
  1389. struct wmi_neighbor_report_event {
  1390. u8 num_neighbors;
  1391. struct wmi_neighbor_info neighbor[];
  1392. } __packed;
  1393. /* TKIP MIC Error Event */
  1394. struct wmi_tkip_micerr_event {
  1395. u8 key_id;
  1396. u8 is_mcast;
  1397. } __packed;
  1398. enum wmi_scan_status {
  1399. WMI_SCAN_STATUS_SUCCESS = 0,
  1400. };
  1401. /* WMI_SCAN_COMPLETE_EVENTID */
  1402. struct wmi_scan_complete_event {
  1403. a_sle32 status;
  1404. } __packed;
  1405. #define MAX_OPT_DATA_LEN 1400
  1406. /*
  1407. * Special frame receive Event.
  1408. * Mechanism used to inform host of the receiption of the special frames.
  1409. * Consists of special frame info header followed by special frame body.
  1410. * The 802.11 header is not included.
  1411. */
  1412. struct wmi_opt_rx_info_hdr {
  1413. __le16 ch;
  1414. u8 frame_type;
  1415. s8 snr;
  1416. u8 src_addr[ETH_ALEN];
  1417. u8 bssid[ETH_ALEN];
  1418. } __packed;
  1419. /* Reporting statistic */
  1420. struct tx_stats {
  1421. __le32 pkt;
  1422. __le32 byte;
  1423. __le32 ucast_pkt;
  1424. __le32 ucast_byte;
  1425. __le32 mcast_pkt;
  1426. __le32 mcast_byte;
  1427. __le32 bcast_pkt;
  1428. __le32 bcast_byte;
  1429. __le32 rts_success_cnt;
  1430. __le32 pkt_per_ac[4];
  1431. __le32 err_per_ac[4];
  1432. __le32 err;
  1433. __le32 fail_cnt;
  1434. __le32 retry_cnt;
  1435. __le32 mult_retry_cnt;
  1436. __le32 rts_fail_cnt;
  1437. a_sle32 ucast_rate;
  1438. } __packed;
  1439. struct rx_stats {
  1440. __le32 pkt;
  1441. __le32 byte;
  1442. __le32 ucast_pkt;
  1443. __le32 ucast_byte;
  1444. __le32 mcast_pkt;
  1445. __le32 mcast_byte;
  1446. __le32 bcast_pkt;
  1447. __le32 bcast_byte;
  1448. __le32 frgment_pkt;
  1449. __le32 err;
  1450. __le32 crc_err;
  1451. __le32 key_cache_miss;
  1452. __le32 decrypt_err;
  1453. __le32 dupl_frame;
  1454. a_sle32 ucast_rate;
  1455. } __packed;
  1456. #define RATE_INDEX_WITHOUT_SGI_MASK 0x7f
  1457. #define RATE_INDEX_MSB 0x80
  1458. struct tkip_ccmp_stats {
  1459. __le32 tkip_local_mic_fail;
  1460. __le32 tkip_cnter_measures_invoked;
  1461. __le32 tkip_replays;
  1462. __le32 tkip_fmt_err;
  1463. __le32 ccmp_fmt_err;
  1464. __le32 ccmp_replays;
  1465. } __packed;
  1466. struct pm_stats {
  1467. __le32 pwr_save_failure_cnt;
  1468. __le16 stop_tx_failure_cnt;
  1469. __le16 atim_tx_failure_cnt;
  1470. __le16 atim_rx_failure_cnt;
  1471. __le16 bcn_rx_failure_cnt;
  1472. } __packed;
  1473. struct cserv_stats {
  1474. __le32 cs_bmiss_cnt;
  1475. __le32 cs_low_rssi_cnt;
  1476. __le16 cs_connect_cnt;
  1477. __le16 cs_discon_cnt;
  1478. a_sle16 cs_ave_beacon_rssi;
  1479. __le16 cs_roam_count;
  1480. a_sle16 cs_rssi;
  1481. u8 cs_snr;
  1482. u8 cs_ave_beacon_snr;
  1483. u8 cs_last_roam_msec;
  1484. } __packed;
  1485. struct wlan_net_stats {
  1486. struct tx_stats tx;
  1487. struct rx_stats rx;
  1488. struct tkip_ccmp_stats tkip_ccmp_stats;
  1489. } __packed;
  1490. struct arp_stats {
  1491. __le32 arp_received;
  1492. __le32 arp_matched;
  1493. __le32 arp_replied;
  1494. } __packed;
  1495. struct wlan_wow_stats {
  1496. __le32 wow_pkt_dropped;
  1497. __le16 wow_evt_discarded;
  1498. u8 wow_host_pkt_wakeups;
  1499. u8 wow_host_evt_wakeups;
  1500. } __packed;
  1501. struct wmi_target_stats {
  1502. __le32 lq_val;
  1503. a_sle32 noise_floor_calib;
  1504. struct pm_stats pm_stats;
  1505. struct wlan_net_stats stats;
  1506. struct wlan_wow_stats wow_stats;
  1507. struct arp_stats arp_stats;
  1508. struct cserv_stats cserv_stats;
  1509. } __packed;
  1510. /*
  1511. * WMI_RSSI_THRESHOLD_EVENTID.
  1512. * Indicate the RSSI events to host. Events are indicated when we breach a
  1513. * thresold value.
  1514. */
  1515. enum wmi_rssi_threshold_val {
  1516. WMI_RSSI_THRESHOLD1_ABOVE = 0,
  1517. WMI_RSSI_THRESHOLD2_ABOVE,
  1518. WMI_RSSI_THRESHOLD3_ABOVE,
  1519. WMI_RSSI_THRESHOLD4_ABOVE,
  1520. WMI_RSSI_THRESHOLD5_ABOVE,
  1521. WMI_RSSI_THRESHOLD6_ABOVE,
  1522. WMI_RSSI_THRESHOLD1_BELOW,
  1523. WMI_RSSI_THRESHOLD2_BELOW,
  1524. WMI_RSSI_THRESHOLD3_BELOW,
  1525. WMI_RSSI_THRESHOLD4_BELOW,
  1526. WMI_RSSI_THRESHOLD5_BELOW,
  1527. WMI_RSSI_THRESHOLD6_BELOW
  1528. };
  1529. struct wmi_rssi_threshold_event {
  1530. a_sle16 rssi;
  1531. u8 range;
  1532. } __packed;
  1533. enum wmi_snr_threshold_val {
  1534. WMI_SNR_THRESHOLD1_ABOVE = 1,
  1535. WMI_SNR_THRESHOLD1_BELOW,
  1536. WMI_SNR_THRESHOLD2_ABOVE,
  1537. WMI_SNR_THRESHOLD2_BELOW,
  1538. WMI_SNR_THRESHOLD3_ABOVE,
  1539. WMI_SNR_THRESHOLD3_BELOW,
  1540. WMI_SNR_THRESHOLD4_ABOVE,
  1541. WMI_SNR_THRESHOLD4_BELOW
  1542. };
  1543. struct wmi_snr_threshold_event {
  1544. /* see, enum wmi_snr_threshold_val */
  1545. u8 range;
  1546. u8 snr;
  1547. } __packed;
  1548. /* WMI_REPORT_ROAM_TBL_EVENTID */
  1549. #define MAX_ROAM_TBL_CAND 5
  1550. struct wmi_bss_roam_info {
  1551. a_sle32 roam_util;
  1552. u8 bssid[ETH_ALEN];
  1553. s8 rssi;
  1554. s8 rssidt;
  1555. s8 last_rssi;
  1556. s8 util;
  1557. s8 bias;
  1558. /* for alignment */
  1559. u8 reserved;
  1560. } __packed;
  1561. struct wmi_target_roam_tbl {
  1562. __le16 roam_mode;
  1563. __le16 num_entries;
  1564. struct wmi_bss_roam_info info[];
  1565. } __packed;
  1566. /* WMI_CAC_EVENTID */
  1567. enum cac_indication {
  1568. CAC_INDICATION_ADMISSION = 0x00,
  1569. CAC_INDICATION_ADMISSION_RESP = 0x01,
  1570. CAC_INDICATION_DELETE = 0x02,
  1571. CAC_INDICATION_NO_RESP = 0x03,
  1572. };
  1573. #define WMM_TSPEC_IE_LEN 63
  1574. struct wmi_cac_event {
  1575. u8 ac;
  1576. u8 cac_indication;
  1577. u8 status_code;
  1578. u8 tspec_suggestion[WMM_TSPEC_IE_LEN];
  1579. } __packed;
  1580. /* WMI_APLIST_EVENTID */
  1581. enum aplist_ver {
  1582. APLIST_VER1 = 1,
  1583. };
  1584. struct wmi_ap_info_v1 {
  1585. u8 bssid[ETH_ALEN];
  1586. __le16 channel;
  1587. } __packed;
  1588. union wmi_ap_info {
  1589. struct wmi_ap_info_v1 ap_info_v1;
  1590. } __packed;
  1591. struct wmi_aplist_event {
  1592. u8 ap_list_ver;
  1593. u8 num_ap;
  1594. union wmi_ap_info ap_list[];
  1595. } __packed;
  1596. /* Developer Commands */
  1597. /*
  1598. * WMI_SET_BITRATE_CMDID
  1599. *
  1600. * Get bit rate cmd uses same definition as set bit rate cmd
  1601. */
  1602. enum wmi_bit_rate {
  1603. RATE_AUTO = -1,
  1604. RATE_1Mb = 0,
  1605. RATE_2Mb = 1,
  1606. RATE_5_5Mb = 2,
  1607. RATE_11Mb = 3,
  1608. RATE_6Mb = 4,
  1609. RATE_9Mb = 5,
  1610. RATE_12Mb = 6,
  1611. RATE_18Mb = 7,
  1612. RATE_24Mb = 8,
  1613. RATE_36Mb = 9,
  1614. RATE_48Mb = 10,
  1615. RATE_54Mb = 11,
  1616. RATE_MCS_0_20 = 12,
  1617. RATE_MCS_1_20 = 13,
  1618. RATE_MCS_2_20 = 14,
  1619. RATE_MCS_3_20 = 15,
  1620. RATE_MCS_4_20 = 16,
  1621. RATE_MCS_5_20 = 17,
  1622. RATE_MCS_6_20 = 18,
  1623. RATE_MCS_7_20 = 19,
  1624. RATE_MCS_0_40 = 20,
  1625. RATE_MCS_1_40 = 21,
  1626. RATE_MCS_2_40 = 22,
  1627. RATE_MCS_3_40 = 23,
  1628. RATE_MCS_4_40 = 24,
  1629. RATE_MCS_5_40 = 25,
  1630. RATE_MCS_6_40 = 26,
  1631. RATE_MCS_7_40 = 27,
  1632. };
  1633. struct wmi_bit_rate_reply {
  1634. /* see, enum wmi_bit_rate */
  1635. s8 rate_index;
  1636. } __packed;
  1637. /*
  1638. * WMI_SET_FIXRATES_CMDID
  1639. *
  1640. * Get fix rates cmd uses same definition as set fix rates cmd
  1641. */
  1642. struct wmi_fix_rates_reply {
  1643. /* see wmi_bit_rate */
  1644. __le32 fix_rate_mask;
  1645. } __packed;
  1646. enum roam_data_type {
  1647. /* get the roam time data */
  1648. ROAM_DATA_TIME = 1,
  1649. };
  1650. struct wmi_target_roam_time {
  1651. __le32 disassoc_time;
  1652. __le32 no_txrx_time;
  1653. __le32 assoc_time;
  1654. __le32 allow_txrx_time;
  1655. u8 disassoc_bssid[ETH_ALEN];
  1656. s8 disassoc_bss_rssi;
  1657. u8 assoc_bssid[ETH_ALEN];
  1658. s8 assoc_bss_rssi;
  1659. } __packed;
  1660. enum wmi_txop_cfg {
  1661. WMI_TXOP_DISABLED = 0,
  1662. WMI_TXOP_ENABLED
  1663. };
  1664. struct wmi_set_wmm_txop_cmd {
  1665. u8 txop_enable;
  1666. } __packed;
  1667. struct wmi_set_keepalive_cmd {
  1668. u8 keep_alive_intvl;
  1669. } __packed;
  1670. struct wmi_get_keepalive_cmd {
  1671. __le32 configured;
  1672. u8 keep_alive_intvl;
  1673. } __packed;
  1674. struct wmi_set_appie_cmd {
  1675. u8 mgmt_frm_type; /* enum wmi_mgmt_frame_type */
  1676. u8 ie_len;
  1677. u8 ie_info[];
  1678. } __packed;
  1679. struct wmi_set_ie_cmd {
  1680. u8 ie_id;
  1681. u8 ie_field; /* enum wmi_ie_field_type */
  1682. u8 ie_len;
  1683. u8 reserved;
  1684. u8 ie_info[];
  1685. } __packed;
  1686. /* Notify the WSC registration status to the target */
  1687. #define WSC_REG_ACTIVE 1
  1688. #define WSC_REG_INACTIVE 0
  1689. #define WOW_MAX_FILTERS_PER_LIST 4
  1690. #define WOW_PATTERN_SIZE 64
  1691. #define MAC_MAX_FILTERS_PER_LIST 4
  1692. struct wow_filter {
  1693. u8 wow_valid_filter;
  1694. u8 wow_filter_id;
  1695. u8 wow_filter_size;
  1696. u8 wow_filter_offset;
  1697. u8 wow_filter_mask[WOW_PATTERN_SIZE];
  1698. u8 wow_filter_pattern[WOW_PATTERN_SIZE];
  1699. } __packed;
  1700. #define MAX_IP_ADDRS 2
  1701. struct wmi_set_ip_cmd {
  1702. /* IP in network byte order */
  1703. __be32 ips[MAX_IP_ADDRS];
  1704. } __packed;
  1705. enum ath6kl_wow_filters {
  1706. WOW_FILTER_SSID = BIT(1),
  1707. WOW_FILTER_OPTION_MAGIC_PACKET = BIT(2),
  1708. WOW_FILTER_OPTION_EAP_REQ = BIT(3),
  1709. WOW_FILTER_OPTION_PATTERNS = BIT(4),
  1710. WOW_FILTER_OPTION_OFFLOAD_ARP = BIT(5),
  1711. WOW_FILTER_OPTION_OFFLOAD_NS = BIT(6),
  1712. WOW_FILTER_OPTION_OFFLOAD_GTK = BIT(7),
  1713. WOW_FILTER_OPTION_8021X_4WAYHS = BIT(8),
  1714. WOW_FILTER_OPTION_NLO_DISCVRY = BIT(9),
  1715. WOW_FILTER_OPTION_NWK_DISASSOC = BIT(10),
  1716. WOW_FILTER_OPTION_GTK_ERROR = BIT(11),
  1717. WOW_FILTER_OPTION_TEST_MODE = BIT(15),
  1718. };
  1719. enum ath6kl_host_mode {
  1720. ATH6KL_HOST_MODE_AWAKE,
  1721. ATH6KL_HOST_MODE_ASLEEP,
  1722. };
  1723. struct wmi_set_host_sleep_mode_cmd {
  1724. __le32 awake;
  1725. __le32 asleep;
  1726. } __packed;
  1727. enum ath6kl_wow_mode {
  1728. ATH6KL_WOW_MODE_DISABLE,
  1729. ATH6KL_WOW_MODE_ENABLE,
  1730. };
  1731. struct wmi_set_wow_mode_cmd {
  1732. __le32 enable_wow;
  1733. __le32 filter;
  1734. __le16 host_req_delay;
  1735. } __packed;
  1736. struct wmi_add_wow_pattern_cmd {
  1737. u8 filter_list_id;
  1738. u8 filter_size;
  1739. u8 filter_offset;
  1740. u8 filter[];
  1741. } __packed;
  1742. struct wmi_del_wow_pattern_cmd {
  1743. __le16 filter_list_id;
  1744. __le16 filter_id;
  1745. } __packed;
  1746. /* WMI_SET_TXE_NOTIFY_CMDID */
  1747. struct wmi_txe_notify_cmd {
  1748. __le32 rate;
  1749. __le32 pkts;
  1750. __le32 intvl;
  1751. } __packed;
  1752. /* WMI_TXE_NOTIFY_EVENTID */
  1753. struct wmi_txe_notify_event {
  1754. __le32 rate;
  1755. __le32 pkts;
  1756. } __packed;
  1757. /* WMI_SET_AKMP_PARAMS_CMD */
  1758. struct wmi_pmkid {
  1759. u8 pmkid[WMI_PMKID_LEN];
  1760. } __packed;
  1761. /* WMI_GET_PMKID_LIST_CMD Reply */
  1762. struct wmi_pmkid_list_reply {
  1763. __le32 num_pmkid;
  1764. u8 bssid_list[ETH_ALEN][1];
  1765. struct wmi_pmkid pmkid_list[1];
  1766. } __packed;
  1767. /* WMI_ADDBA_REQ_EVENTID */
  1768. struct wmi_addba_req_event {
  1769. u8 tid;
  1770. u8 win_sz;
  1771. __le16 st_seq_no;
  1772. /* f/w response for ADDBA Req; OK (0) or failure (!=0) */
  1773. u8 status;
  1774. } __packed;
  1775. /* WMI_ADDBA_RESP_EVENTID */
  1776. struct wmi_addba_resp_event {
  1777. u8 tid;
  1778. /* OK (0), failure (!=0) */
  1779. u8 status;
  1780. /* three values: not supported(0), 3839, 8k */
  1781. __le16 amsdu_sz;
  1782. } __packed;
  1783. /* WMI_DELBA_EVENTID
  1784. * f/w received a DELBA for peer and processed it.
  1785. * Host is notified of this
  1786. */
  1787. struct wmi_delba_event {
  1788. u8 tid;
  1789. u8 is_peer_initiator;
  1790. __le16 reason_code;
  1791. } __packed;
  1792. #define PEER_NODE_JOIN_EVENT 0x00
  1793. #define PEER_NODE_LEAVE_EVENT 0x01
  1794. #define PEER_FIRST_NODE_JOIN_EVENT 0x10
  1795. #define PEER_LAST_NODE_LEAVE_EVENT 0x11
  1796. struct wmi_peer_node_event {
  1797. u8 event_code;
  1798. u8 peer_mac_addr[ETH_ALEN];
  1799. } __packed;
  1800. /* Transmit complete event data structure(s) */
  1801. /* version 1 of tx complete msg */
  1802. struct tx_complete_msg_v1 {
  1803. #define TX_COMPLETE_STATUS_SUCCESS 0
  1804. #define TX_COMPLETE_STATUS_RETRIES 1
  1805. #define TX_COMPLETE_STATUS_NOLINK 2
  1806. #define TX_COMPLETE_STATUS_TIMEOUT 3
  1807. #define TX_COMPLETE_STATUS_OTHER 4
  1808. u8 status;
  1809. /* packet ID to identify parent packet */
  1810. u8 pkt_id;
  1811. /* rate index on successful transmission */
  1812. u8 rate_idx;
  1813. /* number of ACK failures in tx attempt */
  1814. u8 ack_failures;
  1815. } __packed;
  1816. struct wmi_tx_complete_event {
  1817. /* no of tx comp msgs following this struct */
  1818. u8 num_msg;
  1819. /* length in bytes for each individual msg following this struct */
  1820. u8 msg_len;
  1821. /* version of tx complete msg data following this struct */
  1822. u8 msg_type;
  1823. /* individual messages follow this header */
  1824. u8 reserved;
  1825. } __packed;
  1826. /*
  1827. * ------- AP Mode definitions --------------
  1828. */
  1829. /*
  1830. * !!! Warning !!!
  1831. * -Changing the following values needs compilation of both driver and firmware
  1832. */
  1833. #define AP_MAX_NUM_STA 10
  1834. /* Spl. AID used to set DTIM flag in the beacons */
  1835. #define MCAST_AID 0xFF
  1836. #define DEF_AP_COUNTRY_CODE "US "
  1837. /* Used with WMI_AP_SET_NUM_STA_CMDID */
  1838. /*
  1839. * Used with WMI_AP_SET_MLME_CMDID
  1840. */
  1841. /* MLME Commands */
  1842. #define WMI_AP_MLME_ASSOC 1 /* associate station */
  1843. #define WMI_AP_DISASSOC 2 /* disassociate station */
  1844. #define WMI_AP_DEAUTH 3 /* deauthenticate station */
  1845. #define WMI_AP_MLME_AUTHORIZE 4 /* authorize station */
  1846. #define WMI_AP_MLME_UNAUTHORIZE 5 /* unauthorize station */
  1847. struct wmi_ap_set_mlme_cmd {
  1848. u8 mac[ETH_ALEN];
  1849. __le16 reason; /* 802.11 reason code */
  1850. u8 cmd; /* operation to perform (WMI_AP_*) */
  1851. } __packed;
  1852. struct wmi_ap_set_pvb_cmd {
  1853. __le32 flag;
  1854. __le16 rsvd;
  1855. __le16 aid;
  1856. } __packed;
  1857. struct wmi_rx_frame_format_cmd {
  1858. /* version of meta data for rx packets <0 = default> (0-7 = valid) */
  1859. u8 meta_ver;
  1860. /*
  1861. * 1 == leave .11 header intact,
  1862. * 0 == replace .11 header with .3 <default>
  1863. */
  1864. u8 dot11_hdr;
  1865. /*
  1866. * 1 == defragmentation is performed by host,
  1867. * 0 == performed by target <default>
  1868. */
  1869. u8 defrag_on_host;
  1870. /* for alignment */
  1871. u8 reserved[1];
  1872. } __packed;
  1873. struct wmi_ap_hidden_ssid_cmd {
  1874. u8 hidden_ssid;
  1875. } __packed;
  1876. struct wmi_set_inact_period_cmd {
  1877. __le32 inact_period;
  1878. u8 num_null_func;
  1879. } __packed;
  1880. /* AP mode events */
  1881. struct wmi_ap_set_apsd_cmd {
  1882. u8 enable;
  1883. } __packed;
  1884. enum wmi_ap_apsd_buffered_traffic_flags {
  1885. WMI_AP_APSD_NO_DELIVERY_FRAMES = 0x1,
  1886. };
  1887. struct wmi_ap_apsd_buffered_traffic_cmd {
  1888. __le16 aid;
  1889. __le16 bitmap;
  1890. __le32 flags;
  1891. } __packed;
  1892. /* WMI_PS_POLL_EVENT */
  1893. struct wmi_pspoll_event {
  1894. __le16 aid;
  1895. } __packed;
  1896. struct wmi_per_sta_stat {
  1897. __le32 tx_bytes;
  1898. __le32 tx_pkts;
  1899. __le32 tx_error;
  1900. __le32 tx_discard;
  1901. __le32 rx_bytes;
  1902. __le32 rx_pkts;
  1903. __le32 rx_error;
  1904. __le32 rx_discard;
  1905. __le32 aid;
  1906. } __packed;
  1907. struct wmi_ap_mode_stat {
  1908. __le32 action;
  1909. struct wmi_per_sta_stat sta[AP_MAX_NUM_STA + 1];
  1910. } __packed;
  1911. /* End of AP mode definitions */
  1912. struct wmi_remain_on_chnl_cmd {
  1913. __le32 freq;
  1914. __le32 duration;
  1915. } __packed;
  1916. /* wmi_send_action_cmd is to be deprecated. Use
  1917. * wmi_send_mgmt_cmd instead. The new structure supports P2P mgmt
  1918. * operations using station interface.
  1919. */
  1920. struct wmi_send_action_cmd {
  1921. __le32 id;
  1922. __le32 freq;
  1923. __le32 wait;
  1924. __le16 len;
  1925. u8 data[];
  1926. } __packed;
  1927. struct wmi_send_mgmt_cmd {
  1928. __le32 id;
  1929. __le32 freq;
  1930. __le32 wait;
  1931. __le32 no_cck;
  1932. __le16 len;
  1933. u8 data[];
  1934. } __packed;
  1935. struct wmi_tx_status_event {
  1936. __le32 id;
  1937. u8 ack_status;
  1938. } __packed;
  1939. struct wmi_probe_req_report_cmd {
  1940. u8 enable;
  1941. } __packed;
  1942. struct wmi_disable_11b_rates_cmd {
  1943. u8 disable;
  1944. } __packed;
  1945. struct wmi_set_appie_extended_cmd {
  1946. u8 role_id;
  1947. u8 mgmt_frm_type;
  1948. u8 ie_len;
  1949. u8 ie_info[];
  1950. } __packed;
  1951. struct wmi_remain_on_chnl_event {
  1952. __le32 freq;
  1953. __le32 duration;
  1954. } __packed;
  1955. struct wmi_cancel_remain_on_chnl_event {
  1956. __le32 freq;
  1957. __le32 duration;
  1958. u8 status;
  1959. } __packed;
  1960. struct wmi_rx_action_event {
  1961. __le32 freq;
  1962. __le16 len;
  1963. u8 data[];
  1964. } __packed;
  1965. struct wmi_p2p_capabilities_event {
  1966. __le16 len;
  1967. u8 data[];
  1968. } __packed;
  1969. struct wmi_p2p_rx_probe_req_event {
  1970. __le32 freq;
  1971. __le16 len;
  1972. u8 data[];
  1973. } __packed;
  1974. #define P2P_FLAG_CAPABILITIES_REQ (0x00000001)
  1975. #define P2P_FLAG_MACADDR_REQ (0x00000002)
  1976. #define P2P_FLAG_HMODEL_REQ (0x00000002)
  1977. struct wmi_get_p2p_info {
  1978. __le32 info_req_flags;
  1979. } __packed;
  1980. struct wmi_p2p_info_event {
  1981. __le32 info_req_flags;
  1982. __le16 len;
  1983. u8 data[];
  1984. } __packed;
  1985. struct wmi_p2p_capabilities {
  1986. u8 go_power_save;
  1987. } __packed;
  1988. struct wmi_p2p_macaddr {
  1989. u8 mac_addr[ETH_ALEN];
  1990. } __packed;
  1991. struct wmi_p2p_hmodel {
  1992. u8 p2p_model;
  1993. } __packed;
  1994. struct wmi_p2p_probe_response_cmd {
  1995. __le32 freq;
  1996. u8 destination_addr[ETH_ALEN];
  1997. __le16 len;
  1998. u8 data[];
  1999. } __packed;
  2000. /* Extended WMI (WMIX)
  2001. *
  2002. * Extended WMIX commands are encapsulated in a WMI message with
  2003. * cmd=WMI_EXTENSION_CMD.
  2004. *
  2005. * Extended WMI commands are those that are needed during wireless
  2006. * operation, but which are not really wireless commands. This allows,
  2007. * for instance, platform-specific commands. Extended WMI commands are
  2008. * embedded in a WMI command message with WMI_COMMAND_ID=WMI_EXTENSION_CMDID.
  2009. * Extended WMI events are similarly embedded in a WMI event message with
  2010. * WMI_EVENT_ID=WMI_EXTENSION_EVENTID.
  2011. */
  2012. struct wmix_cmd_hdr {
  2013. __le32 cmd_id;
  2014. } __packed;
  2015. enum wmix_command_id {
  2016. WMIX_DSETOPEN_REPLY_CMDID = 0x2001,
  2017. WMIX_DSETDATA_REPLY_CMDID,
  2018. WMIX_GPIO_OUTPUT_SET_CMDID,
  2019. WMIX_GPIO_INPUT_GET_CMDID,
  2020. WMIX_GPIO_REGISTER_SET_CMDID,
  2021. WMIX_GPIO_REGISTER_GET_CMDID,
  2022. WMIX_GPIO_INTR_ACK_CMDID,
  2023. WMIX_HB_CHALLENGE_RESP_CMDID,
  2024. WMIX_DBGLOG_CFG_MODULE_CMDID,
  2025. WMIX_PROF_CFG_CMDID, /* 0x200a */
  2026. WMIX_PROF_ADDR_SET_CMDID,
  2027. WMIX_PROF_START_CMDID,
  2028. WMIX_PROF_STOP_CMDID,
  2029. WMIX_PROF_COUNT_GET_CMDID,
  2030. };
  2031. enum wmix_event_id {
  2032. WMIX_DSETOPENREQ_EVENTID = 0x3001,
  2033. WMIX_DSETCLOSE_EVENTID,
  2034. WMIX_DSETDATAREQ_EVENTID,
  2035. WMIX_GPIO_INTR_EVENTID,
  2036. WMIX_GPIO_DATA_EVENTID,
  2037. WMIX_GPIO_ACK_EVENTID,
  2038. WMIX_HB_CHALLENGE_RESP_EVENTID,
  2039. WMIX_DBGLOG_EVENTID,
  2040. WMIX_PROF_COUNT_EVENTID,
  2041. };
  2042. /*
  2043. * ------Error Detection support-------
  2044. */
  2045. /*
  2046. * WMIX_HB_CHALLENGE_RESP_CMDID
  2047. * Heartbeat Challenge Response command
  2048. */
  2049. struct wmix_hb_challenge_resp_cmd {
  2050. __le32 cookie;
  2051. __le32 source;
  2052. } __packed;
  2053. struct ath6kl_wmix_dbglog_cfg_module_cmd {
  2054. __le32 valid;
  2055. __le32 config;
  2056. } __packed;
  2057. /* End of Extended WMI (WMIX) */
  2058. enum wmi_sync_flag {
  2059. NO_SYNC_WMIFLAG = 0,
  2060. /* transmit all queued data before cmd */
  2061. SYNC_BEFORE_WMIFLAG,
  2062. /* any new data waits until cmd execs */
  2063. SYNC_AFTER_WMIFLAG,
  2064. SYNC_BOTH_WMIFLAG,
  2065. /* end marker */
  2066. END_WMIFLAG
  2067. };
  2068. enum htc_endpoint_id ath6kl_wmi_get_control_ep(struct wmi *wmi);
  2069. void ath6kl_wmi_set_control_ep(struct wmi *wmi, enum htc_endpoint_id ep_id);
  2070. int ath6kl_wmi_dix_2_dot3(struct wmi *wmi, struct sk_buff *skb);
  2071. int ath6kl_wmi_data_hdr_add(struct wmi *wmi, struct sk_buff *skb,
  2072. u8 msg_type, u32 flags,
  2073. enum wmi_data_hdr_data_type data_type,
  2074. u8 meta_ver, void *tx_meta_info, u8 if_idx);
  2075. int ath6kl_wmi_dot11_hdr_remove(struct wmi *wmi, struct sk_buff *skb);
  2076. int ath6kl_wmi_dot3_2_dix(struct sk_buff *skb);
  2077. int ath6kl_wmi_implicit_create_pstream(struct wmi *wmi, u8 if_idx,
  2078. struct sk_buff *skb, u32 layer2_priority,
  2079. bool wmm_enabled, u8 *ac);
  2080. int ath6kl_wmi_control_rx(struct wmi *wmi, struct sk_buff *skb);
  2081. int ath6kl_wmi_cmd_send(struct wmi *wmi, u8 if_idx, struct sk_buff *skb,
  2082. enum wmi_cmd_id cmd_id, enum wmi_sync_flag sync_flag);
  2083. int ath6kl_wmi_connect_cmd(struct wmi *wmi, u8 if_idx,
  2084. enum network_type nw_type,
  2085. enum dot11_auth_mode dot11_auth_mode,
  2086. enum auth_mode auth_mode,
  2087. enum ath6kl_crypto_type pairwise_crypto,
  2088. u8 pairwise_crypto_len,
  2089. enum ath6kl_crypto_type group_crypto,
  2090. u8 group_crypto_len, int ssid_len, u8 *ssid,
  2091. u8 *bssid, u16 channel, u32 ctrl_flags,
  2092. u8 nw_subtype);
  2093. int ath6kl_wmi_reconnect_cmd(struct wmi *wmi, u8 if_idx, u8 *bssid,
  2094. u16 channel);
  2095. int ath6kl_wmi_disconnect_cmd(struct wmi *wmi, u8 if_idx);
  2096. int ath6kl_wmi_beginscan_cmd(struct wmi *wmi, u8 if_idx,
  2097. enum wmi_scan_type scan_type,
  2098. u32 force_fgscan, u32 is_legacy,
  2099. u32 home_dwell_time, u32 force_scan_interval,
  2100. s8 num_chan, u16 *ch_list, u32 no_cck,
  2101. u32 *rates);
  2102. int ath6kl_wmi_enable_sched_scan_cmd(struct wmi *wmi, u8 if_idx, bool enable);
  2103. int ath6kl_wmi_scanparams_cmd(struct wmi *wmi, u8 if_idx, u16 fg_start_sec,
  2104. u16 fg_end_sec, u16 bg_sec,
  2105. u16 minact_chdw_msec, u16 maxact_chdw_msec,
  2106. u16 pas_chdw_msec, u8 short_scan_ratio,
  2107. u8 scan_ctrl_flag, u32 max_dfsch_act_time,
  2108. u16 maxact_scan_per_ssid);
  2109. int ath6kl_wmi_bssfilter_cmd(struct wmi *wmi, u8 if_idx, u8 filter,
  2110. u32 ie_mask);
  2111. int ath6kl_wmi_probedssid_cmd(struct wmi *wmi, u8 if_idx, u8 index, u8 flag,
  2112. u8 ssid_len, u8 *ssid);
  2113. int ath6kl_wmi_listeninterval_cmd(struct wmi *wmi, u8 if_idx,
  2114. u16 listen_interval,
  2115. u16 listen_beacons);
  2116. int ath6kl_wmi_bmisstime_cmd(struct wmi *wmi, u8 if_idx,
  2117. u16 bmiss_time, u16 num_beacons);
  2118. int ath6kl_wmi_powermode_cmd(struct wmi *wmi, u8 if_idx, u8 pwr_mode);
  2119. int ath6kl_wmi_pmparams_cmd(struct wmi *wmi, u8 if_idx, u16 idle_period,
  2120. u16 ps_poll_num, u16 dtim_policy,
  2121. u16 tx_wakup_policy, u16 num_tx_to_wakeup,
  2122. u16 ps_fail_event_policy);
  2123. int ath6kl_wmi_create_pstream_cmd(struct wmi *wmi, u8 if_idx,
  2124. struct wmi_create_pstream_cmd *pstream);
  2125. int ath6kl_wmi_delete_pstream_cmd(struct wmi *wmi, u8 if_idx, u8 traffic_class,
  2126. u8 tsid);
  2127. int ath6kl_wmi_disctimeout_cmd(struct wmi *wmi, u8 if_idx, u8 timeout);
  2128. int ath6kl_wmi_set_rts_cmd(struct wmi *wmi, u16 threshold);
  2129. int ath6kl_wmi_set_lpreamble_cmd(struct wmi *wmi, u8 if_idx, u8 status,
  2130. u8 preamble_policy);
  2131. int ath6kl_wmi_get_challenge_resp_cmd(struct wmi *wmi, u32 cookie, u32 source);
  2132. int ath6kl_wmi_config_debug_module_cmd(struct wmi *wmi, u32 valid, u32 config);
  2133. int ath6kl_wmi_get_stats_cmd(struct wmi *wmi, u8 if_idx);
  2134. int ath6kl_wmi_addkey_cmd(struct wmi *wmi, u8 if_idx, u8 key_index,
  2135. enum ath6kl_crypto_type key_type,
  2136. u8 key_usage, u8 key_len,
  2137. u8 *key_rsc, unsigned int key_rsc_len,
  2138. u8 *key_material,
  2139. u8 key_op_ctrl, u8 *mac_addr,
  2140. enum wmi_sync_flag sync_flag);
  2141. int ath6kl_wmi_add_krk_cmd(struct wmi *wmi, u8 if_idx, const u8 *krk);
  2142. int ath6kl_wmi_deletekey_cmd(struct wmi *wmi, u8 if_idx, u8 key_index);
  2143. int ath6kl_wmi_setpmkid_cmd(struct wmi *wmi, u8 if_idx, const u8 *bssid,
  2144. const u8 *pmkid, bool set);
  2145. int ath6kl_wmi_set_tx_pwr_cmd(struct wmi *wmi, u8 if_idx, u8 dbM);
  2146. int ath6kl_wmi_get_tx_pwr_cmd(struct wmi *wmi, u8 if_idx);
  2147. int ath6kl_wmi_get_roam_tbl_cmd(struct wmi *wmi);
  2148. int ath6kl_wmi_set_wmm_txop(struct wmi *wmi, u8 if_idx, enum wmi_txop_cfg cfg);
  2149. int ath6kl_wmi_set_keepalive_cmd(struct wmi *wmi, u8 if_idx,
  2150. u8 keep_alive_intvl);
  2151. int ath6kl_wmi_set_htcap_cmd(struct wmi *wmi, u8 if_idx,
  2152. enum nl80211_band band,
  2153. struct ath6kl_htcap *htcap);
  2154. int ath6kl_wmi_test_cmd(struct wmi *wmi, void *buf, size_t len);
  2155. s32 ath6kl_wmi_get_rate(struct wmi *wmi, s8 rate_index);
  2156. int ath6kl_wmi_set_ip_cmd(struct wmi *wmi, u8 if_idx,
  2157. __be32 ips0, __be32 ips1);
  2158. int ath6kl_wmi_set_host_sleep_mode_cmd(struct wmi *wmi, u8 if_idx,
  2159. enum ath6kl_host_mode host_mode);
  2160. int ath6kl_wmi_set_bitrate_mask(struct wmi *wmi, u8 if_idx,
  2161. const struct cfg80211_bitrate_mask *mask);
  2162. int ath6kl_wmi_set_wow_mode_cmd(struct wmi *wmi, u8 if_idx,
  2163. enum ath6kl_wow_mode wow_mode,
  2164. u32 filter, u16 host_req_delay);
  2165. int ath6kl_wmi_add_wow_pattern_cmd(struct wmi *wmi, u8 if_idx,
  2166. u8 list_id, u8 filter_size,
  2167. u8 filter_offset, const u8 *filter,
  2168. const u8 *mask);
  2169. int ath6kl_wmi_del_wow_pattern_cmd(struct wmi *wmi, u8 if_idx,
  2170. u16 list_id, u16 filter_id);
  2171. int ath6kl_wmi_set_rssi_filter_cmd(struct wmi *wmi, u8 if_idx, s8 rssi);
  2172. int ath6kl_wmi_set_roam_lrssi_cmd(struct wmi *wmi, u8 lrssi);
  2173. int ath6kl_wmi_ap_set_dtim_cmd(struct wmi *wmi, u8 if_idx, u32 dtim_period);
  2174. int ath6kl_wmi_ap_set_beacon_intvl_cmd(struct wmi *wmi, u8 if_idx,
  2175. u32 beacon_interval);
  2176. int ath6kl_wmi_force_roam_cmd(struct wmi *wmi, const u8 *bssid);
  2177. int ath6kl_wmi_set_roam_mode_cmd(struct wmi *wmi, enum wmi_roam_mode mode);
  2178. int ath6kl_wmi_mcast_filter_cmd(struct wmi *wmi, u8 if_idx, bool mc_all_on);
  2179. int ath6kl_wmi_add_del_mcast_filter_cmd(struct wmi *wmi, u8 if_idx,
  2180. u8 *filter, bool add_filter);
  2181. int ath6kl_wmi_sta_bmiss_enhance_cmd(struct wmi *wmi, u8 if_idx, bool enable);
  2182. int ath6kl_wmi_set_txe_notify(struct wmi *wmi, u8 idx,
  2183. u32 rate, u32 pkts, u32 intvl);
  2184. int ath6kl_wmi_set_regdomain_cmd(struct wmi *wmi, const char *alpha2);
  2185. /* AP mode uAPSD */
  2186. int ath6kl_wmi_ap_set_apsd(struct wmi *wmi, u8 if_idx, u8 enable);
  2187. int ath6kl_wmi_set_apsd_bfrd_traf(struct wmi *wmi,
  2188. u8 if_idx, u16 aid,
  2189. u16 bitmap, u32 flags);
  2190. u8 ath6kl_wmi_get_traffic_class(u8 user_priority);
  2191. u8 ath6kl_wmi_determine_user_priority(u8 *pkt, u32 layer2_pri);
  2192. /* AP mode */
  2193. int ath6kl_wmi_ap_hidden_ssid(struct wmi *wmi, u8 if_idx, bool enable);
  2194. int ath6kl_wmi_ap_profile_commit(struct wmi *wmip, u8 if_idx,
  2195. struct wmi_connect_cmd *p);
  2196. int ath6kl_wmi_ap_set_mlme(struct wmi *wmip, u8 if_idx, u8 cmd,
  2197. const u8 *mac, u16 reason);
  2198. int ath6kl_wmi_set_pvb_cmd(struct wmi *wmi, u8 if_idx, u16 aid, bool flag);
  2199. int ath6kl_wmi_set_rx_frame_format_cmd(struct wmi *wmi, u8 if_idx,
  2200. u8 rx_meta_version,
  2201. bool rx_dot11_hdr, bool defrag_on_host);
  2202. int ath6kl_wmi_set_appie_cmd(struct wmi *wmi, u8 if_idx, u8 mgmt_frm_type,
  2203. const u8 *ie, u8 ie_len);
  2204. int ath6kl_wmi_set_ie_cmd(struct wmi *wmi, u8 if_idx, u8 ie_id, u8 ie_field,
  2205. const u8 *ie_info, u8 ie_len);
  2206. /* P2P */
  2207. int ath6kl_wmi_disable_11b_rates_cmd(struct wmi *wmi, bool disable);
  2208. int ath6kl_wmi_remain_on_chnl_cmd(struct wmi *wmi, u8 if_idx, u32 freq,
  2209. u32 dur);
  2210. int ath6kl_wmi_send_mgmt_cmd(struct wmi *wmi, u8 if_idx, u32 id, u32 freq,
  2211. u32 wait, const u8 *data, u16 data_len,
  2212. u32 no_cck);
  2213. int ath6kl_wmi_send_probe_response_cmd(struct wmi *wmi, u8 if_idx, u32 freq,
  2214. const u8 *dst, const u8 *data,
  2215. u16 data_len);
  2216. int ath6kl_wmi_probe_report_req_cmd(struct wmi *wmi, u8 if_idx, bool enable);
  2217. int ath6kl_wmi_info_req_cmd(struct wmi *wmi, u8 if_idx, u32 info_req_flags);
  2218. int ath6kl_wmi_cancel_remain_on_chnl_cmd(struct wmi *wmi, u8 if_idx);
  2219. int ath6kl_wmi_set_appie_cmd(struct wmi *wmi, u8 if_idx, u8 mgmt_frm_type,
  2220. const u8 *ie, u8 ie_len);
  2221. int ath6kl_wmi_set_inact_period(struct wmi *wmi, u8 if_idx, int inact_timeout);
  2222. void ath6kl_wmi_sscan_timer(struct timer_list *t);
  2223. int ath6kl_wmi_get_challenge_resp_cmd(struct wmi *wmi, u32 cookie, u32 source);
  2224. struct ath6kl_vif *ath6kl_get_vif_by_index(struct ath6kl *ar, u8 if_idx);
  2225. void *ath6kl_wmi_init(struct ath6kl *devt);
  2226. void ath6kl_wmi_shutdown(struct wmi *wmi);
  2227. void ath6kl_wmi_reset(struct wmi *wmi);
  2228. #endif /* WMI_H */