wmi.h 120 KB

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