wmi.h 114 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079
  1. /*
  2. * Copyright (c) 2005-2011 Atheros Communications Inc.
  3. * Copyright (c) 2011-2013 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. #ifndef _WMI_H_
  18. #define _WMI_H_
  19. #include <linux/types.h>
  20. #include <net/mac80211.h>
  21. /*
  22. * This file specifies the WMI interface for the Unified Software
  23. * Architecture.
  24. *
  25. * It includes definitions of all the commands and events. Commands are
  26. * messages from the host to the target. Events and Replies are messages
  27. * from the target to the host.
  28. *
  29. * Ownership of correctness in regards to WMI commands belongs to the host
  30. * driver and the target is not required to validate parameters for value,
  31. * proper range, or any other checking.
  32. *
  33. * Guidelines for extending this interface are below.
  34. *
  35. * 1. Add new WMI commands ONLY within the specified range - 0x9000 - 0x9fff
  36. *
  37. * 2. Use ONLY u32 type for defining member variables within WMI
  38. * command/event structures. Do not use u8, u16, bool or
  39. * enum types within these structures.
  40. *
  41. * 3. DO NOT define bit fields within structures. Implement bit fields
  42. * using masks if necessary. Do not use the programming language's bit
  43. * field definition.
  44. *
  45. * 4. Define macros for encode/decode of u8, u16 fields within
  46. * the u32 variables. Use these macros for set/get of these fields.
  47. * Try to use this to optimize the structure without bloating it with
  48. * u32 variables for every lower sized field.
  49. *
  50. * 5. Do not use PACK/UNPACK attributes for the structures as each member
  51. * variable is already 4-byte aligned by virtue of being a u32
  52. * type.
  53. *
  54. * 6. Comment each parameter part of the WMI command/event structure by
  55. * using the 2 stars at the begining of C comment instead of one star to
  56. * enable HTML document generation using Doxygen.
  57. *
  58. */
  59. /* Control Path */
  60. struct wmi_cmd_hdr {
  61. __le32 cmd_id;
  62. } __packed;
  63. #define WMI_CMD_HDR_CMD_ID_MASK 0x00FFFFFF
  64. #define WMI_CMD_HDR_CMD_ID_LSB 0
  65. #define WMI_CMD_HDR_PLT_PRIV_MASK 0xFF000000
  66. #define WMI_CMD_HDR_PLT_PRIV_LSB 24
  67. #define HTC_PROTOCOL_VERSION 0x0002
  68. #define WMI_PROTOCOL_VERSION 0x0002
  69. enum wmi_service_id {
  70. WMI_SERVICE_BEACON_OFFLOAD = 0, /* beacon offload */
  71. WMI_SERVICE_SCAN_OFFLOAD, /* scan offload */
  72. WMI_SERVICE_ROAM_OFFLOAD, /* roam offload */
  73. WMI_SERVICE_BCN_MISS_OFFLOAD, /* beacon miss offload */
  74. WMI_SERVICE_STA_PWRSAVE, /* fake sleep + basic power save */
  75. WMI_SERVICE_STA_ADVANCED_PWRSAVE, /* uapsd, pspoll, force sleep */
  76. WMI_SERVICE_AP_UAPSD, /* uapsd on AP */
  77. WMI_SERVICE_AP_DFS, /* DFS on AP */
  78. WMI_SERVICE_11AC, /* supports 11ac */
  79. WMI_SERVICE_BLOCKACK, /* Supports triggering ADDBA/DELBA from host*/
  80. WMI_SERVICE_PHYERR, /* PHY error */
  81. WMI_SERVICE_BCN_FILTER, /* Beacon filter support */
  82. WMI_SERVICE_RTT, /* RTT (round trip time) support */
  83. WMI_SERVICE_RATECTRL, /* Rate-control */
  84. WMI_SERVICE_WOW, /* WOW Support */
  85. WMI_SERVICE_RATECTRL_CACHE, /* Rate-control caching */
  86. WMI_SERVICE_IRAM_TIDS, /* TIDs in IRAM */
  87. WMI_SERVICE_ARPNS_OFFLOAD, /* ARP NS Offload support */
  88. WMI_SERVICE_NLO, /* Network list offload service */
  89. WMI_SERVICE_GTK_OFFLOAD, /* GTK offload */
  90. WMI_SERVICE_SCAN_SCH, /* Scan Scheduler Service */
  91. WMI_SERVICE_CSA_OFFLOAD, /* CSA offload service */
  92. WMI_SERVICE_CHATTER, /* Chatter service */
  93. WMI_SERVICE_COEX_FREQAVOID, /* FW report freq range to avoid */
  94. WMI_SERVICE_PACKET_POWER_SAVE, /* packet power save service */
  95. WMI_SERVICE_FORCE_FW_HANG, /* To test fw recovery mechanism */
  96. WMI_SERVICE_GPIO, /* GPIO service */
  97. WMI_SERVICE_STA_DTIM_PS_MODULATED_DTIM, /* Modulated DTIM support */
  98. WMI_STA_UAPSD_BASIC_AUTO_TRIG, /* UAPSD AC Trigger Generation */
  99. WMI_STA_UAPSD_VAR_AUTO_TRIG, /* -do- */
  100. WMI_SERVICE_STA_KEEP_ALIVE, /* STA keep alive mechanism support */
  101. WMI_SERVICE_TX_ENCAP, /* Packet type for TX encapsulation */
  102. WMI_SERVICE_LAST,
  103. WMI_MAX_SERVICE = 64 /* max service */
  104. };
  105. static inline char *wmi_service_name(int service_id)
  106. {
  107. switch (service_id) {
  108. case WMI_SERVICE_BEACON_OFFLOAD:
  109. return "BEACON_OFFLOAD";
  110. case WMI_SERVICE_SCAN_OFFLOAD:
  111. return "SCAN_OFFLOAD";
  112. case WMI_SERVICE_ROAM_OFFLOAD:
  113. return "ROAM_OFFLOAD";
  114. case WMI_SERVICE_BCN_MISS_OFFLOAD:
  115. return "BCN_MISS_OFFLOAD";
  116. case WMI_SERVICE_STA_PWRSAVE:
  117. return "STA_PWRSAVE";
  118. case WMI_SERVICE_STA_ADVANCED_PWRSAVE:
  119. return "STA_ADVANCED_PWRSAVE";
  120. case WMI_SERVICE_AP_UAPSD:
  121. return "AP_UAPSD";
  122. case WMI_SERVICE_AP_DFS:
  123. return "AP_DFS";
  124. case WMI_SERVICE_11AC:
  125. return "11AC";
  126. case WMI_SERVICE_BLOCKACK:
  127. return "BLOCKACK";
  128. case WMI_SERVICE_PHYERR:
  129. return "PHYERR";
  130. case WMI_SERVICE_BCN_FILTER:
  131. return "BCN_FILTER";
  132. case WMI_SERVICE_RTT:
  133. return "RTT";
  134. case WMI_SERVICE_RATECTRL:
  135. return "RATECTRL";
  136. case WMI_SERVICE_WOW:
  137. return "WOW";
  138. case WMI_SERVICE_RATECTRL_CACHE:
  139. return "RATECTRL CACHE";
  140. case WMI_SERVICE_IRAM_TIDS:
  141. return "IRAM TIDS";
  142. case WMI_SERVICE_ARPNS_OFFLOAD:
  143. return "ARPNS_OFFLOAD";
  144. case WMI_SERVICE_NLO:
  145. return "NLO";
  146. case WMI_SERVICE_GTK_OFFLOAD:
  147. return "GTK_OFFLOAD";
  148. case WMI_SERVICE_SCAN_SCH:
  149. return "SCAN_SCH";
  150. case WMI_SERVICE_CSA_OFFLOAD:
  151. return "CSA_OFFLOAD";
  152. case WMI_SERVICE_CHATTER:
  153. return "CHATTER";
  154. case WMI_SERVICE_COEX_FREQAVOID:
  155. return "COEX_FREQAVOID";
  156. case WMI_SERVICE_PACKET_POWER_SAVE:
  157. return "PACKET_POWER_SAVE";
  158. case WMI_SERVICE_FORCE_FW_HANG:
  159. return "FORCE FW HANG";
  160. case WMI_SERVICE_GPIO:
  161. return "GPIO";
  162. case WMI_SERVICE_STA_DTIM_PS_MODULATED_DTIM:
  163. return "MODULATED DTIM";
  164. case WMI_STA_UAPSD_BASIC_AUTO_TRIG:
  165. return "BASIC UAPSD";
  166. case WMI_STA_UAPSD_VAR_AUTO_TRIG:
  167. return "VAR UAPSD";
  168. case WMI_SERVICE_STA_KEEP_ALIVE:
  169. return "STA KEEP ALIVE";
  170. case WMI_SERVICE_TX_ENCAP:
  171. return "TX ENCAP";
  172. default:
  173. return "UNKNOWN SERVICE\n";
  174. }
  175. }
  176. #define WMI_SERVICE_BM_SIZE \
  177. ((WMI_MAX_SERVICE + sizeof(u32) - 1)/sizeof(u32))
  178. /* 2 word representation of MAC addr */
  179. struct wmi_mac_addr {
  180. union {
  181. u8 addr[6];
  182. struct {
  183. u32 word0;
  184. u32 word1;
  185. } __packed;
  186. } __packed;
  187. } __packed;
  188. /* macro to convert MAC address from WMI word format to char array */
  189. #define WMI_MAC_ADDR_TO_CHAR_ARRAY(pwmi_mac_addr, c_macaddr) do { \
  190. (c_macaddr)[0] = ((pwmi_mac_addr)->word0) & 0xff; \
  191. (c_macaddr)[1] = (((pwmi_mac_addr)->word0) >> 8) & 0xff; \
  192. (c_macaddr)[2] = (((pwmi_mac_addr)->word0) >> 16) & 0xff; \
  193. (c_macaddr)[3] = (((pwmi_mac_addr)->word0) >> 24) & 0xff; \
  194. (c_macaddr)[4] = ((pwmi_mac_addr)->word1) & 0xff; \
  195. (c_macaddr)[5] = (((pwmi_mac_addr)->word1) >> 8) & 0xff; \
  196. } while (0)
  197. struct wmi_cmd_map {
  198. u32 init_cmdid;
  199. u32 start_scan_cmdid;
  200. u32 stop_scan_cmdid;
  201. u32 scan_chan_list_cmdid;
  202. u32 scan_sch_prio_tbl_cmdid;
  203. u32 pdev_set_regdomain_cmdid;
  204. u32 pdev_set_channel_cmdid;
  205. u32 pdev_set_param_cmdid;
  206. u32 pdev_pktlog_enable_cmdid;
  207. u32 pdev_pktlog_disable_cmdid;
  208. u32 pdev_set_wmm_params_cmdid;
  209. u32 pdev_set_ht_cap_ie_cmdid;
  210. u32 pdev_set_vht_cap_ie_cmdid;
  211. u32 pdev_set_dscp_tid_map_cmdid;
  212. u32 pdev_set_quiet_mode_cmdid;
  213. u32 pdev_green_ap_ps_enable_cmdid;
  214. u32 pdev_get_tpc_config_cmdid;
  215. u32 pdev_set_base_macaddr_cmdid;
  216. u32 vdev_create_cmdid;
  217. u32 vdev_delete_cmdid;
  218. u32 vdev_start_request_cmdid;
  219. u32 vdev_restart_request_cmdid;
  220. u32 vdev_up_cmdid;
  221. u32 vdev_stop_cmdid;
  222. u32 vdev_down_cmdid;
  223. u32 vdev_set_param_cmdid;
  224. u32 vdev_install_key_cmdid;
  225. u32 peer_create_cmdid;
  226. u32 peer_delete_cmdid;
  227. u32 peer_flush_tids_cmdid;
  228. u32 peer_set_param_cmdid;
  229. u32 peer_assoc_cmdid;
  230. u32 peer_add_wds_entry_cmdid;
  231. u32 peer_remove_wds_entry_cmdid;
  232. u32 peer_mcast_group_cmdid;
  233. u32 bcn_tx_cmdid;
  234. u32 pdev_send_bcn_cmdid;
  235. u32 bcn_tmpl_cmdid;
  236. u32 bcn_filter_rx_cmdid;
  237. u32 prb_req_filter_rx_cmdid;
  238. u32 mgmt_tx_cmdid;
  239. u32 prb_tmpl_cmdid;
  240. u32 addba_clear_resp_cmdid;
  241. u32 addba_send_cmdid;
  242. u32 addba_status_cmdid;
  243. u32 delba_send_cmdid;
  244. u32 addba_set_resp_cmdid;
  245. u32 send_singleamsdu_cmdid;
  246. u32 sta_powersave_mode_cmdid;
  247. u32 sta_powersave_param_cmdid;
  248. u32 sta_mimo_ps_mode_cmdid;
  249. u32 pdev_dfs_enable_cmdid;
  250. u32 pdev_dfs_disable_cmdid;
  251. u32 roam_scan_mode;
  252. u32 roam_scan_rssi_threshold;
  253. u32 roam_scan_period;
  254. u32 roam_scan_rssi_change_threshold;
  255. u32 roam_ap_profile;
  256. u32 ofl_scan_add_ap_profile;
  257. u32 ofl_scan_remove_ap_profile;
  258. u32 ofl_scan_period;
  259. u32 p2p_dev_set_device_info;
  260. u32 p2p_dev_set_discoverability;
  261. u32 p2p_go_set_beacon_ie;
  262. u32 p2p_go_set_probe_resp_ie;
  263. u32 p2p_set_vendor_ie_data_cmdid;
  264. u32 ap_ps_peer_param_cmdid;
  265. u32 ap_ps_peer_uapsd_coex_cmdid;
  266. u32 peer_rate_retry_sched_cmdid;
  267. u32 wlan_profile_trigger_cmdid;
  268. u32 wlan_profile_set_hist_intvl_cmdid;
  269. u32 wlan_profile_get_profile_data_cmdid;
  270. u32 wlan_profile_enable_profile_id_cmdid;
  271. u32 wlan_profile_list_profile_id_cmdid;
  272. u32 pdev_suspend_cmdid;
  273. u32 pdev_resume_cmdid;
  274. u32 add_bcn_filter_cmdid;
  275. u32 rmv_bcn_filter_cmdid;
  276. u32 wow_add_wake_pattern_cmdid;
  277. u32 wow_del_wake_pattern_cmdid;
  278. u32 wow_enable_disable_wake_event_cmdid;
  279. u32 wow_enable_cmdid;
  280. u32 wow_hostwakeup_from_sleep_cmdid;
  281. u32 rtt_measreq_cmdid;
  282. u32 rtt_tsf_cmdid;
  283. u32 vdev_spectral_scan_configure_cmdid;
  284. u32 vdev_spectral_scan_enable_cmdid;
  285. u32 request_stats_cmdid;
  286. u32 set_arp_ns_offload_cmdid;
  287. u32 network_list_offload_config_cmdid;
  288. u32 gtk_offload_cmdid;
  289. u32 csa_offload_enable_cmdid;
  290. u32 csa_offload_chanswitch_cmdid;
  291. u32 chatter_set_mode_cmdid;
  292. u32 peer_tid_addba_cmdid;
  293. u32 peer_tid_delba_cmdid;
  294. u32 sta_dtim_ps_method_cmdid;
  295. u32 sta_uapsd_auto_trig_cmdid;
  296. u32 sta_keepalive_cmd;
  297. u32 echo_cmdid;
  298. u32 pdev_utf_cmdid;
  299. u32 dbglog_cfg_cmdid;
  300. u32 pdev_qvit_cmdid;
  301. u32 pdev_ftm_intg_cmdid;
  302. u32 vdev_set_keepalive_cmdid;
  303. u32 vdev_get_keepalive_cmdid;
  304. u32 force_fw_hang_cmdid;
  305. u32 gpio_config_cmdid;
  306. u32 gpio_output_cmdid;
  307. };
  308. /*
  309. * wmi command groups.
  310. */
  311. enum wmi_cmd_group {
  312. /* 0 to 2 are reserved */
  313. WMI_GRP_START = 0x3,
  314. WMI_GRP_SCAN = WMI_GRP_START,
  315. WMI_GRP_PDEV,
  316. WMI_GRP_VDEV,
  317. WMI_GRP_PEER,
  318. WMI_GRP_MGMT,
  319. WMI_GRP_BA_NEG,
  320. WMI_GRP_STA_PS,
  321. WMI_GRP_DFS,
  322. WMI_GRP_ROAM,
  323. WMI_GRP_OFL_SCAN,
  324. WMI_GRP_P2P,
  325. WMI_GRP_AP_PS,
  326. WMI_GRP_RATE_CTRL,
  327. WMI_GRP_PROFILE,
  328. WMI_GRP_SUSPEND,
  329. WMI_GRP_BCN_FILTER,
  330. WMI_GRP_WOW,
  331. WMI_GRP_RTT,
  332. WMI_GRP_SPECTRAL,
  333. WMI_GRP_STATS,
  334. WMI_GRP_ARP_NS_OFL,
  335. WMI_GRP_NLO_OFL,
  336. WMI_GRP_GTK_OFL,
  337. WMI_GRP_CSA_OFL,
  338. WMI_GRP_CHATTER,
  339. WMI_GRP_TID_ADDBA,
  340. WMI_GRP_MISC,
  341. WMI_GRP_GPIO,
  342. };
  343. #define WMI_CMD_GRP(grp_id) (((grp_id) << 12) | 0x1)
  344. #define WMI_EVT_GRP_START_ID(grp_id) (((grp_id) << 12) | 0x1)
  345. #define WMI_CMD_UNSUPPORTED 0
  346. /* Command IDs and command events for MAIN FW. */
  347. enum wmi_cmd_id {
  348. WMI_INIT_CMDID = 0x1,
  349. /* Scan specific commands */
  350. WMI_START_SCAN_CMDID = WMI_CMD_GRP(WMI_GRP_SCAN),
  351. WMI_STOP_SCAN_CMDID,
  352. WMI_SCAN_CHAN_LIST_CMDID,
  353. WMI_SCAN_SCH_PRIO_TBL_CMDID,
  354. /* PDEV (physical device) specific commands */
  355. WMI_PDEV_SET_REGDOMAIN_CMDID = WMI_CMD_GRP(WMI_GRP_PDEV),
  356. WMI_PDEV_SET_CHANNEL_CMDID,
  357. WMI_PDEV_SET_PARAM_CMDID,
  358. WMI_PDEV_PKTLOG_ENABLE_CMDID,
  359. WMI_PDEV_PKTLOG_DISABLE_CMDID,
  360. WMI_PDEV_SET_WMM_PARAMS_CMDID,
  361. WMI_PDEV_SET_HT_CAP_IE_CMDID,
  362. WMI_PDEV_SET_VHT_CAP_IE_CMDID,
  363. WMI_PDEV_SET_DSCP_TID_MAP_CMDID,
  364. WMI_PDEV_SET_QUIET_MODE_CMDID,
  365. WMI_PDEV_GREEN_AP_PS_ENABLE_CMDID,
  366. WMI_PDEV_GET_TPC_CONFIG_CMDID,
  367. WMI_PDEV_SET_BASE_MACADDR_CMDID,
  368. /* VDEV (virtual device) specific commands */
  369. WMI_VDEV_CREATE_CMDID = WMI_CMD_GRP(WMI_GRP_VDEV),
  370. WMI_VDEV_DELETE_CMDID,
  371. WMI_VDEV_START_REQUEST_CMDID,
  372. WMI_VDEV_RESTART_REQUEST_CMDID,
  373. WMI_VDEV_UP_CMDID,
  374. WMI_VDEV_STOP_CMDID,
  375. WMI_VDEV_DOWN_CMDID,
  376. WMI_VDEV_SET_PARAM_CMDID,
  377. WMI_VDEV_INSTALL_KEY_CMDID,
  378. /* peer specific commands */
  379. WMI_PEER_CREATE_CMDID = WMI_CMD_GRP(WMI_GRP_PEER),
  380. WMI_PEER_DELETE_CMDID,
  381. WMI_PEER_FLUSH_TIDS_CMDID,
  382. WMI_PEER_SET_PARAM_CMDID,
  383. WMI_PEER_ASSOC_CMDID,
  384. WMI_PEER_ADD_WDS_ENTRY_CMDID,
  385. WMI_PEER_REMOVE_WDS_ENTRY_CMDID,
  386. WMI_PEER_MCAST_GROUP_CMDID,
  387. /* beacon/management specific commands */
  388. WMI_BCN_TX_CMDID = WMI_CMD_GRP(WMI_GRP_MGMT),
  389. WMI_PDEV_SEND_BCN_CMDID,
  390. WMI_BCN_TMPL_CMDID,
  391. WMI_BCN_FILTER_RX_CMDID,
  392. WMI_PRB_REQ_FILTER_RX_CMDID,
  393. WMI_MGMT_TX_CMDID,
  394. WMI_PRB_TMPL_CMDID,
  395. /* commands to directly control BA negotiation directly from host. */
  396. WMI_ADDBA_CLEAR_RESP_CMDID = WMI_CMD_GRP(WMI_GRP_BA_NEG),
  397. WMI_ADDBA_SEND_CMDID,
  398. WMI_ADDBA_STATUS_CMDID,
  399. WMI_DELBA_SEND_CMDID,
  400. WMI_ADDBA_SET_RESP_CMDID,
  401. WMI_SEND_SINGLEAMSDU_CMDID,
  402. /* Station power save specific config */
  403. WMI_STA_POWERSAVE_MODE_CMDID = WMI_CMD_GRP(WMI_GRP_STA_PS),
  404. WMI_STA_POWERSAVE_PARAM_CMDID,
  405. WMI_STA_MIMO_PS_MODE_CMDID,
  406. /** DFS-specific commands */
  407. WMI_PDEV_DFS_ENABLE_CMDID = WMI_CMD_GRP(WMI_GRP_DFS),
  408. WMI_PDEV_DFS_DISABLE_CMDID,
  409. /* Roaming specific commands */
  410. WMI_ROAM_SCAN_MODE = WMI_CMD_GRP(WMI_GRP_ROAM),
  411. WMI_ROAM_SCAN_RSSI_THRESHOLD,
  412. WMI_ROAM_SCAN_PERIOD,
  413. WMI_ROAM_SCAN_RSSI_CHANGE_THRESHOLD,
  414. WMI_ROAM_AP_PROFILE,
  415. /* offload scan specific commands */
  416. WMI_OFL_SCAN_ADD_AP_PROFILE = WMI_CMD_GRP(WMI_GRP_OFL_SCAN),
  417. WMI_OFL_SCAN_REMOVE_AP_PROFILE,
  418. WMI_OFL_SCAN_PERIOD,
  419. /* P2P specific commands */
  420. WMI_P2P_DEV_SET_DEVICE_INFO = WMI_CMD_GRP(WMI_GRP_P2P),
  421. WMI_P2P_DEV_SET_DISCOVERABILITY,
  422. WMI_P2P_GO_SET_BEACON_IE,
  423. WMI_P2P_GO_SET_PROBE_RESP_IE,
  424. WMI_P2P_SET_VENDOR_IE_DATA_CMDID,
  425. /* AP power save specific config */
  426. WMI_AP_PS_PEER_PARAM_CMDID = WMI_CMD_GRP(WMI_GRP_AP_PS),
  427. WMI_AP_PS_PEER_UAPSD_COEX_CMDID,
  428. /* Rate-control specific commands */
  429. WMI_PEER_RATE_RETRY_SCHED_CMDID =
  430. WMI_CMD_GRP(WMI_GRP_RATE_CTRL),
  431. /* WLAN Profiling commands. */
  432. WMI_WLAN_PROFILE_TRIGGER_CMDID = WMI_CMD_GRP(WMI_GRP_PROFILE),
  433. WMI_WLAN_PROFILE_SET_HIST_INTVL_CMDID,
  434. WMI_WLAN_PROFILE_GET_PROFILE_DATA_CMDID,
  435. WMI_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID,
  436. WMI_WLAN_PROFILE_LIST_PROFILE_ID_CMDID,
  437. /* Suspend resume command Ids */
  438. WMI_PDEV_SUSPEND_CMDID = WMI_CMD_GRP(WMI_GRP_SUSPEND),
  439. WMI_PDEV_RESUME_CMDID,
  440. /* Beacon filter commands */
  441. WMI_ADD_BCN_FILTER_CMDID = WMI_CMD_GRP(WMI_GRP_BCN_FILTER),
  442. WMI_RMV_BCN_FILTER_CMDID,
  443. /* WOW Specific WMI commands*/
  444. WMI_WOW_ADD_WAKE_PATTERN_CMDID = WMI_CMD_GRP(WMI_GRP_WOW),
  445. WMI_WOW_DEL_WAKE_PATTERN_CMDID,
  446. WMI_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID,
  447. WMI_WOW_ENABLE_CMDID,
  448. WMI_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID,
  449. /* RTT measurement related cmd */
  450. WMI_RTT_MEASREQ_CMDID = WMI_CMD_GRP(WMI_GRP_RTT),
  451. WMI_RTT_TSF_CMDID,
  452. /* spectral scan commands */
  453. WMI_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID = WMI_CMD_GRP(WMI_GRP_SPECTRAL),
  454. WMI_VDEV_SPECTRAL_SCAN_ENABLE_CMDID,
  455. /* F/W stats */
  456. WMI_REQUEST_STATS_CMDID = WMI_CMD_GRP(WMI_GRP_STATS),
  457. /* ARP OFFLOAD REQUEST*/
  458. WMI_SET_ARP_NS_OFFLOAD_CMDID = WMI_CMD_GRP(WMI_GRP_ARP_NS_OFL),
  459. /* NS offload confid*/
  460. WMI_NETWORK_LIST_OFFLOAD_CONFIG_CMDID = WMI_CMD_GRP(WMI_GRP_NLO_OFL),
  461. /* GTK offload Specific WMI commands*/
  462. WMI_GTK_OFFLOAD_CMDID = WMI_CMD_GRP(WMI_GRP_GTK_OFL),
  463. /* CSA offload Specific WMI commands*/
  464. WMI_CSA_OFFLOAD_ENABLE_CMDID = WMI_CMD_GRP(WMI_GRP_CSA_OFL),
  465. WMI_CSA_OFFLOAD_CHANSWITCH_CMDID,
  466. /* Chatter commands*/
  467. WMI_CHATTER_SET_MODE_CMDID = WMI_CMD_GRP(WMI_GRP_CHATTER),
  468. /* addba specific commands */
  469. WMI_PEER_TID_ADDBA_CMDID = WMI_CMD_GRP(WMI_GRP_TID_ADDBA),
  470. WMI_PEER_TID_DELBA_CMDID,
  471. /* set station mimo powersave method */
  472. WMI_STA_DTIM_PS_METHOD_CMDID,
  473. /* Configure the Station UAPSD AC Auto Trigger Parameters */
  474. WMI_STA_UAPSD_AUTO_TRIG_CMDID,
  475. /* STA Keep alive parameter configuration,
  476. Requires WMI_SERVICE_STA_KEEP_ALIVE */
  477. WMI_STA_KEEPALIVE_CMD,
  478. /* misc command group */
  479. WMI_ECHO_CMDID = WMI_CMD_GRP(WMI_GRP_MISC),
  480. WMI_PDEV_UTF_CMDID,
  481. WMI_DBGLOG_CFG_CMDID,
  482. WMI_PDEV_QVIT_CMDID,
  483. WMI_PDEV_FTM_INTG_CMDID,
  484. WMI_VDEV_SET_KEEPALIVE_CMDID,
  485. WMI_VDEV_GET_KEEPALIVE_CMDID,
  486. WMI_FORCE_FW_HANG_CMDID,
  487. /* GPIO Configuration */
  488. WMI_GPIO_CONFIG_CMDID = WMI_CMD_GRP(WMI_GRP_GPIO),
  489. WMI_GPIO_OUTPUT_CMDID,
  490. };
  491. enum wmi_event_id {
  492. WMI_SERVICE_READY_EVENTID = 0x1,
  493. WMI_READY_EVENTID,
  494. /* Scan specific events */
  495. WMI_SCAN_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_SCAN),
  496. /* PDEV specific events */
  497. WMI_PDEV_TPC_CONFIG_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_PDEV),
  498. WMI_CHAN_INFO_EVENTID,
  499. WMI_PHYERR_EVENTID,
  500. /* VDEV specific events */
  501. WMI_VDEV_START_RESP_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_VDEV),
  502. WMI_VDEV_STOPPED_EVENTID,
  503. WMI_VDEV_INSTALL_KEY_COMPLETE_EVENTID,
  504. /* peer specific events */
  505. WMI_PEER_STA_KICKOUT_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_PEER),
  506. /* beacon/mgmt specific events */
  507. WMI_MGMT_RX_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_MGMT),
  508. WMI_HOST_SWBA_EVENTID,
  509. WMI_TBTTOFFSET_UPDATE_EVENTID,
  510. /* ADDBA Related WMI Events*/
  511. WMI_TX_DELBA_COMPLETE_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_BA_NEG),
  512. WMI_TX_ADDBA_COMPLETE_EVENTID,
  513. /* Roam event to trigger roaming on host */
  514. WMI_ROAM_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_ROAM),
  515. WMI_PROFILE_MATCH,
  516. /* WoW */
  517. WMI_WOW_WAKEUP_HOST_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_WOW),
  518. /* RTT */
  519. WMI_RTT_MEASUREMENT_REPORT_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_RTT),
  520. WMI_TSF_MEASUREMENT_REPORT_EVENTID,
  521. WMI_RTT_ERROR_REPORT_EVENTID,
  522. /* GTK offload */
  523. WMI_GTK_OFFLOAD_STATUS_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_GTK_OFL),
  524. WMI_GTK_REKEY_FAIL_EVENTID,
  525. /* CSA IE received event */
  526. WMI_CSA_HANDLING_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_CSA_OFL),
  527. /* Misc events */
  528. WMI_ECHO_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_MISC),
  529. WMI_PDEV_UTF_EVENTID,
  530. WMI_DEBUG_MESG_EVENTID,
  531. WMI_UPDATE_STATS_EVENTID,
  532. WMI_DEBUG_PRINT_EVENTID,
  533. WMI_DCS_INTERFERENCE_EVENTID,
  534. WMI_PDEV_QVIT_EVENTID,
  535. WMI_WLAN_PROFILE_DATA_EVENTID,
  536. WMI_PDEV_FTM_INTG_EVENTID,
  537. WMI_WLAN_FREQ_AVOID_EVENTID,
  538. WMI_VDEV_GET_KEEPALIVE_EVENTID,
  539. /* GPIO Event */
  540. WMI_GPIO_INPUT_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_GPIO),
  541. };
  542. /* Command IDs and command events for 10.X firmware */
  543. enum wmi_10x_cmd_id {
  544. WMI_10X_START_CMDID = 0x9000,
  545. WMI_10X_END_CMDID = 0x9FFF,
  546. /* initialize the wlan sub system */
  547. WMI_10X_INIT_CMDID,
  548. /* Scan specific commands */
  549. WMI_10X_START_SCAN_CMDID = WMI_10X_START_CMDID,
  550. WMI_10X_STOP_SCAN_CMDID,
  551. WMI_10X_SCAN_CHAN_LIST_CMDID,
  552. WMI_10X_ECHO_CMDID,
  553. /* PDEV(physical device) specific commands */
  554. WMI_10X_PDEV_SET_REGDOMAIN_CMDID,
  555. WMI_10X_PDEV_SET_CHANNEL_CMDID,
  556. WMI_10X_PDEV_SET_PARAM_CMDID,
  557. WMI_10X_PDEV_PKTLOG_ENABLE_CMDID,
  558. WMI_10X_PDEV_PKTLOG_DISABLE_CMDID,
  559. WMI_10X_PDEV_SET_WMM_PARAMS_CMDID,
  560. WMI_10X_PDEV_SET_HT_CAP_IE_CMDID,
  561. WMI_10X_PDEV_SET_VHT_CAP_IE_CMDID,
  562. WMI_10X_PDEV_SET_BASE_MACADDR_CMDID,
  563. WMI_10X_PDEV_SET_DSCP_TID_MAP_CMDID,
  564. WMI_10X_PDEV_SET_QUIET_MODE_CMDID,
  565. WMI_10X_PDEV_GREEN_AP_PS_ENABLE_CMDID,
  566. WMI_10X_PDEV_GET_TPC_CONFIG_CMDID,
  567. /* VDEV(virtual device) specific commands */
  568. WMI_10X_VDEV_CREATE_CMDID,
  569. WMI_10X_VDEV_DELETE_CMDID,
  570. WMI_10X_VDEV_START_REQUEST_CMDID,
  571. WMI_10X_VDEV_RESTART_REQUEST_CMDID,
  572. WMI_10X_VDEV_UP_CMDID,
  573. WMI_10X_VDEV_STOP_CMDID,
  574. WMI_10X_VDEV_DOWN_CMDID,
  575. WMI_10X_VDEV_STANDBY_RESPONSE_CMDID,
  576. WMI_10X_VDEV_RESUME_RESPONSE_CMDID,
  577. WMI_10X_VDEV_SET_PARAM_CMDID,
  578. WMI_10X_VDEV_INSTALL_KEY_CMDID,
  579. /* peer specific commands */
  580. WMI_10X_PEER_CREATE_CMDID,
  581. WMI_10X_PEER_DELETE_CMDID,
  582. WMI_10X_PEER_FLUSH_TIDS_CMDID,
  583. WMI_10X_PEER_SET_PARAM_CMDID,
  584. WMI_10X_PEER_ASSOC_CMDID,
  585. WMI_10X_PEER_ADD_WDS_ENTRY_CMDID,
  586. WMI_10X_PEER_REMOVE_WDS_ENTRY_CMDID,
  587. WMI_10X_PEER_MCAST_GROUP_CMDID,
  588. /* beacon/management specific commands */
  589. WMI_10X_BCN_TX_CMDID,
  590. WMI_10X_BCN_PRB_TMPL_CMDID,
  591. WMI_10X_BCN_FILTER_RX_CMDID,
  592. WMI_10X_PRB_REQ_FILTER_RX_CMDID,
  593. WMI_10X_MGMT_TX_CMDID,
  594. /* commands to directly control ba negotiation directly from host. */
  595. WMI_10X_ADDBA_CLEAR_RESP_CMDID,
  596. WMI_10X_ADDBA_SEND_CMDID,
  597. WMI_10X_ADDBA_STATUS_CMDID,
  598. WMI_10X_DELBA_SEND_CMDID,
  599. WMI_10X_ADDBA_SET_RESP_CMDID,
  600. WMI_10X_SEND_SINGLEAMSDU_CMDID,
  601. /* Station power save specific config */
  602. WMI_10X_STA_POWERSAVE_MODE_CMDID,
  603. WMI_10X_STA_POWERSAVE_PARAM_CMDID,
  604. WMI_10X_STA_MIMO_PS_MODE_CMDID,
  605. /* set debug log config */
  606. WMI_10X_DBGLOG_CFG_CMDID,
  607. /* DFS-specific commands */
  608. WMI_10X_PDEV_DFS_ENABLE_CMDID,
  609. WMI_10X_PDEV_DFS_DISABLE_CMDID,
  610. /* QVIT specific command id */
  611. WMI_10X_PDEV_QVIT_CMDID,
  612. /* Offload Scan and Roaming related commands */
  613. WMI_10X_ROAM_SCAN_MODE,
  614. WMI_10X_ROAM_SCAN_RSSI_THRESHOLD,
  615. WMI_10X_ROAM_SCAN_PERIOD,
  616. WMI_10X_ROAM_SCAN_RSSI_CHANGE_THRESHOLD,
  617. WMI_10X_ROAM_AP_PROFILE,
  618. WMI_10X_OFL_SCAN_ADD_AP_PROFILE,
  619. WMI_10X_OFL_SCAN_REMOVE_AP_PROFILE,
  620. WMI_10X_OFL_SCAN_PERIOD,
  621. /* P2P specific commands */
  622. WMI_10X_P2P_DEV_SET_DEVICE_INFO,
  623. WMI_10X_P2P_DEV_SET_DISCOVERABILITY,
  624. WMI_10X_P2P_GO_SET_BEACON_IE,
  625. WMI_10X_P2P_GO_SET_PROBE_RESP_IE,
  626. /* AP power save specific config */
  627. WMI_10X_AP_PS_PEER_PARAM_CMDID,
  628. WMI_10X_AP_PS_PEER_UAPSD_COEX_CMDID,
  629. /* Rate-control specific commands */
  630. WMI_10X_PEER_RATE_RETRY_SCHED_CMDID,
  631. /* WLAN Profiling commands. */
  632. WMI_10X_WLAN_PROFILE_TRIGGER_CMDID,
  633. WMI_10X_WLAN_PROFILE_SET_HIST_INTVL_CMDID,
  634. WMI_10X_WLAN_PROFILE_GET_PROFILE_DATA_CMDID,
  635. WMI_10X_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID,
  636. WMI_10X_WLAN_PROFILE_LIST_PROFILE_ID_CMDID,
  637. /* Suspend resume command Ids */
  638. WMI_10X_PDEV_SUSPEND_CMDID,
  639. WMI_10X_PDEV_RESUME_CMDID,
  640. /* Beacon filter commands */
  641. WMI_10X_ADD_BCN_FILTER_CMDID,
  642. WMI_10X_RMV_BCN_FILTER_CMDID,
  643. /* WOW Specific WMI commands*/
  644. WMI_10X_WOW_ADD_WAKE_PATTERN_CMDID,
  645. WMI_10X_WOW_DEL_WAKE_PATTERN_CMDID,
  646. WMI_10X_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID,
  647. WMI_10X_WOW_ENABLE_CMDID,
  648. WMI_10X_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID,
  649. /* RTT measurement related cmd */
  650. WMI_10X_RTT_MEASREQ_CMDID,
  651. WMI_10X_RTT_TSF_CMDID,
  652. /* transmit beacon by value */
  653. WMI_10X_PDEV_SEND_BCN_CMDID,
  654. /* F/W stats */
  655. WMI_10X_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID,
  656. WMI_10X_VDEV_SPECTRAL_SCAN_ENABLE_CMDID,
  657. WMI_10X_REQUEST_STATS_CMDID,
  658. /* GPIO Configuration */
  659. WMI_10X_GPIO_CONFIG_CMDID,
  660. WMI_10X_GPIO_OUTPUT_CMDID,
  661. WMI_10X_PDEV_UTF_CMDID = WMI_10X_END_CMDID - 1,
  662. };
  663. enum wmi_10x_event_id {
  664. WMI_10X_SERVICE_READY_EVENTID = 0x8000,
  665. WMI_10X_READY_EVENTID,
  666. WMI_10X_START_EVENTID = 0x9000,
  667. WMI_10X_END_EVENTID = 0x9FFF,
  668. /* Scan specific events */
  669. WMI_10X_SCAN_EVENTID = WMI_10X_START_EVENTID,
  670. WMI_10X_ECHO_EVENTID,
  671. WMI_10X_DEBUG_MESG_EVENTID,
  672. WMI_10X_UPDATE_STATS_EVENTID,
  673. /* Instantaneous RSSI event */
  674. WMI_10X_INST_RSSI_STATS_EVENTID,
  675. /* VDEV specific events */
  676. WMI_10X_VDEV_START_RESP_EVENTID,
  677. WMI_10X_VDEV_STANDBY_REQ_EVENTID,
  678. WMI_10X_VDEV_RESUME_REQ_EVENTID,
  679. WMI_10X_VDEV_STOPPED_EVENTID,
  680. /* peer specific events */
  681. WMI_10X_PEER_STA_KICKOUT_EVENTID,
  682. /* beacon/mgmt specific events */
  683. WMI_10X_HOST_SWBA_EVENTID,
  684. WMI_10X_TBTTOFFSET_UPDATE_EVENTID,
  685. WMI_10X_MGMT_RX_EVENTID,
  686. /* Channel stats event */
  687. WMI_10X_CHAN_INFO_EVENTID,
  688. /* PHY Error specific WMI event */
  689. WMI_10X_PHYERR_EVENTID,
  690. /* Roam event to trigger roaming on host */
  691. WMI_10X_ROAM_EVENTID,
  692. /* matching AP found from list of profiles */
  693. WMI_10X_PROFILE_MATCH,
  694. /* debug print message used for tracing FW code while debugging */
  695. WMI_10X_DEBUG_PRINT_EVENTID,
  696. /* VI spoecific event */
  697. WMI_10X_PDEV_QVIT_EVENTID,
  698. /* FW code profile data in response to profile request */
  699. WMI_10X_WLAN_PROFILE_DATA_EVENTID,
  700. /*RTT related event ID*/
  701. WMI_10X_RTT_MEASUREMENT_REPORT_EVENTID,
  702. WMI_10X_TSF_MEASUREMENT_REPORT_EVENTID,
  703. WMI_10X_RTT_ERROR_REPORT_EVENTID,
  704. WMI_10X_WOW_WAKEUP_HOST_EVENTID,
  705. WMI_10X_DCS_INTERFERENCE_EVENTID,
  706. /* TPC config for the current operating channel */
  707. WMI_10X_PDEV_TPC_CONFIG_EVENTID,
  708. WMI_10X_GPIO_INPUT_EVENTID,
  709. WMI_10X_PDEV_UTF_EVENTID = WMI_10X_END_EVENTID-1,
  710. };
  711. enum wmi_phy_mode {
  712. MODE_11A = 0, /* 11a Mode */
  713. MODE_11G = 1, /* 11b/g Mode */
  714. MODE_11B = 2, /* 11b Mode */
  715. MODE_11GONLY = 3, /* 11g only Mode */
  716. MODE_11NA_HT20 = 4, /* 11a HT20 mode */
  717. MODE_11NG_HT20 = 5, /* 11g HT20 mode */
  718. MODE_11NA_HT40 = 6, /* 11a HT40 mode */
  719. MODE_11NG_HT40 = 7, /* 11g HT40 mode */
  720. MODE_11AC_VHT20 = 8,
  721. MODE_11AC_VHT40 = 9,
  722. MODE_11AC_VHT80 = 10,
  723. /* MODE_11AC_VHT160 = 11, */
  724. MODE_11AC_VHT20_2G = 11,
  725. MODE_11AC_VHT40_2G = 12,
  726. MODE_11AC_VHT80_2G = 13,
  727. MODE_UNKNOWN = 14,
  728. MODE_MAX = 14
  729. };
  730. static inline const char *ath10k_wmi_phymode_str(enum wmi_phy_mode mode)
  731. {
  732. switch (mode) {
  733. case MODE_11A:
  734. return "11a";
  735. case MODE_11G:
  736. return "11g";
  737. case MODE_11B:
  738. return "11b";
  739. case MODE_11GONLY:
  740. return "11gonly";
  741. case MODE_11NA_HT20:
  742. return "11na-ht20";
  743. case MODE_11NG_HT20:
  744. return "11ng-ht20";
  745. case MODE_11NA_HT40:
  746. return "11na-ht40";
  747. case MODE_11NG_HT40:
  748. return "11ng-ht40";
  749. case MODE_11AC_VHT20:
  750. return "11ac-vht20";
  751. case MODE_11AC_VHT40:
  752. return "11ac-vht40";
  753. case MODE_11AC_VHT80:
  754. return "11ac-vht80";
  755. case MODE_11AC_VHT20_2G:
  756. return "11ac-vht20-2g";
  757. case MODE_11AC_VHT40_2G:
  758. return "11ac-vht40-2g";
  759. case MODE_11AC_VHT80_2G:
  760. return "11ac-vht80-2g";
  761. case MODE_UNKNOWN:
  762. /* skip */
  763. break;
  764. /* no default handler to allow compiler to check that the
  765. * enum is fully handled */
  766. };
  767. return "<unknown>";
  768. }
  769. #define WMI_CHAN_LIST_TAG 0x1
  770. #define WMI_SSID_LIST_TAG 0x2
  771. #define WMI_BSSID_LIST_TAG 0x3
  772. #define WMI_IE_TAG 0x4
  773. struct wmi_channel {
  774. __le32 mhz;
  775. __le32 band_center_freq1;
  776. __le32 band_center_freq2; /* valid for 11ac, 80plus80 */
  777. union {
  778. __le32 flags; /* WMI_CHAN_FLAG_ */
  779. struct {
  780. u8 mode; /* only 6 LSBs */
  781. } __packed;
  782. } __packed;
  783. union {
  784. __le32 reginfo0;
  785. struct {
  786. u8 min_power;
  787. u8 max_power;
  788. u8 reg_power;
  789. u8 reg_classid;
  790. } __packed;
  791. } __packed;
  792. union {
  793. __le32 reginfo1;
  794. struct {
  795. u8 antenna_max;
  796. } __packed;
  797. } __packed;
  798. } __packed;
  799. struct wmi_channel_arg {
  800. u32 freq;
  801. u32 band_center_freq1;
  802. bool passive;
  803. bool allow_ibss;
  804. bool allow_ht;
  805. bool allow_vht;
  806. bool ht40plus;
  807. /* note: power unit is 1/4th of dBm */
  808. u32 min_power;
  809. u32 max_power;
  810. u32 max_reg_power;
  811. u32 max_antenna_gain;
  812. u32 reg_class_id;
  813. enum wmi_phy_mode mode;
  814. };
  815. enum wmi_channel_change_cause {
  816. WMI_CHANNEL_CHANGE_CAUSE_NONE = 0,
  817. WMI_CHANNEL_CHANGE_CAUSE_CSA,
  818. };
  819. #define WMI_CHAN_FLAG_HT40_PLUS (1 << 6)
  820. #define WMI_CHAN_FLAG_PASSIVE (1 << 7)
  821. #define WMI_CHAN_FLAG_ADHOC_ALLOWED (1 << 8)
  822. #define WMI_CHAN_FLAG_AP_DISABLED (1 << 9)
  823. #define WMI_CHAN_FLAG_DFS (1 << 10)
  824. #define WMI_CHAN_FLAG_ALLOW_HT (1 << 11)
  825. #define WMI_CHAN_FLAG_ALLOW_VHT (1 << 12)
  826. /* Indicate reason for channel switch */
  827. #define WMI_CHANNEL_CHANGE_CAUSE_CSA (1 << 13)
  828. #define WMI_MAX_SPATIAL_STREAM 3
  829. /* HT Capabilities*/
  830. #define WMI_HT_CAP_ENABLED 0x0001 /* HT Enabled/ disabled */
  831. #define WMI_HT_CAP_HT20_SGI 0x0002 /* Short Guard Interval with HT20 */
  832. #define WMI_HT_CAP_DYNAMIC_SMPS 0x0004 /* Dynamic MIMO powersave */
  833. #define WMI_HT_CAP_TX_STBC 0x0008 /* B3 TX STBC */
  834. #define WMI_HT_CAP_TX_STBC_MASK_SHIFT 3
  835. #define WMI_HT_CAP_RX_STBC 0x0030 /* B4-B5 RX STBC */
  836. #define WMI_HT_CAP_RX_STBC_MASK_SHIFT 4
  837. #define WMI_HT_CAP_LDPC 0x0040 /* LDPC supported */
  838. #define WMI_HT_CAP_L_SIG_TXOP_PROT 0x0080 /* L-SIG TXOP Protection */
  839. #define WMI_HT_CAP_MPDU_DENSITY 0x0700 /* MPDU Density */
  840. #define WMI_HT_CAP_MPDU_DENSITY_MASK_SHIFT 8
  841. #define WMI_HT_CAP_HT40_SGI 0x0800
  842. #define WMI_HT_CAP_DEFAULT_ALL (WMI_HT_CAP_ENABLED | \
  843. WMI_HT_CAP_HT20_SGI | \
  844. WMI_HT_CAP_HT40_SGI | \
  845. WMI_HT_CAP_TX_STBC | \
  846. WMI_HT_CAP_RX_STBC | \
  847. WMI_HT_CAP_LDPC)
  848. /*
  849. * WMI_VHT_CAP_* these maps to ieee 802.11ac vht capability information
  850. * field. The fields not defined here are not supported, or reserved.
  851. * Do not change these masks and if you have to add new one follow the
  852. * bitmask as specified by 802.11ac draft.
  853. */
  854. #define WMI_VHT_CAP_MAX_MPDU_LEN_MASK 0x00000003
  855. #define WMI_VHT_CAP_RX_LDPC 0x00000010
  856. #define WMI_VHT_CAP_SGI_80MHZ 0x00000020
  857. #define WMI_VHT_CAP_TX_STBC 0x00000080
  858. #define WMI_VHT_CAP_RX_STBC_MASK 0x00000300
  859. #define WMI_VHT_CAP_RX_STBC_MASK_SHIFT 8
  860. #define WMI_VHT_CAP_MAX_AMPDU_LEN_EXP 0x03800000
  861. #define WMI_VHT_CAP_MAX_AMPDU_LEN_EXP_SHIFT 23
  862. #define WMI_VHT_CAP_RX_FIXED_ANT 0x10000000
  863. #define WMI_VHT_CAP_TX_FIXED_ANT 0x20000000
  864. /* The following also refer for max HT AMSDU */
  865. #define WMI_VHT_CAP_MAX_MPDU_LEN_3839 0x00000000
  866. #define WMI_VHT_CAP_MAX_MPDU_LEN_7935 0x00000001
  867. #define WMI_VHT_CAP_MAX_MPDU_LEN_11454 0x00000002
  868. #define WMI_VHT_CAP_DEFAULT_ALL (WMI_VHT_CAP_MAX_MPDU_LEN_11454 | \
  869. WMI_VHT_CAP_RX_LDPC | \
  870. WMI_VHT_CAP_SGI_80MHZ | \
  871. WMI_VHT_CAP_TX_STBC | \
  872. WMI_VHT_CAP_RX_STBC_MASK | \
  873. WMI_VHT_CAP_MAX_AMPDU_LEN_EXP | \
  874. WMI_VHT_CAP_RX_FIXED_ANT | \
  875. WMI_VHT_CAP_TX_FIXED_ANT)
  876. /*
  877. * Interested readers refer to Rx/Tx MCS Map definition as defined in
  878. * 802.11ac
  879. */
  880. #define WMI_VHT_MAX_MCS_4_SS_MASK(r, ss) ((3 & (r)) << (((ss) - 1) << 1))
  881. #define WMI_VHT_MAX_SUPP_RATE_MASK 0x1fff0000
  882. #define WMI_VHT_MAX_SUPP_RATE_MASK_SHIFT 16
  883. enum {
  884. REGDMN_MODE_11A = 0x00001, /* 11a channels */
  885. REGDMN_MODE_TURBO = 0x00002, /* 11a turbo-only channels */
  886. REGDMN_MODE_11B = 0x00004, /* 11b channels */
  887. REGDMN_MODE_PUREG = 0x00008, /* 11g channels (OFDM only) */
  888. REGDMN_MODE_11G = 0x00008, /* XXX historical */
  889. REGDMN_MODE_108G = 0x00020, /* 11a+Turbo channels */
  890. REGDMN_MODE_108A = 0x00040, /* 11g+Turbo channels */
  891. REGDMN_MODE_XR = 0x00100, /* XR channels */
  892. REGDMN_MODE_11A_HALF_RATE = 0x00200, /* 11A half rate channels */
  893. REGDMN_MODE_11A_QUARTER_RATE = 0x00400, /* 11A quarter rate channels */
  894. REGDMN_MODE_11NG_HT20 = 0x00800, /* 11N-G HT20 channels */
  895. REGDMN_MODE_11NA_HT20 = 0x01000, /* 11N-A HT20 channels */
  896. REGDMN_MODE_11NG_HT40PLUS = 0x02000, /* 11N-G HT40 + channels */
  897. REGDMN_MODE_11NG_HT40MINUS = 0x04000, /* 11N-G HT40 - channels */
  898. REGDMN_MODE_11NA_HT40PLUS = 0x08000, /* 11N-A HT40 + channels */
  899. REGDMN_MODE_11NA_HT40MINUS = 0x10000, /* 11N-A HT40 - channels */
  900. REGDMN_MODE_11AC_VHT20 = 0x20000, /* 5Ghz, VHT20 */
  901. REGDMN_MODE_11AC_VHT40PLUS = 0x40000, /* 5Ghz, VHT40 + channels */
  902. REGDMN_MODE_11AC_VHT40MINUS = 0x80000, /* 5Ghz VHT40 - channels */
  903. REGDMN_MODE_11AC_VHT80 = 0x100000, /* 5Ghz, VHT80 channels */
  904. REGDMN_MODE_ALL = 0xffffffff
  905. };
  906. #define REGDMN_CAP1_CHAN_HALF_RATE 0x00000001
  907. #define REGDMN_CAP1_CHAN_QUARTER_RATE 0x00000002
  908. #define REGDMN_CAP1_CHAN_HAL49GHZ 0x00000004
  909. /* regulatory capabilities */
  910. #define REGDMN_EEPROM_EEREGCAP_EN_FCC_MIDBAND 0x0040
  911. #define REGDMN_EEPROM_EEREGCAP_EN_KK_U1_EVEN 0x0080
  912. #define REGDMN_EEPROM_EEREGCAP_EN_KK_U2 0x0100
  913. #define REGDMN_EEPROM_EEREGCAP_EN_KK_MIDBAND 0x0200
  914. #define REGDMN_EEPROM_EEREGCAP_EN_KK_U1_ODD 0x0400
  915. #define REGDMN_EEPROM_EEREGCAP_EN_KK_NEW_11A 0x0800
  916. struct hal_reg_capabilities {
  917. /* regdomain value specified in EEPROM */
  918. __le32 eeprom_rd;
  919. /*regdomain */
  920. __le32 eeprom_rd_ext;
  921. /* CAP1 capabilities bit map. */
  922. __le32 regcap1;
  923. /* REGDMN EEPROM CAP. */
  924. __le32 regcap2;
  925. /* REGDMN MODE */
  926. __le32 wireless_modes;
  927. __le32 low_2ghz_chan;
  928. __le32 high_2ghz_chan;
  929. __le32 low_5ghz_chan;
  930. __le32 high_5ghz_chan;
  931. } __packed;
  932. enum wlan_mode_capability {
  933. WHAL_WLAN_11A_CAPABILITY = 0x1,
  934. WHAL_WLAN_11G_CAPABILITY = 0x2,
  935. WHAL_WLAN_11AG_CAPABILITY = 0x3,
  936. };
  937. /* structure used by FW for requesting host memory */
  938. struct wlan_host_mem_req {
  939. /* ID of the request */
  940. __le32 req_id;
  941. /* size of the of each unit */
  942. __le32 unit_size;
  943. /* flags to indicate that
  944. * the number units is dependent
  945. * on number of resources(num vdevs num peers .. etc)
  946. */
  947. __le32 num_unit_info;
  948. /*
  949. * actual number of units to allocate . if flags in the num_unit_info
  950. * indicate that number of units is tied to number of a particular
  951. * resource to allocate then num_units filed is set to 0 and host
  952. * will derive the number units from number of the resources it is
  953. * requesting.
  954. */
  955. __le32 num_units;
  956. } __packed;
  957. #define WMI_SERVICE_IS_ENABLED(wmi_svc_bmap, svc_id) \
  958. ((((wmi_svc_bmap)[(svc_id)/(sizeof(u32))]) & \
  959. (1 << ((svc_id)%(sizeof(u32))))) != 0)
  960. /*
  961. * The following struct holds optional payload for
  962. * wmi_service_ready_event,e.g., 11ac pass some of the
  963. * device capability to the host.
  964. */
  965. struct wmi_service_ready_event {
  966. __le32 sw_version;
  967. __le32 sw_version_1;
  968. __le32 abi_version;
  969. /* WMI_PHY_CAPABILITY */
  970. __le32 phy_capability;
  971. /* Maximum number of frag table entries that SW will populate less 1 */
  972. __le32 max_frag_entry;
  973. __le32 wmi_service_bitmap[WMI_SERVICE_BM_SIZE];
  974. __le32 num_rf_chains;
  975. /*
  976. * The following field is only valid for service type
  977. * WMI_SERVICE_11AC
  978. */
  979. __le32 ht_cap_info; /* WMI HT Capability */
  980. __le32 vht_cap_info; /* VHT capability info field of 802.11ac */
  981. __le32 vht_supp_mcs; /* VHT Supported MCS Set field Rx/Tx same */
  982. __le32 hw_min_tx_power;
  983. __le32 hw_max_tx_power;
  984. struct hal_reg_capabilities hal_reg_capabilities;
  985. __le32 sys_cap_info;
  986. __le32 min_pkt_size_enable; /* Enterprise mode short pkt enable */
  987. /*
  988. * Max beacon and Probe Response IE offload size
  989. * (includes optional P2P IEs)
  990. */
  991. __le32 max_bcn_ie_size;
  992. /*
  993. * request to host to allocate a chuck of memory and pss it down to FW
  994. * via WM_INIT. FW uses this as FW extesnsion memory for saving its
  995. * data structures. Only valid for low latency interfaces like PCIE
  996. * where FW can access this memory directly (or) by DMA.
  997. */
  998. __le32 num_mem_reqs;
  999. struct wlan_host_mem_req mem_reqs[1];
  1000. } __packed;
  1001. /* This is the definition from 10.X firmware branch */
  1002. struct wmi_service_ready_event_10x {
  1003. __le32 sw_version;
  1004. __le32 abi_version;
  1005. /* WMI_PHY_CAPABILITY */
  1006. __le32 phy_capability;
  1007. /* Maximum number of frag table entries that SW will populate less 1 */
  1008. __le32 max_frag_entry;
  1009. __le32 wmi_service_bitmap[WMI_SERVICE_BM_SIZE];
  1010. __le32 num_rf_chains;
  1011. /*
  1012. * The following field is only valid for service type
  1013. * WMI_SERVICE_11AC
  1014. */
  1015. __le32 ht_cap_info; /* WMI HT Capability */
  1016. __le32 vht_cap_info; /* VHT capability info field of 802.11ac */
  1017. __le32 vht_supp_mcs; /* VHT Supported MCS Set field Rx/Tx same */
  1018. __le32 hw_min_tx_power;
  1019. __le32 hw_max_tx_power;
  1020. struct hal_reg_capabilities hal_reg_capabilities;
  1021. __le32 sys_cap_info;
  1022. __le32 min_pkt_size_enable; /* Enterprise mode short pkt enable */
  1023. /*
  1024. * request to host to allocate a chuck of memory and pss it down to FW
  1025. * via WM_INIT. FW uses this as FW extesnsion memory for saving its
  1026. * data structures. Only valid for low latency interfaces like PCIE
  1027. * where FW can access this memory directly (or) by DMA.
  1028. */
  1029. __le32 num_mem_reqs;
  1030. struct wlan_host_mem_req mem_reqs[1];
  1031. } __packed;
  1032. #define WMI_SERVICE_READY_TIMEOUT_HZ (5*HZ)
  1033. #define WMI_UNIFIED_READY_TIMEOUT_HZ (5*HZ)
  1034. struct wmi_ready_event {
  1035. __le32 sw_version;
  1036. __le32 abi_version;
  1037. struct wmi_mac_addr mac_addr;
  1038. __le32 status;
  1039. } __packed;
  1040. struct wmi_resource_config {
  1041. /* number of virtual devices (VAPs) to support */
  1042. __le32 num_vdevs;
  1043. /* number of peer nodes to support */
  1044. __le32 num_peers;
  1045. /*
  1046. * In offload mode target supports features like WOW, chatter and
  1047. * other protocol offloads. In order to support them some
  1048. * functionalities like reorder buffering, PN checking need to be
  1049. * done in target. This determines maximum number of peers suported
  1050. * by target in offload mode
  1051. */
  1052. __le32 num_offload_peers;
  1053. /* For target-based RX reordering */
  1054. __le32 num_offload_reorder_bufs;
  1055. /* number of keys per peer */
  1056. __le32 num_peer_keys;
  1057. /* total number of TX/RX data TIDs */
  1058. __le32 num_tids;
  1059. /*
  1060. * max skid for resolving hash collisions
  1061. *
  1062. * The address search table is sparse, so that if two MAC addresses
  1063. * result in the same hash value, the second of these conflicting
  1064. * entries can slide to the next index in the address search table,
  1065. * and use it, if it is unoccupied. This ast_skid_limit parameter
  1066. * specifies the upper bound on how many subsequent indices to search
  1067. * over to find an unoccupied space.
  1068. */
  1069. __le32 ast_skid_limit;
  1070. /*
  1071. * the nominal chain mask for transmit
  1072. *
  1073. * The chain mask may be modified dynamically, e.g. to operate AP
  1074. * tx with a reduced number of chains if no clients are associated.
  1075. * This configuration parameter specifies the nominal chain-mask that
  1076. * should be used when not operating with a reduced set of tx chains.
  1077. */
  1078. __le32 tx_chain_mask;
  1079. /*
  1080. * the nominal chain mask for receive
  1081. *
  1082. * The chain mask may be modified dynamically, e.g. for a client
  1083. * to use a reduced number of chains for receive if the traffic to
  1084. * the client is low enough that it doesn't require downlink MIMO
  1085. * or antenna diversity.
  1086. * This configuration parameter specifies the nominal chain-mask that
  1087. * should be used when not operating with a reduced set of rx chains.
  1088. */
  1089. __le32 rx_chain_mask;
  1090. /*
  1091. * what rx reorder timeout (ms) to use for the AC
  1092. *
  1093. * Each WMM access class (voice, video, best-effort, background) will
  1094. * have its own timeout value to dictate how long to wait for missing
  1095. * rx MPDUs to arrive before flushing subsequent MPDUs that have
  1096. * already been received.
  1097. * This parameter specifies the timeout in milliseconds for each
  1098. * class.
  1099. */
  1100. __le32 rx_timeout_pri_vi;
  1101. __le32 rx_timeout_pri_vo;
  1102. __le32 rx_timeout_pri_be;
  1103. __le32 rx_timeout_pri_bk;
  1104. /*
  1105. * what mode the rx should decap packets to
  1106. *
  1107. * MAC can decap to RAW (no decap), native wifi or Ethernet types
  1108. * THis setting also determines the default TX behavior, however TX
  1109. * behavior can be modified on a per VAP basis during VAP init
  1110. */
  1111. __le32 rx_decap_mode;
  1112. /* what is the maximum scan requests than can be queued */
  1113. __le32 scan_max_pending_reqs;
  1114. /* maximum VDEV that could use BMISS offload */
  1115. __le32 bmiss_offload_max_vdev;
  1116. /* maximum VDEV that could use offload roaming */
  1117. __le32 roam_offload_max_vdev;
  1118. /* maximum AP profiles that would push to offload roaming */
  1119. __le32 roam_offload_max_ap_profiles;
  1120. /*
  1121. * how many groups to use for mcast->ucast conversion
  1122. *
  1123. * The target's WAL maintains a table to hold information regarding
  1124. * which peers belong to a given multicast group, so that if
  1125. * multicast->unicast conversion is enabled, the target can convert
  1126. * multicast tx frames to a series of unicast tx frames, to each
  1127. * peer within the multicast group.
  1128. This num_mcast_groups configuration parameter tells the target how
  1129. * many multicast groups to provide storage for within its multicast
  1130. * group membership table.
  1131. */
  1132. __le32 num_mcast_groups;
  1133. /*
  1134. * size to alloc for the mcast membership table
  1135. *
  1136. * This num_mcast_table_elems configuration parameter tells the
  1137. * target how many peer elements it needs to provide storage for in
  1138. * its multicast group membership table.
  1139. * These multicast group membership table elements are shared by the
  1140. * multicast groups stored within the table.
  1141. */
  1142. __le32 num_mcast_table_elems;
  1143. /*
  1144. * whether/how to do multicast->unicast conversion
  1145. *
  1146. * This configuration parameter specifies whether the target should
  1147. * perform multicast --> unicast conversion on transmit, and if so,
  1148. * what to do if it finds no entries in its multicast group
  1149. * membership table for the multicast IP address in the tx frame.
  1150. * Configuration value:
  1151. * 0 -> Do not perform multicast to unicast conversion.
  1152. * 1 -> Convert multicast frames to unicast, if the IP multicast
  1153. * address from the tx frame is found in the multicast group
  1154. * membership table. If the IP multicast address is not found,
  1155. * drop the frame.
  1156. * 2 -> Convert multicast frames to unicast, if the IP multicast
  1157. * address from the tx frame is found in the multicast group
  1158. * membership table. If the IP multicast address is not found,
  1159. * transmit the frame as multicast.
  1160. */
  1161. __le32 mcast2ucast_mode;
  1162. /*
  1163. * how much memory to allocate for a tx PPDU dbg log
  1164. *
  1165. * This parameter controls how much memory the target will allocate
  1166. * to store a log of tx PPDU meta-information (how large the PPDU
  1167. * was, when it was sent, whether it was successful, etc.)
  1168. */
  1169. __le32 tx_dbg_log_size;
  1170. /* how many AST entries to be allocated for WDS */
  1171. __le32 num_wds_entries;
  1172. /*
  1173. * MAC DMA burst size, e.g., For target PCI limit can be
  1174. * 0 -default, 1 256B
  1175. */
  1176. __le32 dma_burst_size;
  1177. /*
  1178. * Fixed delimiters to be inserted after every MPDU to
  1179. * account for interface latency to avoid underrun.
  1180. */
  1181. __le32 mac_aggr_delim;
  1182. /*
  1183. * determine whether target is responsible for detecting duplicate
  1184. * non-aggregate MPDU and timing out stale fragments.
  1185. *
  1186. * A-MPDU reordering is always performed on the target.
  1187. *
  1188. * 0: target responsible for frag timeout and dup checking
  1189. * 1: host responsible for frag timeout and dup checking
  1190. */
  1191. __le32 rx_skip_defrag_timeout_dup_detection_check;
  1192. /*
  1193. * Configuration for VoW :
  1194. * No of Video Nodes to be supported
  1195. * and Max no of descriptors for each Video link (node).
  1196. */
  1197. __le32 vow_config;
  1198. /* maximum VDEV that could use GTK offload */
  1199. __le32 gtk_offload_max_vdev;
  1200. /* Number of msdu descriptors target should use */
  1201. __le32 num_msdu_desc;
  1202. /*
  1203. * Max. number of Tx fragments per MSDU
  1204. * This parameter controls the max number of Tx fragments per MSDU.
  1205. * This is sent by the target as part of the WMI_SERVICE_READY event
  1206. * and is overriden by the OS shim as required.
  1207. */
  1208. __le32 max_frag_entries;
  1209. } __packed;
  1210. struct wmi_resource_config_10x {
  1211. /* number of virtual devices (VAPs) to support */
  1212. __le32 num_vdevs;
  1213. /* number of peer nodes to support */
  1214. __le32 num_peers;
  1215. /* number of keys per peer */
  1216. __le32 num_peer_keys;
  1217. /* total number of TX/RX data TIDs */
  1218. __le32 num_tids;
  1219. /*
  1220. * max skid for resolving hash collisions
  1221. *
  1222. * The address search table is sparse, so that if two MAC addresses
  1223. * result in the same hash value, the second of these conflicting
  1224. * entries can slide to the next index in the address search table,
  1225. * and use it, if it is unoccupied. This ast_skid_limit parameter
  1226. * specifies the upper bound on how many subsequent indices to search
  1227. * over to find an unoccupied space.
  1228. */
  1229. __le32 ast_skid_limit;
  1230. /*
  1231. * the nominal chain mask for transmit
  1232. *
  1233. * The chain mask may be modified dynamically, e.g. to operate AP
  1234. * tx with a reduced number of chains if no clients are associated.
  1235. * This configuration parameter specifies the nominal chain-mask that
  1236. * should be used when not operating with a reduced set of tx chains.
  1237. */
  1238. __le32 tx_chain_mask;
  1239. /*
  1240. * the nominal chain mask for receive
  1241. *
  1242. * The chain mask may be modified dynamically, e.g. for a client
  1243. * to use a reduced number of chains for receive if the traffic to
  1244. * the client is low enough that it doesn't require downlink MIMO
  1245. * or antenna diversity.
  1246. * This configuration parameter specifies the nominal chain-mask that
  1247. * should be used when not operating with a reduced set of rx chains.
  1248. */
  1249. __le32 rx_chain_mask;
  1250. /*
  1251. * what rx reorder timeout (ms) to use for the AC
  1252. *
  1253. * Each WMM access class (voice, video, best-effort, background) will
  1254. * have its own timeout value to dictate how long to wait for missing
  1255. * rx MPDUs to arrive before flushing subsequent MPDUs that have
  1256. * already been received.
  1257. * This parameter specifies the timeout in milliseconds for each
  1258. * class.
  1259. */
  1260. __le32 rx_timeout_pri_vi;
  1261. __le32 rx_timeout_pri_vo;
  1262. __le32 rx_timeout_pri_be;
  1263. __le32 rx_timeout_pri_bk;
  1264. /*
  1265. * what mode the rx should decap packets to
  1266. *
  1267. * MAC can decap to RAW (no decap), native wifi or Ethernet types
  1268. * THis setting also determines the default TX behavior, however TX
  1269. * behavior can be modified on a per VAP basis during VAP init
  1270. */
  1271. __le32 rx_decap_mode;
  1272. /* what is the maximum scan requests than can be queued */
  1273. __le32 scan_max_pending_reqs;
  1274. /* maximum VDEV that could use BMISS offload */
  1275. __le32 bmiss_offload_max_vdev;
  1276. /* maximum VDEV that could use offload roaming */
  1277. __le32 roam_offload_max_vdev;
  1278. /* maximum AP profiles that would push to offload roaming */
  1279. __le32 roam_offload_max_ap_profiles;
  1280. /*
  1281. * how many groups to use for mcast->ucast conversion
  1282. *
  1283. * The target's WAL maintains a table to hold information regarding
  1284. * which peers belong to a given multicast group, so that if
  1285. * multicast->unicast conversion is enabled, the target can convert
  1286. * multicast tx frames to a series of unicast tx frames, to each
  1287. * peer within the multicast group.
  1288. This num_mcast_groups configuration parameter tells the target how
  1289. * many multicast groups to provide storage for within its multicast
  1290. * group membership table.
  1291. */
  1292. __le32 num_mcast_groups;
  1293. /*
  1294. * size to alloc for the mcast membership table
  1295. *
  1296. * This num_mcast_table_elems configuration parameter tells the
  1297. * target how many peer elements it needs to provide storage for in
  1298. * its multicast group membership table.
  1299. * These multicast group membership table elements are shared by the
  1300. * multicast groups stored within the table.
  1301. */
  1302. __le32 num_mcast_table_elems;
  1303. /*
  1304. * whether/how to do multicast->unicast conversion
  1305. *
  1306. * This configuration parameter specifies whether the target should
  1307. * perform multicast --> unicast conversion on transmit, and if so,
  1308. * what to do if it finds no entries in its multicast group
  1309. * membership table for the multicast IP address in the tx frame.
  1310. * Configuration value:
  1311. * 0 -> Do not perform multicast to unicast conversion.
  1312. * 1 -> Convert multicast frames to unicast, if the IP multicast
  1313. * address from the tx frame is found in the multicast group
  1314. * membership table. If the IP multicast address is not found,
  1315. * drop the frame.
  1316. * 2 -> Convert multicast frames to unicast, if the IP multicast
  1317. * address from the tx frame is found in the multicast group
  1318. * membership table. If the IP multicast address is not found,
  1319. * transmit the frame as multicast.
  1320. */
  1321. __le32 mcast2ucast_mode;
  1322. /*
  1323. * how much memory to allocate for a tx PPDU dbg log
  1324. *
  1325. * This parameter controls how much memory the target will allocate
  1326. * to store a log of tx PPDU meta-information (how large the PPDU
  1327. * was, when it was sent, whether it was successful, etc.)
  1328. */
  1329. __le32 tx_dbg_log_size;
  1330. /* how many AST entries to be allocated for WDS */
  1331. __le32 num_wds_entries;
  1332. /*
  1333. * MAC DMA burst size, e.g., For target PCI limit can be
  1334. * 0 -default, 1 256B
  1335. */
  1336. __le32 dma_burst_size;
  1337. /*
  1338. * Fixed delimiters to be inserted after every MPDU to
  1339. * account for interface latency to avoid underrun.
  1340. */
  1341. __le32 mac_aggr_delim;
  1342. /*
  1343. * determine whether target is responsible for detecting duplicate
  1344. * non-aggregate MPDU and timing out stale fragments.
  1345. *
  1346. * A-MPDU reordering is always performed on the target.
  1347. *
  1348. * 0: target responsible for frag timeout and dup checking
  1349. * 1: host responsible for frag timeout and dup checking
  1350. */
  1351. __le32 rx_skip_defrag_timeout_dup_detection_check;
  1352. /*
  1353. * Configuration for VoW :
  1354. * No of Video Nodes to be supported
  1355. * and Max no of descriptors for each Video link (node).
  1356. */
  1357. __le32 vow_config;
  1358. /* Number of msdu descriptors target should use */
  1359. __le32 num_msdu_desc;
  1360. /*
  1361. * Max. number of Tx fragments per MSDU
  1362. * This parameter controls the max number of Tx fragments per MSDU.
  1363. * This is sent by the target as part of the WMI_SERVICE_READY event
  1364. * and is overriden by the OS shim as required.
  1365. */
  1366. __le32 max_frag_entries;
  1367. } __packed;
  1368. #define NUM_UNITS_IS_NUM_VDEVS 0x1
  1369. #define NUM_UNITS_IS_NUM_PEERS 0x2
  1370. /* strucutre describing host memory chunk. */
  1371. struct host_memory_chunk {
  1372. /* id of the request that is passed up in service ready */
  1373. __le32 req_id;
  1374. /* the physical address the memory chunk */
  1375. __le32 ptr;
  1376. /* size of the chunk */
  1377. __le32 size;
  1378. } __packed;
  1379. struct wmi_init_cmd {
  1380. struct wmi_resource_config resource_config;
  1381. __le32 num_host_mem_chunks;
  1382. /*
  1383. * variable number of host memory chunks.
  1384. * This should be the last element in the structure
  1385. */
  1386. struct host_memory_chunk host_mem_chunks[1];
  1387. } __packed;
  1388. /* _10x stucture is from 10.X FW API */
  1389. struct wmi_init_cmd_10x {
  1390. struct wmi_resource_config_10x resource_config;
  1391. __le32 num_host_mem_chunks;
  1392. /*
  1393. * variable number of host memory chunks.
  1394. * This should be the last element in the structure
  1395. */
  1396. struct host_memory_chunk host_mem_chunks[1];
  1397. } __packed;
  1398. /* TLV for channel list */
  1399. struct wmi_chan_list {
  1400. __le32 tag; /* WMI_CHAN_LIST_TAG */
  1401. __le32 num_chan;
  1402. __le32 channel_list[0];
  1403. } __packed;
  1404. struct wmi_bssid_list {
  1405. __le32 tag; /* WMI_BSSID_LIST_TAG */
  1406. __le32 num_bssid;
  1407. struct wmi_mac_addr bssid_list[0];
  1408. } __packed;
  1409. struct wmi_ie_data {
  1410. __le32 tag; /* WMI_IE_TAG */
  1411. __le32 ie_len;
  1412. u8 ie_data[0];
  1413. } __packed;
  1414. struct wmi_ssid {
  1415. __le32 ssid_len;
  1416. u8 ssid[32];
  1417. } __packed;
  1418. struct wmi_ssid_list {
  1419. __le32 tag; /* WMI_SSID_LIST_TAG */
  1420. __le32 num_ssids;
  1421. struct wmi_ssid ssids[0];
  1422. } __packed;
  1423. /* prefix used by scan requestor ids on the host */
  1424. #define WMI_HOST_SCAN_REQUESTOR_ID_PREFIX 0xA000
  1425. /* prefix used by scan request ids generated on the host */
  1426. /* host cycles through the lower 12 bits to generate ids */
  1427. #define WMI_HOST_SCAN_REQ_ID_PREFIX 0xA000
  1428. #define WLAN_SCAN_PARAMS_MAX_SSID 16
  1429. #define WLAN_SCAN_PARAMS_MAX_BSSID 4
  1430. #define WLAN_SCAN_PARAMS_MAX_IE_LEN 256
  1431. /* Scan priority numbers must be sequential, starting with 0 */
  1432. enum wmi_scan_priority {
  1433. WMI_SCAN_PRIORITY_VERY_LOW = 0,
  1434. WMI_SCAN_PRIORITY_LOW,
  1435. WMI_SCAN_PRIORITY_MEDIUM,
  1436. WMI_SCAN_PRIORITY_HIGH,
  1437. WMI_SCAN_PRIORITY_VERY_HIGH,
  1438. WMI_SCAN_PRIORITY_COUNT /* number of priorities supported */
  1439. };
  1440. struct wmi_start_scan_cmd {
  1441. /* Scan ID */
  1442. __le32 scan_id;
  1443. /* Scan requestor ID */
  1444. __le32 scan_req_id;
  1445. /* VDEV id(interface) that is requesting scan */
  1446. __le32 vdev_id;
  1447. /* Scan Priority, input to scan scheduler */
  1448. __le32 scan_priority;
  1449. /* Scan events subscription */
  1450. __le32 notify_scan_events;
  1451. /* dwell time in msec on active channels */
  1452. __le32 dwell_time_active;
  1453. /* dwell time in msec on passive channels */
  1454. __le32 dwell_time_passive;
  1455. /*
  1456. * min time in msec on the BSS channel,only valid if atleast one
  1457. * VDEV is active
  1458. */
  1459. __le32 min_rest_time;
  1460. /*
  1461. * max rest time in msec on the BSS channel,only valid if at least
  1462. * one VDEV is active
  1463. */
  1464. /*
  1465. * the scanner will rest on the bss channel at least min_rest_time
  1466. * after min_rest_time the scanner will start checking for tx/rx
  1467. * activity on all VDEVs. if there is no activity the scanner will
  1468. * switch to off channel. if there is activity the scanner will let
  1469. * the radio on the bss channel until max_rest_time expires.at
  1470. * max_rest_time scanner will switch to off channel irrespective of
  1471. * activity. activity is determined by the idle_time parameter.
  1472. */
  1473. __le32 max_rest_time;
  1474. /*
  1475. * time before sending next set of probe requests.
  1476. * The scanner keeps repeating probe requests transmission with
  1477. * period specified by repeat_probe_time.
  1478. * The number of probe requests specified depends on the ssid_list
  1479. * and bssid_list
  1480. */
  1481. __le32 repeat_probe_time;
  1482. /* time in msec between 2 consequetive probe requests with in a set. */
  1483. __le32 probe_spacing_time;
  1484. /*
  1485. * data inactivity time in msec on bss channel that will be used by
  1486. * scanner for measuring the inactivity.
  1487. */
  1488. __le32 idle_time;
  1489. /* maximum time in msec allowed for scan */
  1490. __le32 max_scan_time;
  1491. /*
  1492. * delay in msec before sending first probe request after switching
  1493. * to a channel
  1494. */
  1495. __le32 probe_delay;
  1496. /* Scan control flags */
  1497. __le32 scan_ctrl_flags;
  1498. /* Burst duration time in msecs */
  1499. __le32 burst_duration;
  1500. /*
  1501. * TLV (tag length value ) paramerters follow the scan_cmd structure.
  1502. * TLV can contain channel list, bssid list, ssid list and
  1503. * ie. the TLV tags are defined above;
  1504. */
  1505. } __packed;
  1506. /* This is the definition from 10.X firmware branch */
  1507. struct wmi_start_scan_cmd_10x {
  1508. /* Scan ID */
  1509. __le32 scan_id;
  1510. /* Scan requestor ID */
  1511. __le32 scan_req_id;
  1512. /* VDEV id(interface) that is requesting scan */
  1513. __le32 vdev_id;
  1514. /* Scan Priority, input to scan scheduler */
  1515. __le32 scan_priority;
  1516. /* Scan events subscription */
  1517. __le32 notify_scan_events;
  1518. /* dwell time in msec on active channels */
  1519. __le32 dwell_time_active;
  1520. /* dwell time in msec on passive channels */
  1521. __le32 dwell_time_passive;
  1522. /*
  1523. * min time in msec on the BSS channel,only valid if atleast one
  1524. * VDEV is active
  1525. */
  1526. __le32 min_rest_time;
  1527. /*
  1528. * max rest time in msec on the BSS channel,only valid if at least
  1529. * one VDEV is active
  1530. */
  1531. /*
  1532. * the scanner will rest on the bss channel at least min_rest_time
  1533. * after min_rest_time the scanner will start checking for tx/rx
  1534. * activity on all VDEVs. if there is no activity the scanner will
  1535. * switch to off channel. if there is activity the scanner will let
  1536. * the radio on the bss channel until max_rest_time expires.at
  1537. * max_rest_time scanner will switch to off channel irrespective of
  1538. * activity. activity is determined by the idle_time parameter.
  1539. */
  1540. __le32 max_rest_time;
  1541. /*
  1542. * time before sending next set of probe requests.
  1543. * The scanner keeps repeating probe requests transmission with
  1544. * period specified by repeat_probe_time.
  1545. * The number of probe requests specified depends on the ssid_list
  1546. * and bssid_list
  1547. */
  1548. __le32 repeat_probe_time;
  1549. /* time in msec between 2 consequetive probe requests with in a set. */
  1550. __le32 probe_spacing_time;
  1551. /*
  1552. * data inactivity time in msec on bss channel that will be used by
  1553. * scanner for measuring the inactivity.
  1554. */
  1555. __le32 idle_time;
  1556. /* maximum time in msec allowed for scan */
  1557. __le32 max_scan_time;
  1558. /*
  1559. * delay in msec before sending first probe request after switching
  1560. * to a channel
  1561. */
  1562. __le32 probe_delay;
  1563. /* Scan control flags */
  1564. __le32 scan_ctrl_flags;
  1565. /*
  1566. * TLV (tag length value ) paramerters follow the scan_cmd structure.
  1567. * TLV can contain channel list, bssid list, ssid list and
  1568. * ie. the TLV tags are defined above;
  1569. */
  1570. } __packed;
  1571. struct wmi_ssid_arg {
  1572. int len;
  1573. const u8 *ssid;
  1574. };
  1575. struct wmi_bssid_arg {
  1576. const u8 *bssid;
  1577. };
  1578. struct wmi_start_scan_arg {
  1579. u32 scan_id;
  1580. u32 scan_req_id;
  1581. u32 vdev_id;
  1582. u32 scan_priority;
  1583. u32 notify_scan_events;
  1584. u32 dwell_time_active;
  1585. u32 dwell_time_passive;
  1586. u32 min_rest_time;
  1587. u32 max_rest_time;
  1588. u32 repeat_probe_time;
  1589. u32 probe_spacing_time;
  1590. u32 idle_time;
  1591. u32 max_scan_time;
  1592. u32 probe_delay;
  1593. u32 scan_ctrl_flags;
  1594. u32 ie_len;
  1595. u32 n_channels;
  1596. u32 n_ssids;
  1597. u32 n_bssids;
  1598. u8 ie[WLAN_SCAN_PARAMS_MAX_IE_LEN];
  1599. u32 channels[64];
  1600. struct wmi_ssid_arg ssids[WLAN_SCAN_PARAMS_MAX_SSID];
  1601. struct wmi_bssid_arg bssids[WLAN_SCAN_PARAMS_MAX_BSSID];
  1602. };
  1603. /* scan control flags */
  1604. /* passively scan all channels including active channels */
  1605. #define WMI_SCAN_FLAG_PASSIVE 0x1
  1606. /* add wild card ssid probe request even though ssid_list is specified. */
  1607. #define WMI_SCAN_ADD_BCAST_PROBE_REQ 0x2
  1608. /* add cck rates to rates/xrate ie for the generated probe request */
  1609. #define WMI_SCAN_ADD_CCK_RATES 0x4
  1610. /* add ofdm rates to rates/xrate ie for the generated probe request */
  1611. #define WMI_SCAN_ADD_OFDM_RATES 0x8
  1612. /* To enable indication of Chan load and Noise floor to host */
  1613. #define WMI_SCAN_CHAN_STAT_EVENT 0x10
  1614. /* Filter Probe request frames */
  1615. #define WMI_SCAN_FILTER_PROBE_REQ 0x20
  1616. /* When set, DFS channels will not be scanned */
  1617. #define WMI_SCAN_BYPASS_DFS_CHN 0x40
  1618. /* Different FW scan engine may choose to bail out on errors.
  1619. * Allow the driver to have influence over that. */
  1620. #define WMI_SCAN_CONTINUE_ON_ERROR 0x80
  1621. /* WMI_SCAN_CLASS_MASK must be the same value as IEEE80211_SCAN_CLASS_MASK */
  1622. #define WMI_SCAN_CLASS_MASK 0xFF000000
  1623. enum wmi_stop_scan_type {
  1624. WMI_SCAN_STOP_ONE = 0x00000000, /* stop by scan_id */
  1625. WMI_SCAN_STOP_VDEV_ALL = 0x01000000, /* stop by vdev_id */
  1626. WMI_SCAN_STOP_ALL = 0x04000000, /* stop all scans */
  1627. };
  1628. struct wmi_stop_scan_cmd {
  1629. __le32 scan_req_id;
  1630. __le32 scan_id;
  1631. __le32 req_type;
  1632. __le32 vdev_id;
  1633. } __packed;
  1634. struct wmi_stop_scan_arg {
  1635. u32 req_id;
  1636. enum wmi_stop_scan_type req_type;
  1637. union {
  1638. u32 scan_id;
  1639. u32 vdev_id;
  1640. } u;
  1641. };
  1642. struct wmi_scan_chan_list_cmd {
  1643. __le32 num_scan_chans;
  1644. struct wmi_channel chan_info[0];
  1645. } __packed;
  1646. struct wmi_scan_chan_list_arg {
  1647. u32 n_channels;
  1648. struct wmi_channel_arg *channels;
  1649. };
  1650. enum wmi_bss_filter {
  1651. WMI_BSS_FILTER_NONE = 0, /* no beacons forwarded */
  1652. WMI_BSS_FILTER_ALL, /* all beacons forwarded */
  1653. WMI_BSS_FILTER_PROFILE, /* only beacons matching profile */
  1654. WMI_BSS_FILTER_ALL_BUT_PROFILE, /* all but beacons matching profile */
  1655. WMI_BSS_FILTER_CURRENT_BSS, /* only beacons matching current BSS */
  1656. WMI_BSS_FILTER_ALL_BUT_BSS, /* all but beacons matching BSS */
  1657. WMI_BSS_FILTER_PROBED_SSID, /* beacons matching probed ssid */
  1658. WMI_BSS_FILTER_LAST_BSS, /* marker only */
  1659. };
  1660. enum wmi_scan_event_type {
  1661. WMI_SCAN_EVENT_STARTED = 0x1,
  1662. WMI_SCAN_EVENT_COMPLETED = 0x2,
  1663. WMI_SCAN_EVENT_BSS_CHANNEL = 0x4,
  1664. WMI_SCAN_EVENT_FOREIGN_CHANNEL = 0x8,
  1665. WMI_SCAN_EVENT_DEQUEUED = 0x10,
  1666. WMI_SCAN_EVENT_PREEMPTED = 0x20, /* possibly by high-prio scan */
  1667. WMI_SCAN_EVENT_START_FAILED = 0x40,
  1668. WMI_SCAN_EVENT_RESTARTED = 0x80,
  1669. WMI_SCAN_EVENT_MAX = 0x8000
  1670. };
  1671. enum wmi_scan_completion_reason {
  1672. WMI_SCAN_REASON_COMPLETED,
  1673. WMI_SCAN_REASON_CANCELLED,
  1674. WMI_SCAN_REASON_PREEMPTED,
  1675. WMI_SCAN_REASON_TIMEDOUT,
  1676. WMI_SCAN_REASON_MAX,
  1677. };
  1678. struct wmi_scan_event {
  1679. __le32 event_type; /* %WMI_SCAN_EVENT_ */
  1680. __le32 reason; /* %WMI_SCAN_REASON_ */
  1681. __le32 channel_freq; /* only valid for WMI_SCAN_EVENT_FOREIGN_CHANNEL */
  1682. __le32 scan_req_id;
  1683. __le32 scan_id;
  1684. __le32 vdev_id;
  1685. } __packed;
  1686. /*
  1687. * This defines how much headroom is kept in the
  1688. * receive frame between the descriptor and the
  1689. * payload, in order for the WMI PHY error and
  1690. * management handler to insert header contents.
  1691. *
  1692. * This is in bytes.
  1693. */
  1694. #define WMI_MGMT_RX_HDR_HEADROOM 52
  1695. /*
  1696. * This event will be used for sending scan results
  1697. * as well as rx mgmt frames to the host. The rx buffer
  1698. * will be sent as part of this WMI event. It would be a
  1699. * good idea to pass all the fields in the RX status
  1700. * descriptor up to the host.
  1701. */
  1702. struct wmi_mgmt_rx_hdr_v1 {
  1703. __le32 channel;
  1704. __le32 snr;
  1705. __le32 rate;
  1706. __le32 phy_mode;
  1707. __le32 buf_len;
  1708. __le32 status; /* %WMI_RX_STATUS_ */
  1709. } __packed;
  1710. struct wmi_mgmt_rx_hdr_v2 {
  1711. struct wmi_mgmt_rx_hdr_v1 v1;
  1712. __le32 rssi_ctl[4];
  1713. } __packed;
  1714. struct wmi_mgmt_rx_event_v1 {
  1715. struct wmi_mgmt_rx_hdr_v1 hdr;
  1716. u8 buf[0];
  1717. } __packed;
  1718. struct wmi_mgmt_rx_event_v2 {
  1719. struct wmi_mgmt_rx_hdr_v2 hdr;
  1720. u8 buf[0];
  1721. } __packed;
  1722. #define WMI_RX_STATUS_OK 0x00
  1723. #define WMI_RX_STATUS_ERR_CRC 0x01
  1724. #define WMI_RX_STATUS_ERR_DECRYPT 0x08
  1725. #define WMI_RX_STATUS_ERR_MIC 0x10
  1726. #define WMI_RX_STATUS_ERR_KEY_CACHE_MISS 0x20
  1727. struct wmi_single_phyerr_rx_hdr {
  1728. /* TSF timestamp */
  1729. __le32 tsf_timestamp;
  1730. /*
  1731. * Current freq1, freq2
  1732. *
  1733. * [7:0]: freq1[lo]
  1734. * [15:8] : freq1[hi]
  1735. * [23:16]: freq2[lo]
  1736. * [31:24]: freq2[hi]
  1737. */
  1738. __le16 freq1;
  1739. __le16 freq2;
  1740. /*
  1741. * Combined RSSI over all chains and channel width for this PHY error
  1742. *
  1743. * [7:0]: RSSI combined
  1744. * [15:8]: Channel width (MHz)
  1745. * [23:16]: PHY error code
  1746. * [24:16]: reserved (future use)
  1747. */
  1748. u8 rssi_combined;
  1749. u8 chan_width_mhz;
  1750. u8 phy_err_code;
  1751. u8 rsvd0;
  1752. /*
  1753. * RSSI on chain 0 through 3
  1754. *
  1755. * This is formatted the same as the PPDU_START RX descriptor
  1756. * field:
  1757. *
  1758. * [7:0]: pri20
  1759. * [15:8]: sec20
  1760. * [23:16]: sec40
  1761. * [31:24]: sec80
  1762. */
  1763. __le32 rssi_chain0;
  1764. __le32 rssi_chain1;
  1765. __le32 rssi_chain2;
  1766. __le32 rssi_chain3;
  1767. /*
  1768. * Last calibrated NF value for chain 0 through 3
  1769. *
  1770. * nf_list_1:
  1771. *
  1772. * + [15:0] - chain 0
  1773. * + [31:16] - chain 1
  1774. *
  1775. * nf_list_2:
  1776. *
  1777. * + [15:0] - chain 2
  1778. * + [31:16] - chain 3
  1779. */
  1780. __le32 nf_list_1;
  1781. __le32 nf_list_2;
  1782. /* Length of the frame */
  1783. __le32 buf_len;
  1784. } __packed;
  1785. struct wmi_single_phyerr_rx_event {
  1786. /* Phy error event header */
  1787. struct wmi_single_phyerr_rx_hdr hdr;
  1788. /* frame buffer */
  1789. u8 bufp[0];
  1790. } __packed;
  1791. struct wmi_comb_phyerr_rx_hdr {
  1792. /* Phy error phy error count */
  1793. __le32 num_phyerr_events;
  1794. __le32 tsf_l32;
  1795. __le32 tsf_u32;
  1796. } __packed;
  1797. struct wmi_comb_phyerr_rx_event {
  1798. /* Phy error phy error count */
  1799. struct wmi_comb_phyerr_rx_hdr hdr;
  1800. /*
  1801. * frame buffer - contains multiple payloads in the order:
  1802. * header - payload, header - payload...
  1803. * (The header is of type: wmi_single_phyerr_rx_hdr)
  1804. */
  1805. u8 bufp[0];
  1806. } __packed;
  1807. struct wmi_mgmt_tx_hdr {
  1808. __le32 vdev_id;
  1809. struct wmi_mac_addr peer_macaddr;
  1810. __le32 tx_rate;
  1811. __le32 tx_power;
  1812. __le32 buf_len;
  1813. } __packed;
  1814. struct wmi_mgmt_tx_cmd {
  1815. struct wmi_mgmt_tx_hdr hdr;
  1816. u8 buf[0];
  1817. } __packed;
  1818. struct wmi_echo_event {
  1819. __le32 value;
  1820. } __packed;
  1821. struct wmi_echo_cmd {
  1822. __le32 value;
  1823. } __packed;
  1824. struct wmi_pdev_set_regdomain_cmd {
  1825. __le32 reg_domain;
  1826. __le32 reg_domain_2G;
  1827. __le32 reg_domain_5G;
  1828. __le32 conformance_test_limit_2G;
  1829. __le32 conformance_test_limit_5G;
  1830. } __packed;
  1831. /* Command to set/unset chip in quiet mode */
  1832. struct wmi_pdev_set_quiet_cmd {
  1833. /* period in TUs */
  1834. __le32 period;
  1835. /* duration in TUs */
  1836. __le32 duration;
  1837. /* offset in TUs */
  1838. __le32 next_start;
  1839. /* enable/disable */
  1840. __le32 enabled;
  1841. } __packed;
  1842. /*
  1843. * 802.11g protection mode.
  1844. */
  1845. enum ath10k_protmode {
  1846. ATH10K_PROT_NONE = 0, /* no protection */
  1847. ATH10K_PROT_CTSONLY = 1, /* CTS to self */
  1848. ATH10K_PROT_RTSCTS = 2, /* RTS-CTS */
  1849. };
  1850. enum wmi_beacon_gen_mode {
  1851. WMI_BEACON_STAGGERED_MODE = 0,
  1852. WMI_BEACON_BURST_MODE = 1
  1853. };
  1854. enum wmi_csa_event_ies_present_flag {
  1855. WMI_CSA_IE_PRESENT = 0x00000001,
  1856. WMI_XCSA_IE_PRESENT = 0x00000002,
  1857. WMI_WBW_IE_PRESENT = 0x00000004,
  1858. WMI_CSWARP_IE_PRESENT = 0x00000008,
  1859. };
  1860. /* wmi CSA receive event from beacon frame */
  1861. struct wmi_csa_event {
  1862. __le32 i_fc_dur;
  1863. /* Bit 0-15: FC */
  1864. /* Bit 16-31: DUR */
  1865. struct wmi_mac_addr i_addr1;
  1866. struct wmi_mac_addr i_addr2;
  1867. __le32 csa_ie[2];
  1868. __le32 xcsa_ie[2];
  1869. __le32 wb_ie[2];
  1870. __le32 cswarp_ie;
  1871. __le32 ies_present_flag; /* wmi_csa_event_ies_present_flag */
  1872. } __packed;
  1873. /* the definition of different PDEV parameters */
  1874. #define PDEV_DEFAULT_STATS_UPDATE_PERIOD 500
  1875. #define VDEV_DEFAULT_STATS_UPDATE_PERIOD 500
  1876. #define PEER_DEFAULT_STATS_UPDATE_PERIOD 500
  1877. struct wmi_pdev_param_map {
  1878. u32 tx_chain_mask;
  1879. u32 rx_chain_mask;
  1880. u32 txpower_limit2g;
  1881. u32 txpower_limit5g;
  1882. u32 txpower_scale;
  1883. u32 beacon_gen_mode;
  1884. u32 beacon_tx_mode;
  1885. u32 resmgr_offchan_mode;
  1886. u32 protection_mode;
  1887. u32 dynamic_bw;
  1888. u32 non_agg_sw_retry_th;
  1889. u32 agg_sw_retry_th;
  1890. u32 sta_kickout_th;
  1891. u32 ac_aggrsize_scaling;
  1892. u32 ltr_enable;
  1893. u32 ltr_ac_latency_be;
  1894. u32 ltr_ac_latency_bk;
  1895. u32 ltr_ac_latency_vi;
  1896. u32 ltr_ac_latency_vo;
  1897. u32 ltr_ac_latency_timeout;
  1898. u32 ltr_sleep_override;
  1899. u32 ltr_rx_override;
  1900. u32 ltr_tx_activity_timeout;
  1901. u32 l1ss_enable;
  1902. u32 dsleep_enable;
  1903. u32 pcielp_txbuf_flush;
  1904. u32 pcielp_txbuf_watermark;
  1905. u32 pcielp_txbuf_tmo_en;
  1906. u32 pcielp_txbuf_tmo_value;
  1907. u32 pdev_stats_update_period;
  1908. u32 vdev_stats_update_period;
  1909. u32 peer_stats_update_period;
  1910. u32 bcnflt_stats_update_period;
  1911. u32 pmf_qos;
  1912. u32 arp_ac_override;
  1913. u32 arpdhcp_ac_override;
  1914. u32 dcs;
  1915. u32 ani_enable;
  1916. u32 ani_poll_period;
  1917. u32 ani_listen_period;
  1918. u32 ani_ofdm_level;
  1919. u32 ani_cck_level;
  1920. u32 dyntxchain;
  1921. u32 proxy_sta;
  1922. u32 idle_ps_config;
  1923. u32 power_gating_sleep;
  1924. u32 fast_channel_reset;
  1925. u32 burst_dur;
  1926. u32 burst_enable;
  1927. };
  1928. #define WMI_PDEV_PARAM_UNSUPPORTED 0
  1929. enum wmi_pdev_param {
  1930. /* TX chian mask */
  1931. WMI_PDEV_PARAM_TX_CHAIN_MASK = 0x1,
  1932. /* RX chian mask */
  1933. WMI_PDEV_PARAM_RX_CHAIN_MASK,
  1934. /* TX power limit for 2G Radio */
  1935. WMI_PDEV_PARAM_TXPOWER_LIMIT2G,
  1936. /* TX power limit for 5G Radio */
  1937. WMI_PDEV_PARAM_TXPOWER_LIMIT5G,
  1938. /* TX power scale */
  1939. WMI_PDEV_PARAM_TXPOWER_SCALE,
  1940. /* Beacon generation mode . 0: host, 1: target */
  1941. WMI_PDEV_PARAM_BEACON_GEN_MODE,
  1942. /* Beacon generation mode . 0: staggered 1: bursted */
  1943. WMI_PDEV_PARAM_BEACON_TX_MODE,
  1944. /*
  1945. * Resource manager off chan mode .
  1946. * 0: turn off off chan mode. 1: turn on offchan mode
  1947. */
  1948. WMI_PDEV_PARAM_RESMGR_OFFCHAN_MODE,
  1949. /*
  1950. * Protection mode:
  1951. * 0: no protection 1:use CTS-to-self 2: use RTS/CTS
  1952. */
  1953. WMI_PDEV_PARAM_PROTECTION_MODE,
  1954. /* Dynamic bandwidth 0: disable 1: enable */
  1955. WMI_PDEV_PARAM_DYNAMIC_BW,
  1956. /* Non aggregrate/ 11g sw retry threshold.0-disable */
  1957. WMI_PDEV_PARAM_NON_AGG_SW_RETRY_TH,
  1958. /* aggregrate sw retry threshold. 0-disable*/
  1959. WMI_PDEV_PARAM_AGG_SW_RETRY_TH,
  1960. /* Station kickout threshold (non of consecutive failures).0-disable */
  1961. WMI_PDEV_PARAM_STA_KICKOUT_TH,
  1962. /* Aggerate size scaling configuration per AC */
  1963. WMI_PDEV_PARAM_AC_AGGRSIZE_SCALING,
  1964. /* LTR enable */
  1965. WMI_PDEV_PARAM_LTR_ENABLE,
  1966. /* LTR latency for BE, in us */
  1967. WMI_PDEV_PARAM_LTR_AC_LATENCY_BE,
  1968. /* LTR latency for BK, in us */
  1969. WMI_PDEV_PARAM_LTR_AC_LATENCY_BK,
  1970. /* LTR latency for VI, in us */
  1971. WMI_PDEV_PARAM_LTR_AC_LATENCY_VI,
  1972. /* LTR latency for VO, in us */
  1973. WMI_PDEV_PARAM_LTR_AC_LATENCY_VO,
  1974. /* LTR AC latency timeout, in ms */
  1975. WMI_PDEV_PARAM_LTR_AC_LATENCY_TIMEOUT,
  1976. /* LTR platform latency override, in us */
  1977. WMI_PDEV_PARAM_LTR_SLEEP_OVERRIDE,
  1978. /* LTR-RX override, in us */
  1979. WMI_PDEV_PARAM_LTR_RX_OVERRIDE,
  1980. /* Tx activity timeout for LTR, in us */
  1981. WMI_PDEV_PARAM_LTR_TX_ACTIVITY_TIMEOUT,
  1982. /* L1SS state machine enable */
  1983. WMI_PDEV_PARAM_L1SS_ENABLE,
  1984. /* Deep sleep state machine enable */
  1985. WMI_PDEV_PARAM_DSLEEP_ENABLE,
  1986. /* RX buffering flush enable */
  1987. WMI_PDEV_PARAM_PCIELP_TXBUF_FLUSH,
  1988. /* RX buffering matermark */
  1989. WMI_PDEV_PARAM_PCIELP_TXBUF_WATERMARK,
  1990. /* RX buffering timeout enable */
  1991. WMI_PDEV_PARAM_PCIELP_TXBUF_TMO_EN,
  1992. /* RX buffering timeout value */
  1993. WMI_PDEV_PARAM_PCIELP_TXBUF_TMO_VALUE,
  1994. /* pdev level stats update period in ms */
  1995. WMI_PDEV_PARAM_PDEV_STATS_UPDATE_PERIOD,
  1996. /* vdev level stats update period in ms */
  1997. WMI_PDEV_PARAM_VDEV_STATS_UPDATE_PERIOD,
  1998. /* peer level stats update period in ms */
  1999. WMI_PDEV_PARAM_PEER_STATS_UPDATE_PERIOD,
  2000. /* beacon filter status update period */
  2001. WMI_PDEV_PARAM_BCNFLT_STATS_UPDATE_PERIOD,
  2002. /* QOS Mgmt frame protection MFP/PMF 0: disable, 1: enable */
  2003. WMI_PDEV_PARAM_PMF_QOS,
  2004. /* Access category on which ARP frames are sent */
  2005. WMI_PDEV_PARAM_ARP_AC_OVERRIDE,
  2006. /* DCS configuration */
  2007. WMI_PDEV_PARAM_DCS,
  2008. /* Enable/Disable ANI on target */
  2009. WMI_PDEV_PARAM_ANI_ENABLE,
  2010. /* configure the ANI polling period */
  2011. WMI_PDEV_PARAM_ANI_POLL_PERIOD,
  2012. /* configure the ANI listening period */
  2013. WMI_PDEV_PARAM_ANI_LISTEN_PERIOD,
  2014. /* configure OFDM immunity level */
  2015. WMI_PDEV_PARAM_ANI_OFDM_LEVEL,
  2016. /* configure CCK immunity level */
  2017. WMI_PDEV_PARAM_ANI_CCK_LEVEL,
  2018. /* Enable/Disable CDD for 1x1 STAs in rate control module */
  2019. WMI_PDEV_PARAM_DYNTXCHAIN,
  2020. /* Enable/Disable proxy STA */
  2021. WMI_PDEV_PARAM_PROXY_STA,
  2022. /* Enable/Disable low power state when all VDEVs are inactive/idle. */
  2023. WMI_PDEV_PARAM_IDLE_PS_CONFIG,
  2024. /* Enable/Disable power gating sleep */
  2025. WMI_PDEV_PARAM_POWER_GATING_SLEEP,
  2026. };
  2027. enum wmi_10x_pdev_param {
  2028. /* TX chian mask */
  2029. WMI_10X_PDEV_PARAM_TX_CHAIN_MASK = 0x1,
  2030. /* RX chian mask */
  2031. WMI_10X_PDEV_PARAM_RX_CHAIN_MASK,
  2032. /* TX power limit for 2G Radio */
  2033. WMI_10X_PDEV_PARAM_TXPOWER_LIMIT2G,
  2034. /* TX power limit for 5G Radio */
  2035. WMI_10X_PDEV_PARAM_TXPOWER_LIMIT5G,
  2036. /* TX power scale */
  2037. WMI_10X_PDEV_PARAM_TXPOWER_SCALE,
  2038. /* Beacon generation mode . 0: host, 1: target */
  2039. WMI_10X_PDEV_PARAM_BEACON_GEN_MODE,
  2040. /* Beacon generation mode . 0: staggered 1: bursted */
  2041. WMI_10X_PDEV_PARAM_BEACON_TX_MODE,
  2042. /*
  2043. * Resource manager off chan mode .
  2044. * 0: turn off off chan mode. 1: turn on offchan mode
  2045. */
  2046. WMI_10X_PDEV_PARAM_RESMGR_OFFCHAN_MODE,
  2047. /*
  2048. * Protection mode:
  2049. * 0: no protection 1:use CTS-to-self 2: use RTS/CTS
  2050. */
  2051. WMI_10X_PDEV_PARAM_PROTECTION_MODE,
  2052. /* Dynamic bandwidth 0: disable 1: enable */
  2053. WMI_10X_PDEV_PARAM_DYNAMIC_BW,
  2054. /* Non aggregrate/ 11g sw retry threshold.0-disable */
  2055. WMI_10X_PDEV_PARAM_NON_AGG_SW_RETRY_TH,
  2056. /* aggregrate sw retry threshold. 0-disable*/
  2057. WMI_10X_PDEV_PARAM_AGG_SW_RETRY_TH,
  2058. /* Station kickout threshold (non of consecutive failures).0-disable */
  2059. WMI_10X_PDEV_PARAM_STA_KICKOUT_TH,
  2060. /* Aggerate size scaling configuration per AC */
  2061. WMI_10X_PDEV_PARAM_AC_AGGRSIZE_SCALING,
  2062. /* LTR enable */
  2063. WMI_10X_PDEV_PARAM_LTR_ENABLE,
  2064. /* LTR latency for BE, in us */
  2065. WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_BE,
  2066. /* LTR latency for BK, in us */
  2067. WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_BK,
  2068. /* LTR latency for VI, in us */
  2069. WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_VI,
  2070. /* LTR latency for VO, in us */
  2071. WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_VO,
  2072. /* LTR AC latency timeout, in ms */
  2073. WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_TIMEOUT,
  2074. /* LTR platform latency override, in us */
  2075. WMI_10X_PDEV_PARAM_LTR_SLEEP_OVERRIDE,
  2076. /* LTR-RX override, in us */
  2077. WMI_10X_PDEV_PARAM_LTR_RX_OVERRIDE,
  2078. /* Tx activity timeout for LTR, in us */
  2079. WMI_10X_PDEV_PARAM_LTR_TX_ACTIVITY_TIMEOUT,
  2080. /* L1SS state machine enable */
  2081. WMI_10X_PDEV_PARAM_L1SS_ENABLE,
  2082. /* Deep sleep state machine enable */
  2083. WMI_10X_PDEV_PARAM_DSLEEP_ENABLE,
  2084. /* pdev level stats update period in ms */
  2085. WMI_10X_PDEV_PARAM_PDEV_STATS_UPDATE_PERIOD,
  2086. /* vdev level stats update period in ms */
  2087. WMI_10X_PDEV_PARAM_VDEV_STATS_UPDATE_PERIOD,
  2088. /* peer level stats update period in ms */
  2089. WMI_10X_PDEV_PARAM_PEER_STATS_UPDATE_PERIOD,
  2090. /* beacon filter status update period */
  2091. WMI_10X_PDEV_PARAM_BCNFLT_STATS_UPDATE_PERIOD,
  2092. /* QOS Mgmt frame protection MFP/PMF 0: disable, 1: enable */
  2093. WMI_10X_PDEV_PARAM_PMF_QOS,
  2094. /* Access category on which ARP and DHCP frames are sent */
  2095. WMI_10X_PDEV_PARAM_ARPDHCP_AC_OVERRIDE,
  2096. /* DCS configuration */
  2097. WMI_10X_PDEV_PARAM_DCS,
  2098. /* Enable/Disable ANI on target */
  2099. WMI_10X_PDEV_PARAM_ANI_ENABLE,
  2100. /* configure the ANI polling period */
  2101. WMI_10X_PDEV_PARAM_ANI_POLL_PERIOD,
  2102. /* configure the ANI listening period */
  2103. WMI_10X_PDEV_PARAM_ANI_LISTEN_PERIOD,
  2104. /* configure OFDM immunity level */
  2105. WMI_10X_PDEV_PARAM_ANI_OFDM_LEVEL,
  2106. /* configure CCK immunity level */
  2107. WMI_10X_PDEV_PARAM_ANI_CCK_LEVEL,
  2108. /* Enable/Disable CDD for 1x1 STAs in rate control module */
  2109. WMI_10X_PDEV_PARAM_DYNTXCHAIN,
  2110. /* Enable/Disable Fast channel reset*/
  2111. WMI_10X_PDEV_PARAM_FAST_CHANNEL_RESET,
  2112. /* Set Bursting DUR */
  2113. WMI_10X_PDEV_PARAM_BURST_DUR,
  2114. /* Set Bursting Enable*/
  2115. WMI_10X_PDEV_PARAM_BURST_ENABLE,
  2116. };
  2117. struct wmi_pdev_set_param_cmd {
  2118. __le32 param_id;
  2119. __le32 param_value;
  2120. } __packed;
  2121. struct wmi_pdev_get_tpc_config_cmd {
  2122. /* parameter */
  2123. __le32 param;
  2124. } __packed;
  2125. #define WMI_TPC_RATE_MAX 160
  2126. #define WMI_TPC_TX_N_CHAIN 4
  2127. enum wmi_tpc_config_event_flag {
  2128. WMI_TPC_CONFIG_EVENT_FLAG_TABLE_CDD = 0x1,
  2129. WMI_TPC_CONFIG_EVENT_FLAG_TABLE_STBC = 0x2,
  2130. WMI_TPC_CONFIG_EVENT_FLAG_TABLE_TXBF = 0x4,
  2131. };
  2132. struct wmi_pdev_tpc_config_event {
  2133. __le32 reg_domain;
  2134. __le32 chan_freq;
  2135. __le32 phy_mode;
  2136. __le32 twice_antenna_reduction;
  2137. __le32 twice_max_rd_power;
  2138. s32 twice_antenna_gain;
  2139. __le32 power_limit;
  2140. __le32 rate_max;
  2141. __le32 num_tx_chain;
  2142. __le32 ctl;
  2143. __le32 flags;
  2144. s8 max_reg_allow_pow[WMI_TPC_TX_N_CHAIN];
  2145. s8 max_reg_allow_pow_agcdd[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
  2146. s8 max_reg_allow_pow_agstbc[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
  2147. s8 max_reg_allow_pow_agtxbf[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
  2148. u8 rates_array[WMI_TPC_RATE_MAX];
  2149. } __packed;
  2150. /* Transmit power scale factor. */
  2151. enum wmi_tp_scale {
  2152. WMI_TP_SCALE_MAX = 0, /* no scaling (default) */
  2153. WMI_TP_SCALE_50 = 1, /* 50% of max (-3 dBm) */
  2154. WMI_TP_SCALE_25 = 2, /* 25% of max (-6 dBm) */
  2155. WMI_TP_SCALE_12 = 3, /* 12% of max (-9 dBm) */
  2156. WMI_TP_SCALE_MIN = 4, /* min, but still on */
  2157. WMI_TP_SCALE_SIZE = 5, /* max num of enum */
  2158. };
  2159. struct wmi_set_channel_cmd {
  2160. /* channel (only frequency and mode info are used) */
  2161. struct wmi_channel chan;
  2162. } __packed;
  2163. struct wmi_pdev_chanlist_update_event {
  2164. /* number of channels */
  2165. __le32 num_chan;
  2166. /* array of channels */
  2167. struct wmi_channel channel_list[1];
  2168. } __packed;
  2169. #define WMI_MAX_DEBUG_MESG (sizeof(u32) * 32)
  2170. struct wmi_debug_mesg_event {
  2171. /* message buffer, NULL terminated */
  2172. char bufp[WMI_MAX_DEBUG_MESG];
  2173. } __packed;
  2174. enum {
  2175. /* P2P device */
  2176. VDEV_SUBTYPE_P2PDEV = 0,
  2177. /* P2P client */
  2178. VDEV_SUBTYPE_P2PCLI,
  2179. /* P2P GO */
  2180. VDEV_SUBTYPE_P2PGO,
  2181. /* BT3.0 HS */
  2182. VDEV_SUBTYPE_BT,
  2183. };
  2184. struct wmi_pdev_set_channel_cmd {
  2185. /* idnore power , only use flags , mode and freq */
  2186. struct wmi_channel chan;
  2187. } __packed;
  2188. /* Customize the DSCP (bit) to TID (0-7) mapping for QOS */
  2189. #define WMI_DSCP_MAP_MAX (64)
  2190. struct wmi_pdev_set_dscp_tid_map_cmd {
  2191. /* map indicating DSCP to TID conversion */
  2192. __le32 dscp_to_tid_map[WMI_DSCP_MAP_MAX];
  2193. } __packed;
  2194. enum mcast_bcast_rate_id {
  2195. WMI_SET_MCAST_RATE,
  2196. WMI_SET_BCAST_RATE
  2197. };
  2198. struct mcast_bcast_rate {
  2199. enum mcast_bcast_rate_id rate_id;
  2200. __le32 rate;
  2201. } __packed;
  2202. struct wmi_wmm_params {
  2203. __le32 cwmin;
  2204. __le32 cwmax;
  2205. __le32 aifs;
  2206. __le32 txop;
  2207. __le32 acm;
  2208. __le32 no_ack;
  2209. } __packed;
  2210. struct wmi_pdev_set_wmm_params {
  2211. struct wmi_wmm_params ac_be;
  2212. struct wmi_wmm_params ac_bk;
  2213. struct wmi_wmm_params ac_vi;
  2214. struct wmi_wmm_params ac_vo;
  2215. } __packed;
  2216. struct wmi_wmm_params_arg {
  2217. u32 cwmin;
  2218. u32 cwmax;
  2219. u32 aifs;
  2220. u32 txop;
  2221. u32 acm;
  2222. u32 no_ack;
  2223. };
  2224. struct wmi_pdev_set_wmm_params_arg {
  2225. struct wmi_wmm_params_arg ac_be;
  2226. struct wmi_wmm_params_arg ac_bk;
  2227. struct wmi_wmm_params_arg ac_vi;
  2228. struct wmi_wmm_params_arg ac_vo;
  2229. };
  2230. struct wal_dbg_tx_stats {
  2231. /* Num HTT cookies queued to dispatch list */
  2232. __le32 comp_queued;
  2233. /* Num HTT cookies dispatched */
  2234. __le32 comp_delivered;
  2235. /* Num MSDU queued to WAL */
  2236. __le32 msdu_enqued;
  2237. /* Num MPDU queue to WAL */
  2238. __le32 mpdu_enqued;
  2239. /* Num MSDUs dropped by WMM limit */
  2240. __le32 wmm_drop;
  2241. /* Num Local frames queued */
  2242. __le32 local_enqued;
  2243. /* Num Local frames done */
  2244. __le32 local_freed;
  2245. /* Num queued to HW */
  2246. __le32 hw_queued;
  2247. /* Num PPDU reaped from HW */
  2248. __le32 hw_reaped;
  2249. /* Num underruns */
  2250. __le32 underrun;
  2251. /* Num PPDUs cleaned up in TX abort */
  2252. __le32 tx_abort;
  2253. /* Num MPDUs requed by SW */
  2254. __le32 mpdus_requed;
  2255. /* excessive retries */
  2256. __le32 tx_ko;
  2257. /* data hw rate code */
  2258. __le32 data_rc;
  2259. /* Scheduler self triggers */
  2260. __le32 self_triggers;
  2261. /* frames dropped due to excessive sw retries */
  2262. __le32 sw_retry_failure;
  2263. /* illegal rate phy errors */
  2264. __le32 illgl_rate_phy_err;
  2265. /* wal pdev continous xretry */
  2266. __le32 pdev_cont_xretry;
  2267. /* wal pdev continous xretry */
  2268. __le32 pdev_tx_timeout;
  2269. /* wal pdev resets */
  2270. __le32 pdev_resets;
  2271. __le32 phy_underrun;
  2272. /* MPDU is more than txop limit */
  2273. __le32 txop_ovf;
  2274. } __packed;
  2275. struct wal_dbg_rx_stats {
  2276. /* Cnts any change in ring routing mid-ppdu */
  2277. __le32 mid_ppdu_route_change;
  2278. /* Total number of statuses processed */
  2279. __le32 status_rcvd;
  2280. /* Extra frags on rings 0-3 */
  2281. __le32 r0_frags;
  2282. __le32 r1_frags;
  2283. __le32 r2_frags;
  2284. __le32 r3_frags;
  2285. /* MSDUs / MPDUs delivered to HTT */
  2286. __le32 htt_msdus;
  2287. __le32 htt_mpdus;
  2288. /* MSDUs / MPDUs delivered to local stack */
  2289. __le32 loc_msdus;
  2290. __le32 loc_mpdus;
  2291. /* AMSDUs that have more MSDUs than the status ring size */
  2292. __le32 oversize_amsdu;
  2293. /* Number of PHY errors */
  2294. __le32 phy_errs;
  2295. /* Number of PHY errors drops */
  2296. __le32 phy_err_drop;
  2297. /* Number of mpdu errors - FCS, MIC, ENC etc. */
  2298. __le32 mpdu_errs;
  2299. } __packed;
  2300. struct wal_dbg_peer_stats {
  2301. /* REMOVE THIS ONCE REAL PEER STAT COUNTERS ARE ADDED */
  2302. __le32 dummy;
  2303. } __packed;
  2304. struct wal_dbg_stats {
  2305. struct wal_dbg_tx_stats tx;
  2306. struct wal_dbg_rx_stats rx;
  2307. struct wal_dbg_peer_stats peer;
  2308. } __packed;
  2309. enum wmi_stats_id {
  2310. WMI_REQUEST_PEER_STAT = 0x01,
  2311. WMI_REQUEST_AP_STAT = 0x02
  2312. };
  2313. struct wmi_request_stats_cmd {
  2314. __le32 stats_id;
  2315. /*
  2316. * Space to add parameters like
  2317. * peer mac addr
  2318. */
  2319. } __packed;
  2320. /* Suspend option */
  2321. enum {
  2322. /* suspend */
  2323. WMI_PDEV_SUSPEND,
  2324. /* suspend and disable all interrupts */
  2325. WMI_PDEV_SUSPEND_AND_DISABLE_INTR,
  2326. };
  2327. struct wmi_pdev_suspend_cmd {
  2328. /* suspend option sent to target */
  2329. __le32 suspend_opt;
  2330. } __packed;
  2331. struct wmi_stats_event {
  2332. __le32 stats_id; /* %WMI_REQUEST_ */
  2333. /*
  2334. * number of pdev stats event structures
  2335. * (wmi_pdev_stats) 0 or 1
  2336. */
  2337. __le32 num_pdev_stats;
  2338. /*
  2339. * number of vdev stats event structures
  2340. * (wmi_vdev_stats) 0 or max vdevs
  2341. */
  2342. __le32 num_vdev_stats;
  2343. /*
  2344. * number of peer stats event structures
  2345. * (wmi_peer_stats) 0 or max peers
  2346. */
  2347. __le32 num_peer_stats;
  2348. __le32 num_bcnflt_stats;
  2349. /*
  2350. * followed by
  2351. * num_pdev_stats * size of(struct wmi_pdev_stats)
  2352. * num_vdev_stats * size of(struct wmi_vdev_stats)
  2353. * num_peer_stats * size of(struct wmi_peer_stats)
  2354. *
  2355. * By having a zero sized array, the pointer to data area
  2356. * becomes available without increasing the struct size
  2357. */
  2358. u8 data[0];
  2359. } __packed;
  2360. /*
  2361. * PDEV statistics
  2362. * TODO: add all PDEV stats here
  2363. */
  2364. struct wmi_pdev_stats {
  2365. __le32 chan_nf; /* Channel noise floor */
  2366. __le32 tx_frame_count; /* TX frame count */
  2367. __le32 rx_frame_count; /* RX frame count */
  2368. __le32 rx_clear_count; /* rx clear count */
  2369. __le32 cycle_count; /* cycle count */
  2370. __le32 phy_err_count; /* Phy error count */
  2371. __le32 chan_tx_pwr; /* channel tx power */
  2372. struct wal_dbg_stats wal; /* WAL dbg stats */
  2373. } __packed;
  2374. /*
  2375. * VDEV statistics
  2376. * TODO: add all VDEV stats here
  2377. */
  2378. struct wmi_vdev_stats {
  2379. __le32 vdev_id;
  2380. } __packed;
  2381. /*
  2382. * peer statistics.
  2383. * TODO: add more stats
  2384. */
  2385. struct wmi_peer_stats {
  2386. struct wmi_mac_addr peer_macaddr;
  2387. __le32 peer_rssi;
  2388. __le32 peer_tx_rate;
  2389. } __packed;
  2390. struct wmi_vdev_create_cmd {
  2391. __le32 vdev_id;
  2392. __le32 vdev_type;
  2393. __le32 vdev_subtype;
  2394. struct wmi_mac_addr vdev_macaddr;
  2395. } __packed;
  2396. enum wmi_vdev_type {
  2397. WMI_VDEV_TYPE_AP = 1,
  2398. WMI_VDEV_TYPE_STA = 2,
  2399. WMI_VDEV_TYPE_IBSS = 3,
  2400. WMI_VDEV_TYPE_MONITOR = 4,
  2401. };
  2402. enum wmi_vdev_subtype {
  2403. WMI_VDEV_SUBTYPE_NONE = 0,
  2404. WMI_VDEV_SUBTYPE_P2P_DEVICE = 1,
  2405. WMI_VDEV_SUBTYPE_P2P_CLIENT = 2,
  2406. WMI_VDEV_SUBTYPE_P2P_GO = 3,
  2407. };
  2408. /* values for vdev_subtype */
  2409. /* values for vdev_start_request flags */
  2410. /*
  2411. * Indicates that AP VDEV uses hidden ssid. only valid for
  2412. * AP/GO */
  2413. #define WMI_VDEV_START_HIDDEN_SSID (1<<0)
  2414. /*
  2415. * Indicates if robust management frame/management frame
  2416. * protection is enabled. For GO/AP vdevs, it indicates that
  2417. * it may support station/client associations with RMF enabled.
  2418. * For STA/client vdevs, it indicates that sta will
  2419. * associate with AP with RMF enabled. */
  2420. #define WMI_VDEV_START_PMF_ENABLED (1<<1)
  2421. struct wmi_p2p_noa_descriptor {
  2422. __le32 type_count; /* 255: continuous schedule, 0: reserved */
  2423. __le32 duration; /* Absent period duration in micro seconds */
  2424. __le32 interval; /* Absent period interval in micro seconds */
  2425. __le32 start_time; /* 32 bit tsf time when in starts */
  2426. } __packed;
  2427. struct wmi_vdev_start_request_cmd {
  2428. /* WMI channel */
  2429. struct wmi_channel chan;
  2430. /* unique id identifying the VDEV, generated by the caller */
  2431. __le32 vdev_id;
  2432. /* requestor id identifying the caller module */
  2433. __le32 requestor_id;
  2434. /* beacon interval from received beacon */
  2435. __le32 beacon_interval;
  2436. /* DTIM Period from the received beacon */
  2437. __le32 dtim_period;
  2438. /* Flags */
  2439. __le32 flags;
  2440. /* ssid field. Only valid for AP/GO/IBSS/BTAmp VDEV type. */
  2441. struct wmi_ssid ssid;
  2442. /* beacon/probe reponse xmit rate. Applicable for SoftAP. */
  2443. __le32 bcn_tx_rate;
  2444. /* beacon/probe reponse xmit power. Applicable for SoftAP. */
  2445. __le32 bcn_tx_power;
  2446. /* number of p2p NOA descriptor(s) from scan entry */
  2447. __le32 num_noa_descriptors;
  2448. /*
  2449. * Disable H/W ack. This used by WMI_VDEV_RESTART_REQUEST_CMDID.
  2450. * During CAC, Our HW shouldn't ack ditected frames
  2451. */
  2452. __le32 disable_hw_ack;
  2453. /* actual p2p NOA descriptor from scan entry */
  2454. struct wmi_p2p_noa_descriptor noa_descriptors[2];
  2455. } __packed;
  2456. struct wmi_vdev_restart_request_cmd {
  2457. struct wmi_vdev_start_request_cmd vdev_start_request_cmd;
  2458. } __packed;
  2459. struct wmi_vdev_start_request_arg {
  2460. u32 vdev_id;
  2461. struct wmi_channel_arg channel;
  2462. u32 bcn_intval;
  2463. u32 dtim_period;
  2464. u8 *ssid;
  2465. u32 ssid_len;
  2466. u32 bcn_tx_rate;
  2467. u32 bcn_tx_power;
  2468. bool disable_hw_ack;
  2469. bool hidden_ssid;
  2470. bool pmf_enabled;
  2471. };
  2472. struct wmi_vdev_delete_cmd {
  2473. /* unique id identifying the VDEV, generated by the caller */
  2474. __le32 vdev_id;
  2475. } __packed;
  2476. struct wmi_vdev_up_cmd {
  2477. __le32 vdev_id;
  2478. __le32 vdev_assoc_id;
  2479. struct wmi_mac_addr vdev_bssid;
  2480. } __packed;
  2481. struct wmi_vdev_stop_cmd {
  2482. __le32 vdev_id;
  2483. } __packed;
  2484. struct wmi_vdev_down_cmd {
  2485. __le32 vdev_id;
  2486. } __packed;
  2487. struct wmi_vdev_standby_response_cmd {
  2488. /* unique id identifying the VDEV, generated by the caller */
  2489. __le32 vdev_id;
  2490. } __packed;
  2491. struct wmi_vdev_resume_response_cmd {
  2492. /* unique id identifying the VDEV, generated by the caller */
  2493. __le32 vdev_id;
  2494. } __packed;
  2495. struct wmi_vdev_set_param_cmd {
  2496. __le32 vdev_id;
  2497. __le32 param_id;
  2498. __le32 param_value;
  2499. } __packed;
  2500. #define WMI_MAX_KEY_INDEX 3
  2501. #define WMI_MAX_KEY_LEN 32
  2502. #define WMI_KEY_PAIRWISE 0x00
  2503. #define WMI_KEY_GROUP 0x01
  2504. #define WMI_KEY_TX_USAGE 0x02 /* default tx key - static wep */
  2505. struct wmi_key_seq_counter {
  2506. __le32 key_seq_counter_l;
  2507. __le32 key_seq_counter_h;
  2508. } __packed;
  2509. #define WMI_CIPHER_NONE 0x0 /* clear key */
  2510. #define WMI_CIPHER_WEP 0x1
  2511. #define WMI_CIPHER_TKIP 0x2
  2512. #define WMI_CIPHER_AES_OCB 0x3
  2513. #define WMI_CIPHER_AES_CCM 0x4
  2514. #define WMI_CIPHER_WAPI 0x5
  2515. #define WMI_CIPHER_CKIP 0x6
  2516. #define WMI_CIPHER_AES_CMAC 0x7
  2517. struct wmi_vdev_install_key_cmd {
  2518. __le32 vdev_id;
  2519. struct wmi_mac_addr peer_macaddr;
  2520. __le32 key_idx;
  2521. __le32 key_flags;
  2522. __le32 key_cipher; /* %WMI_CIPHER_ */
  2523. struct wmi_key_seq_counter key_rsc_counter;
  2524. struct wmi_key_seq_counter key_global_rsc_counter;
  2525. struct wmi_key_seq_counter key_tsc_counter;
  2526. u8 wpi_key_rsc_counter[16];
  2527. u8 wpi_key_tsc_counter[16];
  2528. __le32 key_len;
  2529. __le32 key_txmic_len;
  2530. __le32 key_rxmic_len;
  2531. /* contains key followed by tx mic followed by rx mic */
  2532. u8 key_data[0];
  2533. } __packed;
  2534. struct wmi_vdev_install_key_arg {
  2535. u32 vdev_id;
  2536. const u8 *macaddr;
  2537. u32 key_idx;
  2538. u32 key_flags;
  2539. u32 key_cipher;
  2540. u32 key_len;
  2541. u32 key_txmic_len;
  2542. u32 key_rxmic_len;
  2543. const void *key_data;
  2544. };
  2545. /* Preamble types to be used with VDEV fixed rate configuration */
  2546. enum wmi_rate_preamble {
  2547. WMI_RATE_PREAMBLE_OFDM,
  2548. WMI_RATE_PREAMBLE_CCK,
  2549. WMI_RATE_PREAMBLE_HT,
  2550. WMI_RATE_PREAMBLE_VHT,
  2551. };
  2552. /* Value to disable fixed rate setting */
  2553. #define WMI_FIXED_RATE_NONE (0xff)
  2554. struct wmi_vdev_param_map {
  2555. u32 rts_threshold;
  2556. u32 fragmentation_threshold;
  2557. u32 beacon_interval;
  2558. u32 listen_interval;
  2559. u32 multicast_rate;
  2560. u32 mgmt_tx_rate;
  2561. u32 slot_time;
  2562. u32 preamble;
  2563. u32 swba_time;
  2564. u32 wmi_vdev_stats_update_period;
  2565. u32 wmi_vdev_pwrsave_ageout_time;
  2566. u32 wmi_vdev_host_swba_interval;
  2567. u32 dtim_period;
  2568. u32 wmi_vdev_oc_scheduler_air_time_limit;
  2569. u32 wds;
  2570. u32 atim_window;
  2571. u32 bmiss_count_max;
  2572. u32 bmiss_first_bcnt;
  2573. u32 bmiss_final_bcnt;
  2574. u32 feature_wmm;
  2575. u32 chwidth;
  2576. u32 chextoffset;
  2577. u32 disable_htprotection;
  2578. u32 sta_quickkickout;
  2579. u32 mgmt_rate;
  2580. u32 protection_mode;
  2581. u32 fixed_rate;
  2582. u32 sgi;
  2583. u32 ldpc;
  2584. u32 tx_stbc;
  2585. u32 rx_stbc;
  2586. u32 intra_bss_fwd;
  2587. u32 def_keyid;
  2588. u32 nss;
  2589. u32 bcast_data_rate;
  2590. u32 mcast_data_rate;
  2591. u32 mcast_indicate;
  2592. u32 dhcp_indicate;
  2593. u32 unknown_dest_indicate;
  2594. u32 ap_keepalive_min_idle_inactive_time_secs;
  2595. u32 ap_keepalive_max_idle_inactive_time_secs;
  2596. u32 ap_keepalive_max_unresponsive_time_secs;
  2597. u32 ap_enable_nawds;
  2598. u32 mcast2ucast_set;
  2599. u32 enable_rtscts;
  2600. u32 txbf;
  2601. u32 packet_powersave;
  2602. u32 drop_unencry;
  2603. u32 tx_encap_type;
  2604. u32 ap_detect_out_of_sync_sleeping_sta_time_secs;
  2605. };
  2606. #define WMI_VDEV_PARAM_UNSUPPORTED 0
  2607. /* the definition of different VDEV parameters */
  2608. enum wmi_vdev_param {
  2609. /* RTS Threshold */
  2610. WMI_VDEV_PARAM_RTS_THRESHOLD = 0x1,
  2611. /* Fragmentation threshold */
  2612. WMI_VDEV_PARAM_FRAGMENTATION_THRESHOLD,
  2613. /* beacon interval in TUs */
  2614. WMI_VDEV_PARAM_BEACON_INTERVAL,
  2615. /* Listen interval in TUs */
  2616. WMI_VDEV_PARAM_LISTEN_INTERVAL,
  2617. /* muticast rate in Mbps */
  2618. WMI_VDEV_PARAM_MULTICAST_RATE,
  2619. /* management frame rate in Mbps */
  2620. WMI_VDEV_PARAM_MGMT_TX_RATE,
  2621. /* slot time (long vs short) */
  2622. WMI_VDEV_PARAM_SLOT_TIME,
  2623. /* preamble (long vs short) */
  2624. WMI_VDEV_PARAM_PREAMBLE,
  2625. /* SWBA time (time before tbtt in msec) */
  2626. WMI_VDEV_PARAM_SWBA_TIME,
  2627. /* time period for updating VDEV stats */
  2628. WMI_VDEV_STATS_UPDATE_PERIOD,
  2629. /* age out time in msec for frames queued for station in power save */
  2630. WMI_VDEV_PWRSAVE_AGEOUT_TIME,
  2631. /*
  2632. * Host SWBA interval (time in msec before tbtt for SWBA event
  2633. * generation).
  2634. */
  2635. WMI_VDEV_HOST_SWBA_INTERVAL,
  2636. /* DTIM period (specified in units of num beacon intervals) */
  2637. WMI_VDEV_PARAM_DTIM_PERIOD,
  2638. /*
  2639. * scheduler air time limit for this VDEV. used by off chan
  2640. * scheduler.
  2641. */
  2642. WMI_VDEV_OC_SCHEDULER_AIR_TIME_LIMIT,
  2643. /* enable/dsiable WDS for this VDEV */
  2644. WMI_VDEV_PARAM_WDS,
  2645. /* ATIM Window */
  2646. WMI_VDEV_PARAM_ATIM_WINDOW,
  2647. /* BMISS max */
  2648. WMI_VDEV_PARAM_BMISS_COUNT_MAX,
  2649. /* BMISS first time */
  2650. WMI_VDEV_PARAM_BMISS_FIRST_BCNT,
  2651. /* BMISS final time */
  2652. WMI_VDEV_PARAM_BMISS_FINAL_BCNT,
  2653. /* WMM enables/disabled */
  2654. WMI_VDEV_PARAM_FEATURE_WMM,
  2655. /* Channel width */
  2656. WMI_VDEV_PARAM_CHWIDTH,
  2657. /* Channel Offset */
  2658. WMI_VDEV_PARAM_CHEXTOFFSET,
  2659. /* Disable HT Protection */
  2660. WMI_VDEV_PARAM_DISABLE_HTPROTECTION,
  2661. /* Quick STA Kickout */
  2662. WMI_VDEV_PARAM_STA_QUICKKICKOUT,
  2663. /* Rate to be used with Management frames */
  2664. WMI_VDEV_PARAM_MGMT_RATE,
  2665. /* Protection Mode */
  2666. WMI_VDEV_PARAM_PROTECTION_MODE,
  2667. /* Fixed rate setting */
  2668. WMI_VDEV_PARAM_FIXED_RATE,
  2669. /* Short GI Enable/Disable */
  2670. WMI_VDEV_PARAM_SGI,
  2671. /* Enable LDPC */
  2672. WMI_VDEV_PARAM_LDPC,
  2673. /* Enable Tx STBC */
  2674. WMI_VDEV_PARAM_TX_STBC,
  2675. /* Enable Rx STBC */
  2676. WMI_VDEV_PARAM_RX_STBC,
  2677. /* Intra BSS forwarding */
  2678. WMI_VDEV_PARAM_INTRA_BSS_FWD,
  2679. /* Setting Default xmit key for Vdev */
  2680. WMI_VDEV_PARAM_DEF_KEYID,
  2681. /* NSS width */
  2682. WMI_VDEV_PARAM_NSS,
  2683. /* Set the custom rate for the broadcast data frames */
  2684. WMI_VDEV_PARAM_BCAST_DATA_RATE,
  2685. /* Set the custom rate (rate-code) for multicast data frames */
  2686. WMI_VDEV_PARAM_MCAST_DATA_RATE,
  2687. /* Tx multicast packet indicate Enable/Disable */
  2688. WMI_VDEV_PARAM_MCAST_INDICATE,
  2689. /* Tx DHCP packet indicate Enable/Disable */
  2690. WMI_VDEV_PARAM_DHCP_INDICATE,
  2691. /* Enable host inspection of Tx unicast packet to unknown destination */
  2692. WMI_VDEV_PARAM_UNKNOWN_DEST_INDICATE,
  2693. /* The minimum amount of time AP begins to consider STA inactive */
  2694. WMI_VDEV_PARAM_AP_KEEPALIVE_MIN_IDLE_INACTIVE_TIME_SECS,
  2695. /*
  2696. * An associated STA is considered inactive when there is no recent
  2697. * TX/RX activity and no downlink frames are buffered for it. Once a
  2698. * STA exceeds the maximum idle inactive time, the AP will send an
  2699. * 802.11 data-null as a keep alive to verify the STA is still
  2700. * associated. If the STA does ACK the data-null, or if the data-null
  2701. * is buffered and the STA does not retrieve it, the STA will be
  2702. * considered unresponsive
  2703. * (see WMI_VDEV_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS).
  2704. */
  2705. WMI_VDEV_PARAM_AP_KEEPALIVE_MAX_IDLE_INACTIVE_TIME_SECS,
  2706. /*
  2707. * An associated STA is considered unresponsive if there is no recent
  2708. * TX/RX activity and downlink frames are buffered for it. Once a STA
  2709. * exceeds the maximum unresponsive time, the AP will send a
  2710. * WMI_STA_KICKOUT event to the host so the STA can be deleted. */
  2711. WMI_VDEV_PARAM_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS,
  2712. /* Enable NAWDS : MCAST INSPECT Enable, NAWDS Flag set */
  2713. WMI_VDEV_PARAM_AP_ENABLE_NAWDS,
  2714. /* Enable/Disable RTS-CTS */
  2715. WMI_VDEV_PARAM_ENABLE_RTSCTS,
  2716. /* Enable TXBFee/er */
  2717. WMI_VDEV_PARAM_TXBF,
  2718. /* Set packet power save */
  2719. WMI_VDEV_PARAM_PACKET_POWERSAVE,
  2720. /*
  2721. * Drops un-encrypted packets if eceived in an encrypted connection
  2722. * otherwise forwards to host.
  2723. */
  2724. WMI_VDEV_PARAM_DROP_UNENCRY,
  2725. /*
  2726. * Set the encapsulation type for frames.
  2727. */
  2728. WMI_VDEV_PARAM_TX_ENCAP_TYPE,
  2729. };
  2730. /* the definition of different VDEV parameters */
  2731. enum wmi_10x_vdev_param {
  2732. /* RTS Threshold */
  2733. WMI_10X_VDEV_PARAM_RTS_THRESHOLD = 0x1,
  2734. /* Fragmentation threshold */
  2735. WMI_10X_VDEV_PARAM_FRAGMENTATION_THRESHOLD,
  2736. /* beacon interval in TUs */
  2737. WMI_10X_VDEV_PARAM_BEACON_INTERVAL,
  2738. /* Listen interval in TUs */
  2739. WMI_10X_VDEV_PARAM_LISTEN_INTERVAL,
  2740. /* muticast rate in Mbps */
  2741. WMI_10X_VDEV_PARAM_MULTICAST_RATE,
  2742. /* management frame rate in Mbps */
  2743. WMI_10X_VDEV_PARAM_MGMT_TX_RATE,
  2744. /* slot time (long vs short) */
  2745. WMI_10X_VDEV_PARAM_SLOT_TIME,
  2746. /* preamble (long vs short) */
  2747. WMI_10X_VDEV_PARAM_PREAMBLE,
  2748. /* SWBA time (time before tbtt in msec) */
  2749. WMI_10X_VDEV_PARAM_SWBA_TIME,
  2750. /* time period for updating VDEV stats */
  2751. WMI_10X_VDEV_STATS_UPDATE_PERIOD,
  2752. /* age out time in msec for frames queued for station in power save */
  2753. WMI_10X_VDEV_PWRSAVE_AGEOUT_TIME,
  2754. /*
  2755. * Host SWBA interval (time in msec before tbtt for SWBA event
  2756. * generation).
  2757. */
  2758. WMI_10X_VDEV_HOST_SWBA_INTERVAL,
  2759. /* DTIM period (specified in units of num beacon intervals) */
  2760. WMI_10X_VDEV_PARAM_DTIM_PERIOD,
  2761. /*
  2762. * scheduler air time limit for this VDEV. used by off chan
  2763. * scheduler.
  2764. */
  2765. WMI_10X_VDEV_OC_SCHEDULER_AIR_TIME_LIMIT,
  2766. /* enable/dsiable WDS for this VDEV */
  2767. WMI_10X_VDEV_PARAM_WDS,
  2768. /* ATIM Window */
  2769. WMI_10X_VDEV_PARAM_ATIM_WINDOW,
  2770. /* BMISS max */
  2771. WMI_10X_VDEV_PARAM_BMISS_COUNT_MAX,
  2772. /* WMM enables/disabled */
  2773. WMI_10X_VDEV_PARAM_FEATURE_WMM,
  2774. /* Channel width */
  2775. WMI_10X_VDEV_PARAM_CHWIDTH,
  2776. /* Channel Offset */
  2777. WMI_10X_VDEV_PARAM_CHEXTOFFSET,
  2778. /* Disable HT Protection */
  2779. WMI_10X_VDEV_PARAM_DISABLE_HTPROTECTION,
  2780. /* Quick STA Kickout */
  2781. WMI_10X_VDEV_PARAM_STA_QUICKKICKOUT,
  2782. /* Rate to be used with Management frames */
  2783. WMI_10X_VDEV_PARAM_MGMT_RATE,
  2784. /* Protection Mode */
  2785. WMI_10X_VDEV_PARAM_PROTECTION_MODE,
  2786. /* Fixed rate setting */
  2787. WMI_10X_VDEV_PARAM_FIXED_RATE,
  2788. /* Short GI Enable/Disable */
  2789. WMI_10X_VDEV_PARAM_SGI,
  2790. /* Enable LDPC */
  2791. WMI_10X_VDEV_PARAM_LDPC,
  2792. /* Enable Tx STBC */
  2793. WMI_10X_VDEV_PARAM_TX_STBC,
  2794. /* Enable Rx STBC */
  2795. WMI_10X_VDEV_PARAM_RX_STBC,
  2796. /* Intra BSS forwarding */
  2797. WMI_10X_VDEV_PARAM_INTRA_BSS_FWD,
  2798. /* Setting Default xmit key for Vdev */
  2799. WMI_10X_VDEV_PARAM_DEF_KEYID,
  2800. /* NSS width */
  2801. WMI_10X_VDEV_PARAM_NSS,
  2802. /* Set the custom rate for the broadcast data frames */
  2803. WMI_10X_VDEV_PARAM_BCAST_DATA_RATE,
  2804. /* Set the custom rate (rate-code) for multicast data frames */
  2805. WMI_10X_VDEV_PARAM_MCAST_DATA_RATE,
  2806. /* Tx multicast packet indicate Enable/Disable */
  2807. WMI_10X_VDEV_PARAM_MCAST_INDICATE,
  2808. /* Tx DHCP packet indicate Enable/Disable */
  2809. WMI_10X_VDEV_PARAM_DHCP_INDICATE,
  2810. /* Enable host inspection of Tx unicast packet to unknown destination */
  2811. WMI_10X_VDEV_PARAM_UNKNOWN_DEST_INDICATE,
  2812. /* The minimum amount of time AP begins to consider STA inactive */
  2813. WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MIN_IDLE_INACTIVE_TIME_SECS,
  2814. /*
  2815. * An associated STA is considered inactive when there is no recent
  2816. * TX/RX activity and no downlink frames are buffered for it. Once a
  2817. * STA exceeds the maximum idle inactive time, the AP will send an
  2818. * 802.11 data-null as a keep alive to verify the STA is still
  2819. * associated. If the STA does ACK the data-null, or if the data-null
  2820. * is buffered and the STA does not retrieve it, the STA will be
  2821. * considered unresponsive
  2822. * (see WMI_10X_VDEV_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS).
  2823. */
  2824. WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MAX_IDLE_INACTIVE_TIME_SECS,
  2825. /*
  2826. * An associated STA is considered unresponsive if there is no recent
  2827. * TX/RX activity and downlink frames are buffered for it. Once a STA
  2828. * exceeds the maximum unresponsive time, the AP will send a
  2829. * WMI_10X_STA_KICKOUT event to the host so the STA can be deleted. */
  2830. WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS,
  2831. /* Enable NAWDS : MCAST INSPECT Enable, NAWDS Flag set */
  2832. WMI_10X_VDEV_PARAM_AP_ENABLE_NAWDS,
  2833. WMI_10X_VDEV_PARAM_MCAST2UCAST_SET,
  2834. /* Enable/Disable RTS-CTS */
  2835. WMI_10X_VDEV_PARAM_ENABLE_RTSCTS,
  2836. WMI_10X_VDEV_PARAM_AP_DETECT_OUT_OF_SYNC_SLEEPING_STA_TIME_SECS,
  2837. };
  2838. /* slot time long */
  2839. #define WMI_VDEV_SLOT_TIME_LONG 0x1
  2840. /* slot time short */
  2841. #define WMI_VDEV_SLOT_TIME_SHORT 0x2
  2842. /* preablbe long */
  2843. #define WMI_VDEV_PREAMBLE_LONG 0x1
  2844. /* preablbe short */
  2845. #define WMI_VDEV_PREAMBLE_SHORT 0x2
  2846. enum wmi_start_event_param {
  2847. WMI_VDEV_RESP_START_EVENT = 0,
  2848. WMI_VDEV_RESP_RESTART_EVENT,
  2849. };
  2850. struct wmi_vdev_start_response_event {
  2851. __le32 vdev_id;
  2852. __le32 req_id;
  2853. __le32 resp_type; /* %WMI_VDEV_RESP_ */
  2854. __le32 status;
  2855. } __packed;
  2856. struct wmi_vdev_standby_req_event {
  2857. /* unique id identifying the VDEV, generated by the caller */
  2858. __le32 vdev_id;
  2859. } __packed;
  2860. struct wmi_vdev_resume_req_event {
  2861. /* unique id identifying the VDEV, generated by the caller */
  2862. __le32 vdev_id;
  2863. } __packed;
  2864. struct wmi_vdev_stopped_event {
  2865. /* unique id identifying the VDEV, generated by the caller */
  2866. __le32 vdev_id;
  2867. } __packed;
  2868. /*
  2869. * common structure used for simple events
  2870. * (stopped, resume_req, standby response)
  2871. */
  2872. struct wmi_vdev_simple_event {
  2873. /* unique id identifying the VDEV, generated by the caller */
  2874. __le32 vdev_id;
  2875. } __packed;
  2876. /* VDEV start response status codes */
  2877. /* VDEV succesfully started */
  2878. #define WMI_INIFIED_VDEV_START_RESPONSE_STATUS_SUCCESS 0x0
  2879. /* requested VDEV not found */
  2880. #define WMI_INIFIED_VDEV_START_RESPONSE_INVALID_VDEVID 0x1
  2881. /* unsupported VDEV combination */
  2882. #define WMI_INIFIED_VDEV_START_RESPONSE_NOT_SUPPORTED 0x2
  2883. /* Beacon processing related command and event structures */
  2884. struct wmi_bcn_tx_hdr {
  2885. __le32 vdev_id;
  2886. __le32 tx_rate;
  2887. __le32 tx_power;
  2888. __le32 bcn_len;
  2889. } __packed;
  2890. struct wmi_bcn_tx_cmd {
  2891. struct wmi_bcn_tx_hdr hdr;
  2892. u8 *bcn[0];
  2893. } __packed;
  2894. struct wmi_bcn_tx_arg {
  2895. u32 vdev_id;
  2896. u32 tx_rate;
  2897. u32 tx_power;
  2898. u32 bcn_len;
  2899. const void *bcn;
  2900. };
  2901. /* Beacon filter */
  2902. #define WMI_BCN_FILTER_ALL 0 /* Filter all beacons */
  2903. #define WMI_BCN_FILTER_NONE 1 /* Pass all beacons */
  2904. #define WMI_BCN_FILTER_RSSI 2 /* Pass Beacons RSSI >= RSSI threshold */
  2905. #define WMI_BCN_FILTER_BSSID 3 /* Pass Beacons with matching BSSID */
  2906. #define WMI_BCN_FILTER_SSID 4 /* Pass Beacons with matching SSID */
  2907. struct wmi_bcn_filter_rx_cmd {
  2908. /* Filter ID */
  2909. __le32 bcn_filter_id;
  2910. /* Filter type - wmi_bcn_filter */
  2911. __le32 bcn_filter;
  2912. /* Buffer len */
  2913. __le32 bcn_filter_len;
  2914. /* Filter info (threshold, BSSID, RSSI) */
  2915. u8 *bcn_filter_buf;
  2916. } __packed;
  2917. /* Capabilities and IEs to be passed to firmware */
  2918. struct wmi_bcn_prb_info {
  2919. /* Capabilities */
  2920. __le32 caps;
  2921. /* ERP info */
  2922. __le32 erp;
  2923. /* Advanced capabilities */
  2924. /* HT capabilities */
  2925. /* HT Info */
  2926. /* ibss_dfs */
  2927. /* wpa Info */
  2928. /* rsn Info */
  2929. /* rrm info */
  2930. /* ath_ext */
  2931. /* app IE */
  2932. } __packed;
  2933. struct wmi_bcn_tmpl_cmd {
  2934. /* unique id identifying the VDEV, generated by the caller */
  2935. __le32 vdev_id;
  2936. /* TIM IE offset from the beginning of the template. */
  2937. __le32 tim_ie_offset;
  2938. /* beacon probe capabilities and IEs */
  2939. struct wmi_bcn_prb_info bcn_prb_info;
  2940. /* beacon buffer length */
  2941. __le32 buf_len;
  2942. /* variable length data */
  2943. u8 data[1];
  2944. } __packed;
  2945. struct wmi_prb_tmpl_cmd {
  2946. /* unique id identifying the VDEV, generated by the caller */
  2947. __le32 vdev_id;
  2948. /* beacon probe capabilities and IEs */
  2949. struct wmi_bcn_prb_info bcn_prb_info;
  2950. /* beacon buffer length */
  2951. __le32 buf_len;
  2952. /* Variable length data */
  2953. u8 data[1];
  2954. } __packed;
  2955. enum wmi_sta_ps_mode {
  2956. /* enable power save for the given STA VDEV */
  2957. WMI_STA_PS_MODE_DISABLED = 0,
  2958. /* disable power save for a given STA VDEV */
  2959. WMI_STA_PS_MODE_ENABLED = 1,
  2960. };
  2961. struct wmi_sta_powersave_mode_cmd {
  2962. /* unique id identifying the VDEV, generated by the caller */
  2963. __le32 vdev_id;
  2964. /*
  2965. * Power save mode
  2966. * (see enum wmi_sta_ps_mode)
  2967. */
  2968. __le32 sta_ps_mode;
  2969. } __packed;
  2970. enum wmi_csa_offload_en {
  2971. WMI_CSA_OFFLOAD_DISABLE = 0,
  2972. WMI_CSA_OFFLOAD_ENABLE = 1,
  2973. };
  2974. struct wmi_csa_offload_enable_cmd {
  2975. __le32 vdev_id;
  2976. __le32 csa_offload_enable;
  2977. } __packed;
  2978. struct wmi_csa_offload_chanswitch_cmd {
  2979. __le32 vdev_id;
  2980. struct wmi_channel chan;
  2981. } __packed;
  2982. /*
  2983. * This parameter controls the policy for retrieving frames from AP while the
  2984. * STA is in sleep state.
  2985. *
  2986. * Only takes affect if the sta_ps_mode is enabled
  2987. */
  2988. enum wmi_sta_ps_param_rx_wake_policy {
  2989. /*
  2990. * Wake up when ever there is an RX activity on the VDEV. In this mode
  2991. * the Power save SM(state machine) will come out of sleep by either
  2992. * sending null frame (or) a data frame (with PS==0) in response to TIM
  2993. * bit set in the received beacon frame from AP.
  2994. */
  2995. WMI_STA_PS_RX_WAKE_POLICY_WAKE = 0,
  2996. /*
  2997. * Here the power save state machine will not wakeup in response to TIM
  2998. * bit, instead it will send a PSPOLL (or) UASPD trigger based on UAPSD
  2999. * configuration setup by WMISET_PS_SET_UAPSD WMI command. When all
  3000. * access categories are delivery-enabled, the station will send a
  3001. * UAPSD trigger frame, otherwise it will send a PS-Poll.
  3002. */
  3003. WMI_STA_PS_RX_WAKE_POLICY_POLL_UAPSD = 1,
  3004. };
  3005. /*
  3006. * Number of tx frames/beacon that cause the power save SM to wake up.
  3007. *
  3008. * Value 1 causes the SM to wake up for every TX. Value 0 has a special
  3009. * meaning, It will cause the SM to never wake up. This is useful if you want
  3010. * to keep the system to sleep all the time for some kind of test mode . host
  3011. * can change this parameter any time. It will affect at the next tx frame.
  3012. */
  3013. enum wmi_sta_ps_param_tx_wake_threshold {
  3014. WMI_STA_PS_TX_WAKE_THRESHOLD_NEVER = 0,
  3015. WMI_STA_PS_TX_WAKE_THRESHOLD_ALWAYS = 1,
  3016. /*
  3017. * Values greater than one indicate that many TX attempts per beacon
  3018. * interval before the STA will wake up
  3019. */
  3020. };
  3021. /*
  3022. * The maximum number of PS-Poll frames the FW will send in response to
  3023. * traffic advertised in TIM before waking up (by sending a null frame with PS
  3024. * = 0). Value 0 has a special meaning: there is no maximum count and the FW
  3025. * will send as many PS-Poll as are necessary to retrieve buffered BU. This
  3026. * parameter is used when the RX wake policy is
  3027. * WMI_STA_PS_RX_WAKE_POLICY_POLL_UAPSD and ignored when the RX wake
  3028. * policy is WMI_STA_PS_RX_WAKE_POLICY_WAKE.
  3029. */
  3030. enum wmi_sta_ps_param_pspoll_count {
  3031. WMI_STA_PS_PSPOLL_COUNT_NO_MAX = 0,
  3032. /*
  3033. * Values greater than 0 indicate the maximum numer of PS-Poll frames
  3034. * FW will send before waking up.
  3035. */
  3036. };
  3037. /*
  3038. * This will include the delivery and trigger enabled state for every AC.
  3039. * This is the negotiated state with AP. The host MLME needs to set this based
  3040. * on AP capability and the state Set in the association request by the
  3041. * station MLME.Lower 8 bits of the value specify the UAPSD configuration.
  3042. */
  3043. #define WMI_UAPSD_AC_TYPE_DELI 0
  3044. #define WMI_UAPSD_AC_TYPE_TRIG 1
  3045. #define WMI_UAPSD_AC_BIT_MASK(ac, type) \
  3046. ((type == WMI_UAPSD_AC_TYPE_DELI) ? (1<<(ac<<1)) : (1<<((ac<<1)+1)))
  3047. enum wmi_sta_ps_param_uapsd {
  3048. WMI_STA_PS_UAPSD_AC0_DELIVERY_EN = (1 << 0),
  3049. WMI_STA_PS_UAPSD_AC0_TRIGGER_EN = (1 << 1),
  3050. WMI_STA_PS_UAPSD_AC1_DELIVERY_EN = (1 << 2),
  3051. WMI_STA_PS_UAPSD_AC1_TRIGGER_EN = (1 << 3),
  3052. WMI_STA_PS_UAPSD_AC2_DELIVERY_EN = (1 << 4),
  3053. WMI_STA_PS_UAPSD_AC2_TRIGGER_EN = (1 << 5),
  3054. WMI_STA_PS_UAPSD_AC3_DELIVERY_EN = (1 << 6),
  3055. WMI_STA_PS_UAPSD_AC3_TRIGGER_EN = (1 << 7),
  3056. };
  3057. enum wmi_sta_powersave_param {
  3058. /*
  3059. * Controls how frames are retrievd from AP while STA is sleeping
  3060. *
  3061. * (see enum wmi_sta_ps_param_rx_wake_policy)
  3062. */
  3063. WMI_STA_PS_PARAM_RX_WAKE_POLICY = 0,
  3064. /*
  3065. * The STA will go active after this many TX
  3066. *
  3067. * (see enum wmi_sta_ps_param_tx_wake_threshold)
  3068. */
  3069. WMI_STA_PS_PARAM_TX_WAKE_THRESHOLD = 1,
  3070. /*
  3071. * Number of PS-Poll to send before STA wakes up
  3072. *
  3073. * (see enum wmi_sta_ps_param_pspoll_count)
  3074. *
  3075. */
  3076. WMI_STA_PS_PARAM_PSPOLL_COUNT = 2,
  3077. /*
  3078. * TX/RX inactivity time in msec before going to sleep.
  3079. *
  3080. * The power save SM will monitor tx/rx activity on the VDEV, if no
  3081. * activity for the specified msec of the parameter the Power save
  3082. * SM will go to sleep.
  3083. */
  3084. WMI_STA_PS_PARAM_INACTIVITY_TIME = 3,
  3085. /*
  3086. * Set uapsd configuration.
  3087. *
  3088. * (see enum wmi_sta_ps_param_uapsd)
  3089. */
  3090. WMI_STA_PS_PARAM_UAPSD = 4,
  3091. };
  3092. struct wmi_sta_powersave_param_cmd {
  3093. __le32 vdev_id;
  3094. __le32 param_id; /* %WMI_STA_PS_PARAM_ */
  3095. __le32 param_value;
  3096. } __packed;
  3097. /* No MIMO power save */
  3098. #define WMI_STA_MIMO_PS_MODE_DISABLE
  3099. /* mimo powersave mode static*/
  3100. #define WMI_STA_MIMO_PS_MODE_STATIC
  3101. /* mimo powersave mode dynamic */
  3102. #define WMI_STA_MIMO_PS_MODE_DYNAMIC
  3103. struct wmi_sta_mimo_ps_mode_cmd {
  3104. /* unique id identifying the VDEV, generated by the caller */
  3105. __le32 vdev_id;
  3106. /* mimo powersave mode as defined above */
  3107. __le32 mimo_pwrsave_mode;
  3108. } __packed;
  3109. /* U-APSD configuration of peer station from (re)assoc request and TSPECs */
  3110. enum wmi_ap_ps_param_uapsd {
  3111. WMI_AP_PS_UAPSD_AC0_DELIVERY_EN = (1 << 0),
  3112. WMI_AP_PS_UAPSD_AC0_TRIGGER_EN = (1 << 1),
  3113. WMI_AP_PS_UAPSD_AC1_DELIVERY_EN = (1 << 2),
  3114. WMI_AP_PS_UAPSD_AC1_TRIGGER_EN = (1 << 3),
  3115. WMI_AP_PS_UAPSD_AC2_DELIVERY_EN = (1 << 4),
  3116. WMI_AP_PS_UAPSD_AC2_TRIGGER_EN = (1 << 5),
  3117. WMI_AP_PS_UAPSD_AC3_DELIVERY_EN = (1 << 6),
  3118. WMI_AP_PS_UAPSD_AC3_TRIGGER_EN = (1 << 7),
  3119. };
  3120. /* U-APSD maximum service period of peer station */
  3121. enum wmi_ap_ps_peer_param_max_sp {
  3122. WMI_AP_PS_PEER_PARAM_MAX_SP_UNLIMITED = 0,
  3123. WMI_AP_PS_PEER_PARAM_MAX_SP_2 = 1,
  3124. WMI_AP_PS_PEER_PARAM_MAX_SP_4 = 2,
  3125. WMI_AP_PS_PEER_PARAM_MAX_SP_6 = 3,
  3126. MAX_WMI_AP_PS_PEER_PARAM_MAX_SP,
  3127. };
  3128. /*
  3129. * AP power save parameter
  3130. * Set a power save specific parameter for a peer station
  3131. */
  3132. enum wmi_ap_ps_peer_param {
  3133. /* Set uapsd configuration for a given peer.
  3134. *
  3135. * Include the delivery and trigger enabled state for every AC.
  3136. * The host MLME needs to set this based on AP capability and stations
  3137. * request Set in the association request received from the station.
  3138. *
  3139. * Lower 8 bits of the value specify the UAPSD configuration.
  3140. *
  3141. * (see enum wmi_ap_ps_param_uapsd)
  3142. * The default value is 0.
  3143. */
  3144. WMI_AP_PS_PEER_PARAM_UAPSD = 0,
  3145. /*
  3146. * Set the service period for a UAPSD capable station
  3147. *
  3148. * The service period from wme ie in the (re)assoc request frame.
  3149. *
  3150. * (see enum wmi_ap_ps_peer_param_max_sp)
  3151. */
  3152. WMI_AP_PS_PEER_PARAM_MAX_SP = 1,
  3153. /* Time in seconds for aging out buffered frames for STA in PS */
  3154. WMI_AP_PS_PEER_PARAM_AGEOUT_TIME = 2,
  3155. };
  3156. struct wmi_ap_ps_peer_cmd {
  3157. /* unique id identifying the VDEV, generated by the caller */
  3158. __le32 vdev_id;
  3159. /* peer MAC address */
  3160. struct wmi_mac_addr peer_macaddr;
  3161. /* AP powersave param (see enum wmi_ap_ps_peer_param) */
  3162. __le32 param_id;
  3163. /* AP powersave param value */
  3164. __le32 param_value;
  3165. } __packed;
  3166. /* 128 clients = 4 words */
  3167. #define WMI_TIM_BITMAP_ARRAY_SIZE 4
  3168. struct wmi_tim_info {
  3169. __le32 tim_len;
  3170. __le32 tim_mcast;
  3171. __le32 tim_bitmap[WMI_TIM_BITMAP_ARRAY_SIZE];
  3172. __le32 tim_changed;
  3173. __le32 tim_num_ps_pending;
  3174. } __packed;
  3175. /* Maximum number of NOA Descriptors supported */
  3176. #define WMI_P2P_MAX_NOA_DESCRIPTORS 4
  3177. #define WMI_P2P_OPPPS_ENABLE_BIT BIT(0)
  3178. #define WMI_P2P_OPPPS_CTWINDOW_OFFSET 1
  3179. #define WMI_P2P_NOA_CHANGED_BIT BIT(0)
  3180. struct wmi_p2p_noa_info {
  3181. /* Bit 0 - Flag to indicate an update in NOA schedule
  3182. Bits 7-1 - Reserved */
  3183. u8 changed;
  3184. /* NOA index */
  3185. u8 index;
  3186. /* Bit 0 - Opp PS state of the AP
  3187. Bits 1-7 - Ctwindow in TUs */
  3188. u8 ctwindow_oppps;
  3189. /* Number of NOA descriptors */
  3190. u8 num_descriptors;
  3191. struct wmi_p2p_noa_descriptor descriptors[WMI_P2P_MAX_NOA_DESCRIPTORS];
  3192. } __packed;
  3193. struct wmi_bcn_info {
  3194. struct wmi_tim_info tim_info;
  3195. struct wmi_p2p_noa_info p2p_noa_info;
  3196. } __packed;
  3197. struct wmi_host_swba_event {
  3198. __le32 vdev_map;
  3199. struct wmi_bcn_info bcn_info[1];
  3200. } __packed;
  3201. #define WMI_MAX_AP_VDEV 16
  3202. struct wmi_tbtt_offset_event {
  3203. __le32 vdev_map;
  3204. __le32 tbttoffset_list[WMI_MAX_AP_VDEV];
  3205. } __packed;
  3206. struct wmi_peer_create_cmd {
  3207. __le32 vdev_id;
  3208. struct wmi_mac_addr peer_macaddr;
  3209. } __packed;
  3210. struct wmi_peer_delete_cmd {
  3211. __le32 vdev_id;
  3212. struct wmi_mac_addr peer_macaddr;
  3213. } __packed;
  3214. struct wmi_peer_flush_tids_cmd {
  3215. __le32 vdev_id;
  3216. struct wmi_mac_addr peer_macaddr;
  3217. __le32 peer_tid_bitmap;
  3218. } __packed;
  3219. struct wmi_fixed_rate {
  3220. /*
  3221. * rate mode . 0: disable fixed rate (auto rate)
  3222. * 1: legacy (non 11n) rate specified as ieee rate 2*Mbps
  3223. * 2: ht20 11n rate specified as mcs index
  3224. * 3: ht40 11n rate specified as mcs index
  3225. */
  3226. __le32 rate_mode;
  3227. /*
  3228. * 4 rate values for 4 rate series. series 0 is stored in byte 0 (LSB)
  3229. * and series 3 is stored at byte 3 (MSB)
  3230. */
  3231. __le32 rate_series;
  3232. /*
  3233. * 4 retry counts for 4 rate series. retry count for rate 0 is stored
  3234. * in byte 0 (LSB) and retry count for rate 3 is stored at byte 3
  3235. * (MSB)
  3236. */
  3237. __le32 rate_retries;
  3238. } __packed;
  3239. struct wmi_peer_fixed_rate_cmd {
  3240. /* unique id identifying the VDEV, generated by the caller */
  3241. __le32 vdev_id;
  3242. /* peer MAC address */
  3243. struct wmi_mac_addr peer_macaddr;
  3244. /* fixed rate */
  3245. struct wmi_fixed_rate peer_fixed_rate;
  3246. } __packed;
  3247. #define WMI_MGMT_TID 17
  3248. struct wmi_addba_clear_resp_cmd {
  3249. /* unique id identifying the VDEV, generated by the caller */
  3250. __le32 vdev_id;
  3251. /* peer MAC address */
  3252. struct wmi_mac_addr peer_macaddr;
  3253. } __packed;
  3254. struct wmi_addba_send_cmd {
  3255. /* unique id identifying the VDEV, generated by the caller */
  3256. __le32 vdev_id;
  3257. /* peer MAC address */
  3258. struct wmi_mac_addr peer_macaddr;
  3259. /* Tid number */
  3260. __le32 tid;
  3261. /* Buffer/Window size*/
  3262. __le32 buffersize;
  3263. } __packed;
  3264. struct wmi_delba_send_cmd {
  3265. /* unique id identifying the VDEV, generated by the caller */
  3266. __le32 vdev_id;
  3267. /* peer MAC address */
  3268. struct wmi_mac_addr peer_macaddr;
  3269. /* Tid number */
  3270. __le32 tid;
  3271. /* Is Initiator */
  3272. __le32 initiator;
  3273. /* Reason code */
  3274. __le32 reasoncode;
  3275. } __packed;
  3276. struct wmi_addba_setresponse_cmd {
  3277. /* unique id identifying the vdev, generated by the caller */
  3278. __le32 vdev_id;
  3279. /* peer mac address */
  3280. struct wmi_mac_addr peer_macaddr;
  3281. /* Tid number */
  3282. __le32 tid;
  3283. /* status code */
  3284. __le32 statuscode;
  3285. } __packed;
  3286. struct wmi_send_singleamsdu_cmd {
  3287. /* unique id identifying the vdev, generated by the caller */
  3288. __le32 vdev_id;
  3289. /* peer mac address */
  3290. struct wmi_mac_addr peer_macaddr;
  3291. /* Tid number */
  3292. __le32 tid;
  3293. } __packed;
  3294. enum wmi_peer_smps_state {
  3295. WMI_PEER_SMPS_PS_NONE = 0x0,
  3296. WMI_PEER_SMPS_STATIC = 0x1,
  3297. WMI_PEER_SMPS_DYNAMIC = 0x2
  3298. };
  3299. enum wmi_peer_param {
  3300. WMI_PEER_SMPS_STATE = 0x1, /* see %wmi_peer_smps_state */
  3301. WMI_PEER_AMPDU = 0x2,
  3302. WMI_PEER_AUTHORIZE = 0x3,
  3303. WMI_PEER_CHAN_WIDTH = 0x4,
  3304. WMI_PEER_NSS = 0x5,
  3305. WMI_PEER_USE_4ADDR = 0x6
  3306. };
  3307. struct wmi_peer_set_param_cmd {
  3308. __le32 vdev_id;
  3309. struct wmi_mac_addr peer_macaddr;
  3310. __le32 param_id;
  3311. __le32 param_value;
  3312. } __packed;
  3313. #define MAX_SUPPORTED_RATES 128
  3314. struct wmi_rate_set {
  3315. /* total number of rates */
  3316. __le32 num_rates;
  3317. /*
  3318. * rates (each 8bit value) packed into a 32 bit word.
  3319. * the rates are filled from least significant byte to most
  3320. * significant byte.
  3321. */
  3322. __le32 rates[(MAX_SUPPORTED_RATES/4)+1];
  3323. } __packed;
  3324. struct wmi_rate_set_arg {
  3325. unsigned int num_rates;
  3326. u8 rates[MAX_SUPPORTED_RATES];
  3327. };
  3328. /*
  3329. * NOTE: It would bea good idea to represent the Tx MCS
  3330. * info in one word and Rx in another word. This is split
  3331. * into multiple words for convenience
  3332. */
  3333. struct wmi_vht_rate_set {
  3334. __le32 rx_max_rate; /* Max Rx data rate */
  3335. __le32 rx_mcs_set; /* Negotiated RX VHT rates */
  3336. __le32 tx_max_rate; /* Max Tx data rate */
  3337. __le32 tx_mcs_set; /* Negotiated TX VHT rates */
  3338. } __packed;
  3339. struct wmi_vht_rate_set_arg {
  3340. u32 rx_max_rate;
  3341. u32 rx_mcs_set;
  3342. u32 tx_max_rate;
  3343. u32 tx_mcs_set;
  3344. };
  3345. struct wmi_peer_set_rates_cmd {
  3346. /* peer MAC address */
  3347. struct wmi_mac_addr peer_macaddr;
  3348. /* legacy rate set */
  3349. struct wmi_rate_set peer_legacy_rates;
  3350. /* ht rate set */
  3351. struct wmi_rate_set peer_ht_rates;
  3352. } __packed;
  3353. struct wmi_peer_set_q_empty_callback_cmd {
  3354. /* unique id identifying the VDEV, generated by the caller */
  3355. __le32 vdev_id;
  3356. /* peer MAC address */
  3357. struct wmi_mac_addr peer_macaddr;
  3358. __le32 callback_enable;
  3359. } __packed;
  3360. #define WMI_PEER_AUTH 0x00000001
  3361. #define WMI_PEER_QOS 0x00000002
  3362. #define WMI_PEER_NEED_PTK_4_WAY 0x00000004
  3363. #define WMI_PEER_NEED_GTK_2_WAY 0x00000010
  3364. #define WMI_PEER_APSD 0x00000800
  3365. #define WMI_PEER_HT 0x00001000
  3366. #define WMI_PEER_40MHZ 0x00002000
  3367. #define WMI_PEER_STBC 0x00008000
  3368. #define WMI_PEER_LDPC 0x00010000
  3369. #define WMI_PEER_DYN_MIMOPS 0x00020000
  3370. #define WMI_PEER_STATIC_MIMOPS 0x00040000
  3371. #define WMI_PEER_SPATIAL_MUX 0x00200000
  3372. #define WMI_PEER_VHT 0x02000000
  3373. #define WMI_PEER_80MHZ 0x04000000
  3374. #define WMI_PEER_PMF 0x08000000
  3375. /*
  3376. * Peer rate capabilities.
  3377. *
  3378. * This is of interest to the ratecontrol
  3379. * module which resides in the firmware. The bit definitions are
  3380. * consistent with that defined in if_athrate.c.
  3381. */
  3382. #define WMI_RC_DS_FLAG 0x01
  3383. #define WMI_RC_CW40_FLAG 0x02
  3384. #define WMI_RC_SGI_FLAG 0x04
  3385. #define WMI_RC_HT_FLAG 0x08
  3386. #define WMI_RC_RTSCTS_FLAG 0x10
  3387. #define WMI_RC_TX_STBC_FLAG 0x20
  3388. #define WMI_RC_RX_STBC_FLAG 0xC0
  3389. #define WMI_RC_RX_STBC_FLAG_S 6
  3390. #define WMI_RC_WEP_TKIP_FLAG 0x100
  3391. #define WMI_RC_TS_FLAG 0x200
  3392. #define WMI_RC_UAPSD_FLAG 0x400
  3393. /* Maximum listen interval supported by hw in units of beacon interval */
  3394. #define ATH10K_MAX_HW_LISTEN_INTERVAL 5
  3395. struct wmi_peer_assoc_complete_cmd {
  3396. struct wmi_mac_addr peer_macaddr;
  3397. __le32 vdev_id;
  3398. __le32 peer_new_assoc; /* 1=assoc, 0=reassoc */
  3399. __le32 peer_associd; /* 16 LSBs */
  3400. __le32 peer_flags;
  3401. __le32 peer_caps; /* 16 LSBs */
  3402. __le32 peer_listen_intval;
  3403. __le32 peer_ht_caps;
  3404. __le32 peer_max_mpdu;
  3405. __le32 peer_mpdu_density; /* 0..16 */
  3406. __le32 peer_rate_caps;
  3407. struct wmi_rate_set peer_legacy_rates;
  3408. struct wmi_rate_set peer_ht_rates;
  3409. __le32 peer_nss; /* num of spatial streams */
  3410. __le32 peer_vht_caps;
  3411. __le32 peer_phymode;
  3412. struct wmi_vht_rate_set peer_vht_rates;
  3413. /* HT Operation Element of the peer. Five bytes packed in 2
  3414. * INT32 array and filled from lsb to msb. */
  3415. __le32 peer_ht_info[2];
  3416. } __packed;
  3417. struct wmi_peer_assoc_complete_arg {
  3418. u8 addr[ETH_ALEN];
  3419. u32 vdev_id;
  3420. bool peer_reassoc;
  3421. u16 peer_aid;
  3422. u32 peer_flags; /* see %WMI_PEER_ */
  3423. u16 peer_caps;
  3424. u32 peer_listen_intval;
  3425. u32 peer_ht_caps;
  3426. u32 peer_max_mpdu;
  3427. u32 peer_mpdu_density; /* 0..16 */
  3428. u32 peer_rate_caps; /* see %WMI_RC_ */
  3429. struct wmi_rate_set_arg peer_legacy_rates;
  3430. struct wmi_rate_set_arg peer_ht_rates;
  3431. u32 peer_num_spatial_streams;
  3432. u32 peer_vht_caps;
  3433. enum wmi_phy_mode peer_phymode;
  3434. struct wmi_vht_rate_set_arg peer_vht_rates;
  3435. };
  3436. struct wmi_peer_add_wds_entry_cmd {
  3437. /* peer MAC address */
  3438. struct wmi_mac_addr peer_macaddr;
  3439. /* wds MAC addr */
  3440. struct wmi_mac_addr wds_macaddr;
  3441. } __packed;
  3442. struct wmi_peer_remove_wds_entry_cmd {
  3443. /* wds MAC addr */
  3444. struct wmi_mac_addr wds_macaddr;
  3445. } __packed;
  3446. struct wmi_peer_q_empty_callback_event {
  3447. /* peer MAC address */
  3448. struct wmi_mac_addr peer_macaddr;
  3449. } __packed;
  3450. /*
  3451. * Channel info WMI event
  3452. */
  3453. struct wmi_chan_info_event {
  3454. __le32 err_code;
  3455. __le32 freq;
  3456. __le32 cmd_flags;
  3457. __le32 noise_floor;
  3458. __le32 rx_clear_count;
  3459. __le32 cycle_count;
  3460. } __packed;
  3461. #define WMI_CHAN_INFO_FLAG_COMPLETE BIT(0)
  3462. /* FIXME: empirically extrapolated */
  3463. #define WMI_CHAN_INFO_MSEC(x) ((x) / 76595)
  3464. /* Beacon filter wmi command info */
  3465. #define BCN_FLT_MAX_SUPPORTED_IES 256
  3466. #define BCN_FLT_MAX_ELEMS_IE_LIST (BCN_FLT_MAX_SUPPORTED_IES / 32)
  3467. struct bss_bcn_stats {
  3468. __le32 vdev_id;
  3469. __le32 bss_bcnsdropped;
  3470. __le32 bss_bcnsdelivered;
  3471. } __packed;
  3472. struct bcn_filter_stats {
  3473. __le32 bcns_dropped;
  3474. __le32 bcns_delivered;
  3475. __le32 activefilters;
  3476. struct bss_bcn_stats bss_stats;
  3477. } __packed;
  3478. struct wmi_add_bcn_filter_cmd {
  3479. u32 vdev_id;
  3480. u32 ie_map[BCN_FLT_MAX_ELEMS_IE_LIST];
  3481. } __packed;
  3482. enum wmi_sta_keepalive_method {
  3483. WMI_STA_KEEPALIVE_METHOD_NULL_FRAME = 1,
  3484. WMI_STA_KEEPALIVE_METHOD_UNSOLICITATED_ARP_RESPONSE = 2,
  3485. };
  3486. /* note: ip4 addresses are in network byte order, i.e. big endian */
  3487. struct wmi_sta_keepalive_arp_resp {
  3488. __be32 src_ip4_addr;
  3489. __be32 dest_ip4_addr;
  3490. struct wmi_mac_addr dest_mac_addr;
  3491. } __packed;
  3492. struct wmi_sta_keepalive_cmd {
  3493. __le32 vdev_id;
  3494. __le32 enabled;
  3495. __le32 method; /* WMI_STA_KEEPALIVE_METHOD_ */
  3496. __le32 interval; /* in seconds */
  3497. struct wmi_sta_keepalive_arp_resp arp_resp;
  3498. } __packed;
  3499. enum wmi_force_fw_hang_type {
  3500. WMI_FORCE_FW_HANG_ASSERT = 1,
  3501. WMI_FORCE_FW_HANG_NO_DETECT,
  3502. WMI_FORCE_FW_HANG_CTRL_EP_FULL,
  3503. WMI_FORCE_FW_HANG_EMPTY_POINT,
  3504. WMI_FORCE_FW_HANG_STACK_OVERFLOW,
  3505. WMI_FORCE_FW_HANG_INFINITE_LOOP,
  3506. };
  3507. #define WMI_FORCE_FW_HANG_RANDOM_TIME 0xFFFFFFFF
  3508. struct wmi_force_fw_hang_cmd {
  3509. __le32 type;
  3510. __le32 delay_ms;
  3511. } __packed;
  3512. #define ATH10K_RTS_MAX 2347
  3513. #define ATH10K_FRAGMT_THRESHOLD_MIN 540
  3514. #define ATH10K_FRAGMT_THRESHOLD_MAX 2346
  3515. #define WMI_MAX_EVENT 0x1000
  3516. /* Maximum number of pending TXed WMI packets */
  3517. #define WMI_SKB_HEADROOM sizeof(struct wmi_cmd_hdr)
  3518. /* By default disable power save for IBSS */
  3519. #define ATH10K_DEFAULT_ATIM 0
  3520. struct ath10k;
  3521. struct ath10k_vif;
  3522. int ath10k_wmi_attach(struct ath10k *ar);
  3523. void ath10k_wmi_detach(struct ath10k *ar);
  3524. int ath10k_wmi_wait_for_service_ready(struct ath10k *ar);
  3525. int ath10k_wmi_wait_for_unified_ready(struct ath10k *ar);
  3526. int ath10k_wmi_connect_htc_service(struct ath10k *ar);
  3527. int ath10k_wmi_pdev_set_channel(struct ath10k *ar,
  3528. const struct wmi_channel_arg *);
  3529. int ath10k_wmi_pdev_suspend_target(struct ath10k *ar);
  3530. int ath10k_wmi_pdev_resume_target(struct ath10k *ar);
  3531. int ath10k_wmi_pdev_set_regdomain(struct ath10k *ar, u16 rd, u16 rd2g,
  3532. u16 rd5g, u16 ctl2g, u16 ctl5g);
  3533. int ath10k_wmi_pdev_set_param(struct ath10k *ar, u32 id, u32 value);
  3534. int ath10k_wmi_cmd_init(struct ath10k *ar);
  3535. int ath10k_wmi_start_scan(struct ath10k *ar, const struct wmi_start_scan_arg *);
  3536. void ath10k_wmi_start_scan_init(struct ath10k *ar, struct wmi_start_scan_arg *);
  3537. int ath10k_wmi_stop_scan(struct ath10k *ar,
  3538. const struct wmi_stop_scan_arg *arg);
  3539. int ath10k_wmi_vdev_create(struct ath10k *ar, u32 vdev_id,
  3540. enum wmi_vdev_type type,
  3541. enum wmi_vdev_subtype subtype,
  3542. const u8 macaddr[ETH_ALEN]);
  3543. int ath10k_wmi_vdev_delete(struct ath10k *ar, u32 vdev_id);
  3544. int ath10k_wmi_vdev_start(struct ath10k *ar,
  3545. const struct wmi_vdev_start_request_arg *);
  3546. int ath10k_wmi_vdev_restart(struct ath10k *ar,
  3547. const struct wmi_vdev_start_request_arg *);
  3548. int ath10k_wmi_vdev_stop(struct ath10k *ar, u32 vdev_id);
  3549. int ath10k_wmi_vdev_up(struct ath10k *ar, u32 vdev_id, u32 aid,
  3550. const u8 *bssid);
  3551. int ath10k_wmi_vdev_down(struct ath10k *ar, u32 vdev_id);
  3552. int ath10k_wmi_vdev_set_param(struct ath10k *ar, u32 vdev_id,
  3553. u32 param_id, u32 param_value);
  3554. int ath10k_wmi_vdev_install_key(struct ath10k *ar,
  3555. const struct wmi_vdev_install_key_arg *arg);
  3556. int ath10k_wmi_peer_create(struct ath10k *ar, u32 vdev_id,
  3557. const u8 peer_addr[ETH_ALEN]);
  3558. int ath10k_wmi_peer_delete(struct ath10k *ar, u32 vdev_id,
  3559. const u8 peer_addr[ETH_ALEN]);
  3560. int ath10k_wmi_peer_flush(struct ath10k *ar, u32 vdev_id,
  3561. const u8 peer_addr[ETH_ALEN], u32 tid_bitmap);
  3562. int ath10k_wmi_peer_set_param(struct ath10k *ar, u32 vdev_id,
  3563. const u8 *peer_addr,
  3564. enum wmi_peer_param param_id, u32 param_value);
  3565. int ath10k_wmi_peer_assoc(struct ath10k *ar,
  3566. const struct wmi_peer_assoc_complete_arg *arg);
  3567. int ath10k_wmi_set_psmode(struct ath10k *ar, u32 vdev_id,
  3568. enum wmi_sta_ps_mode psmode);
  3569. int ath10k_wmi_set_sta_ps_param(struct ath10k *ar, u32 vdev_id,
  3570. enum wmi_sta_powersave_param param_id,
  3571. u32 value);
  3572. int ath10k_wmi_set_ap_ps_param(struct ath10k *ar, u32 vdev_id, const u8 *mac,
  3573. enum wmi_ap_ps_peer_param param_id, u32 value);
  3574. int ath10k_wmi_scan_chan_list(struct ath10k *ar,
  3575. const struct wmi_scan_chan_list_arg *arg);
  3576. int ath10k_wmi_beacon_send_nowait(struct ath10k *ar,
  3577. const struct wmi_bcn_tx_arg *arg);
  3578. int ath10k_wmi_pdev_set_wmm_params(struct ath10k *ar,
  3579. const struct wmi_pdev_set_wmm_params_arg *arg);
  3580. int ath10k_wmi_request_stats(struct ath10k *ar, enum wmi_stats_id stats_id);
  3581. int ath10k_wmi_force_fw_hang(struct ath10k *ar,
  3582. enum wmi_force_fw_hang_type type, u32 delay_ms);
  3583. int ath10k_wmi_mgmt_tx(struct ath10k *ar, struct sk_buff *skb);
  3584. #endif /* _WMI_H_ */