wmi.h 119 KB

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