wmi.h 205 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157
  1. /*
  2. * Copyright (c) 2005-2011 Atheros Communications Inc.
  3. * Copyright (c) 2011-2017 Qualcomm Atheros, Inc.
  4. * Copyright (c) 2018, The Linux Foundation. All rights reserved.
  5. *
  6. * Permission to use, copy, modify, and/or distribute this software for any
  7. * purpose with or without fee is hereby granted, provided that the above
  8. * copyright notice and this permission notice appear in all copies.
  9. *
  10. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  11. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  12. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  13. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  14. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  15. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  16. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  17. */
  18. #ifndef _WMI_H_
  19. #define _WMI_H_
  20. #include <linux/types.h>
  21. #include <net/mac80211.h>
  22. /*
  23. * This file specifies the WMI interface for the Unified Software
  24. * Architecture.
  25. *
  26. * It includes definitions of all the commands and events. Commands are
  27. * messages from the host to the target. Events and Replies are messages
  28. * from the target to the host.
  29. *
  30. * Ownership of correctness in regards to WMI commands belongs to the host
  31. * driver and the target is not required to validate parameters for value,
  32. * proper range, or any other checking.
  33. *
  34. * Guidelines for extending this interface are below.
  35. *
  36. * 1. Add new WMI commands ONLY within the specified range - 0x9000 - 0x9fff
  37. *
  38. * 2. Use ONLY u32 type for defining member variables within WMI
  39. * command/event structures. Do not use u8, u16, bool or
  40. * enum types within these structures.
  41. *
  42. * 3. DO NOT define bit fields within structures. Implement bit fields
  43. * using masks if necessary. Do not use the programming language's bit
  44. * field definition.
  45. *
  46. * 4. Define macros for encode/decode of u8, u16 fields within
  47. * the u32 variables. Use these macros for set/get of these fields.
  48. * Try to use this to optimize the structure without bloating it with
  49. * u32 variables for every lower sized field.
  50. *
  51. * 5. Do not use PACK/UNPACK attributes for the structures as each member
  52. * variable is already 4-byte aligned by virtue of being a u32
  53. * type.
  54. *
  55. * 6. Comment each parameter part of the WMI command/event structure by
  56. * using the 2 stars at the beginning of C comment instead of one star to
  57. * enable HTML document generation using Doxygen.
  58. *
  59. */
  60. /* Control Path */
  61. struct wmi_cmd_hdr {
  62. __le32 cmd_id;
  63. } __packed;
  64. #define WMI_CMD_HDR_CMD_ID_MASK 0x00FFFFFF
  65. #define WMI_CMD_HDR_CMD_ID_LSB 0
  66. #define WMI_CMD_HDR_PLT_PRIV_MASK 0xFF000000
  67. #define WMI_CMD_HDR_PLT_PRIV_LSB 24
  68. #define HTC_PROTOCOL_VERSION 0x0002
  69. #define WMI_PROTOCOL_VERSION 0x0002
  70. /*
  71. * There is no signed version of __le32, so for a temporary solution come
  72. * up with our own version. The idea is from fs/ntfs/endian.h.
  73. *
  74. * Use a_ prefix so that it doesn't conflict if we get proper support to
  75. * linux/types.h.
  76. */
  77. typedef __s32 __bitwise a_sle32;
  78. static inline a_sle32 a_cpu_to_sle32(s32 val)
  79. {
  80. return (__force a_sle32)cpu_to_le32(val);
  81. }
  82. static inline s32 a_sle32_to_cpu(a_sle32 val)
  83. {
  84. return le32_to_cpu((__force __le32)val);
  85. }
  86. enum wmi_service {
  87. WMI_SERVICE_BEACON_OFFLOAD = 0,
  88. WMI_SERVICE_SCAN_OFFLOAD,
  89. WMI_SERVICE_ROAM_OFFLOAD,
  90. WMI_SERVICE_BCN_MISS_OFFLOAD,
  91. WMI_SERVICE_STA_PWRSAVE,
  92. WMI_SERVICE_STA_ADVANCED_PWRSAVE,
  93. WMI_SERVICE_AP_UAPSD,
  94. WMI_SERVICE_AP_DFS,
  95. WMI_SERVICE_11AC,
  96. WMI_SERVICE_BLOCKACK,
  97. WMI_SERVICE_PHYERR,
  98. WMI_SERVICE_BCN_FILTER,
  99. WMI_SERVICE_RTT,
  100. WMI_SERVICE_RATECTRL,
  101. WMI_SERVICE_WOW,
  102. WMI_SERVICE_RATECTRL_CACHE,
  103. WMI_SERVICE_IRAM_TIDS,
  104. WMI_SERVICE_ARPNS_OFFLOAD,
  105. WMI_SERVICE_NLO,
  106. WMI_SERVICE_GTK_OFFLOAD,
  107. WMI_SERVICE_SCAN_SCH,
  108. WMI_SERVICE_CSA_OFFLOAD,
  109. WMI_SERVICE_CHATTER,
  110. WMI_SERVICE_COEX_FREQAVOID,
  111. WMI_SERVICE_PACKET_POWER_SAVE,
  112. WMI_SERVICE_FORCE_FW_HANG,
  113. WMI_SERVICE_GPIO,
  114. WMI_SERVICE_STA_DTIM_PS_MODULATED_DTIM,
  115. WMI_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG,
  116. WMI_SERVICE_STA_UAPSD_VAR_AUTO_TRIG,
  117. WMI_SERVICE_STA_KEEP_ALIVE,
  118. WMI_SERVICE_TX_ENCAP,
  119. WMI_SERVICE_BURST,
  120. WMI_SERVICE_SMART_ANTENNA_SW_SUPPORT,
  121. WMI_SERVICE_SMART_ANTENNA_HW_SUPPORT,
  122. WMI_SERVICE_ROAM_SCAN_OFFLOAD,
  123. WMI_SERVICE_AP_PS_DETECT_OUT_OF_SYNC,
  124. WMI_SERVICE_EARLY_RX,
  125. WMI_SERVICE_STA_SMPS,
  126. WMI_SERVICE_FWTEST,
  127. WMI_SERVICE_STA_WMMAC,
  128. WMI_SERVICE_TDLS,
  129. WMI_SERVICE_MCC_BCN_INTERVAL_CHANGE,
  130. WMI_SERVICE_ADAPTIVE_OCS,
  131. WMI_SERVICE_BA_SSN_SUPPORT,
  132. WMI_SERVICE_FILTER_IPSEC_NATKEEPALIVE,
  133. WMI_SERVICE_WLAN_HB,
  134. WMI_SERVICE_LTE_ANT_SHARE_SUPPORT,
  135. WMI_SERVICE_BATCH_SCAN,
  136. WMI_SERVICE_QPOWER,
  137. WMI_SERVICE_PLMREQ,
  138. WMI_SERVICE_THERMAL_MGMT,
  139. WMI_SERVICE_RMC,
  140. WMI_SERVICE_MHF_OFFLOAD,
  141. WMI_SERVICE_COEX_SAR,
  142. WMI_SERVICE_BCN_TXRATE_OVERRIDE,
  143. WMI_SERVICE_NAN,
  144. WMI_SERVICE_L1SS_STAT,
  145. WMI_SERVICE_ESTIMATE_LINKSPEED,
  146. WMI_SERVICE_OBSS_SCAN,
  147. WMI_SERVICE_TDLS_OFFCHAN,
  148. WMI_SERVICE_TDLS_UAPSD_BUFFER_STA,
  149. WMI_SERVICE_TDLS_UAPSD_SLEEP_STA,
  150. WMI_SERVICE_IBSS_PWRSAVE,
  151. WMI_SERVICE_LPASS,
  152. WMI_SERVICE_EXTSCAN,
  153. WMI_SERVICE_D0WOW,
  154. WMI_SERVICE_HSOFFLOAD,
  155. WMI_SERVICE_ROAM_HO_OFFLOAD,
  156. WMI_SERVICE_RX_FULL_REORDER,
  157. WMI_SERVICE_DHCP_OFFLOAD,
  158. WMI_SERVICE_STA_RX_IPA_OFFLOAD_SUPPORT,
  159. WMI_SERVICE_MDNS_OFFLOAD,
  160. WMI_SERVICE_SAP_AUTH_OFFLOAD,
  161. WMI_SERVICE_ATF,
  162. WMI_SERVICE_COEX_GPIO,
  163. WMI_SERVICE_ENHANCED_PROXY_STA,
  164. WMI_SERVICE_TT,
  165. WMI_SERVICE_PEER_CACHING,
  166. WMI_SERVICE_AUX_SPECTRAL_INTF,
  167. WMI_SERVICE_AUX_CHAN_LOAD_INTF,
  168. WMI_SERVICE_BSS_CHANNEL_INFO_64,
  169. WMI_SERVICE_EXT_RES_CFG_SUPPORT,
  170. WMI_SERVICE_MESH_11S,
  171. WMI_SERVICE_MESH_NON_11S,
  172. WMI_SERVICE_PEER_STATS,
  173. WMI_SERVICE_RESTRT_CHNL_SUPPORT,
  174. WMI_SERVICE_PERIODIC_CHAN_STAT_SUPPORT,
  175. WMI_SERVICE_TX_MODE_PUSH_ONLY,
  176. WMI_SERVICE_TX_MODE_PUSH_PULL,
  177. WMI_SERVICE_TX_MODE_DYNAMIC,
  178. WMI_SERVICE_VDEV_RX_FILTER,
  179. WMI_SERVICE_BTCOEX,
  180. WMI_SERVICE_CHECK_CAL_VERSION,
  181. WMI_SERVICE_DBGLOG_WARN2,
  182. WMI_SERVICE_BTCOEX_DUTY_CYCLE,
  183. WMI_SERVICE_4_WIRE_COEX_SUPPORT,
  184. WMI_SERVICE_EXTENDED_NSS_SUPPORT,
  185. WMI_SERVICE_PROG_GPIO_BAND_SELECT,
  186. WMI_SERVICE_SMART_LOGGING_SUPPORT,
  187. WMI_SERVICE_TDLS_CONN_TRACKER_IN_HOST_MODE,
  188. WMI_SERVICE_TDLS_EXPLICIT_MODE_ONLY,
  189. WMI_SERVICE_MGMT_TX_WMI,
  190. WMI_SERVICE_TDLS_WIDER_BANDWIDTH,
  191. WMI_SERVICE_HTT_MGMT_TX_COMP_VALID_FLAGS,
  192. WMI_SERVICE_HOST_DFS_CHECK_SUPPORT,
  193. WMI_SERVICE_TPC_STATS_FINAL,
  194. WMI_SERVICE_RESET_CHIP,
  195. WMI_SERVICE_SPOOF_MAC_SUPPORT,
  196. /* keep last */
  197. WMI_SERVICE_MAX,
  198. };
  199. enum wmi_10x_service {
  200. WMI_10X_SERVICE_BEACON_OFFLOAD = 0,
  201. WMI_10X_SERVICE_SCAN_OFFLOAD,
  202. WMI_10X_SERVICE_ROAM_OFFLOAD,
  203. WMI_10X_SERVICE_BCN_MISS_OFFLOAD,
  204. WMI_10X_SERVICE_STA_PWRSAVE,
  205. WMI_10X_SERVICE_STA_ADVANCED_PWRSAVE,
  206. WMI_10X_SERVICE_AP_UAPSD,
  207. WMI_10X_SERVICE_AP_DFS,
  208. WMI_10X_SERVICE_11AC,
  209. WMI_10X_SERVICE_BLOCKACK,
  210. WMI_10X_SERVICE_PHYERR,
  211. WMI_10X_SERVICE_BCN_FILTER,
  212. WMI_10X_SERVICE_RTT,
  213. WMI_10X_SERVICE_RATECTRL,
  214. WMI_10X_SERVICE_WOW,
  215. WMI_10X_SERVICE_RATECTRL_CACHE,
  216. WMI_10X_SERVICE_IRAM_TIDS,
  217. WMI_10X_SERVICE_BURST,
  218. /* introduced in 10.2 */
  219. WMI_10X_SERVICE_SMART_ANTENNA_SW_SUPPORT,
  220. WMI_10X_SERVICE_FORCE_FW_HANG,
  221. WMI_10X_SERVICE_SMART_ANTENNA_HW_SUPPORT,
  222. WMI_10X_SERVICE_ATF,
  223. WMI_10X_SERVICE_COEX_GPIO,
  224. WMI_10X_SERVICE_AUX_SPECTRAL_INTF,
  225. WMI_10X_SERVICE_AUX_CHAN_LOAD_INTF,
  226. WMI_10X_SERVICE_BSS_CHANNEL_INFO_64,
  227. WMI_10X_SERVICE_MESH,
  228. WMI_10X_SERVICE_EXT_RES_CFG_SUPPORT,
  229. WMI_10X_SERVICE_PEER_STATS,
  230. WMI_10X_SERVICE_RESET_CHIP,
  231. WMI_10X_SERVICE_HTT_MGMT_TX_COMP_VALID_FLAGS,
  232. };
  233. enum wmi_main_service {
  234. WMI_MAIN_SERVICE_BEACON_OFFLOAD = 0,
  235. WMI_MAIN_SERVICE_SCAN_OFFLOAD,
  236. WMI_MAIN_SERVICE_ROAM_OFFLOAD,
  237. WMI_MAIN_SERVICE_BCN_MISS_OFFLOAD,
  238. WMI_MAIN_SERVICE_STA_PWRSAVE,
  239. WMI_MAIN_SERVICE_STA_ADVANCED_PWRSAVE,
  240. WMI_MAIN_SERVICE_AP_UAPSD,
  241. WMI_MAIN_SERVICE_AP_DFS,
  242. WMI_MAIN_SERVICE_11AC,
  243. WMI_MAIN_SERVICE_BLOCKACK,
  244. WMI_MAIN_SERVICE_PHYERR,
  245. WMI_MAIN_SERVICE_BCN_FILTER,
  246. WMI_MAIN_SERVICE_RTT,
  247. WMI_MAIN_SERVICE_RATECTRL,
  248. WMI_MAIN_SERVICE_WOW,
  249. WMI_MAIN_SERVICE_RATECTRL_CACHE,
  250. WMI_MAIN_SERVICE_IRAM_TIDS,
  251. WMI_MAIN_SERVICE_ARPNS_OFFLOAD,
  252. WMI_MAIN_SERVICE_NLO,
  253. WMI_MAIN_SERVICE_GTK_OFFLOAD,
  254. WMI_MAIN_SERVICE_SCAN_SCH,
  255. WMI_MAIN_SERVICE_CSA_OFFLOAD,
  256. WMI_MAIN_SERVICE_CHATTER,
  257. WMI_MAIN_SERVICE_COEX_FREQAVOID,
  258. WMI_MAIN_SERVICE_PACKET_POWER_SAVE,
  259. WMI_MAIN_SERVICE_FORCE_FW_HANG,
  260. WMI_MAIN_SERVICE_GPIO,
  261. WMI_MAIN_SERVICE_STA_DTIM_PS_MODULATED_DTIM,
  262. WMI_MAIN_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG,
  263. WMI_MAIN_SERVICE_STA_UAPSD_VAR_AUTO_TRIG,
  264. WMI_MAIN_SERVICE_STA_KEEP_ALIVE,
  265. WMI_MAIN_SERVICE_TX_ENCAP,
  266. };
  267. enum wmi_10_4_service {
  268. WMI_10_4_SERVICE_BEACON_OFFLOAD = 0,
  269. WMI_10_4_SERVICE_SCAN_OFFLOAD,
  270. WMI_10_4_SERVICE_ROAM_OFFLOAD,
  271. WMI_10_4_SERVICE_BCN_MISS_OFFLOAD,
  272. WMI_10_4_SERVICE_STA_PWRSAVE,
  273. WMI_10_4_SERVICE_STA_ADVANCED_PWRSAVE,
  274. WMI_10_4_SERVICE_AP_UAPSD,
  275. WMI_10_4_SERVICE_AP_DFS,
  276. WMI_10_4_SERVICE_11AC,
  277. WMI_10_4_SERVICE_BLOCKACK,
  278. WMI_10_4_SERVICE_PHYERR,
  279. WMI_10_4_SERVICE_BCN_FILTER,
  280. WMI_10_4_SERVICE_RTT,
  281. WMI_10_4_SERVICE_RATECTRL,
  282. WMI_10_4_SERVICE_WOW,
  283. WMI_10_4_SERVICE_RATECTRL_CACHE,
  284. WMI_10_4_SERVICE_IRAM_TIDS,
  285. WMI_10_4_SERVICE_BURST,
  286. WMI_10_4_SERVICE_SMART_ANTENNA_SW_SUPPORT,
  287. WMI_10_4_SERVICE_GTK_OFFLOAD,
  288. WMI_10_4_SERVICE_SCAN_SCH,
  289. WMI_10_4_SERVICE_CSA_OFFLOAD,
  290. WMI_10_4_SERVICE_CHATTER,
  291. WMI_10_4_SERVICE_COEX_FREQAVOID,
  292. WMI_10_4_SERVICE_PACKET_POWER_SAVE,
  293. WMI_10_4_SERVICE_FORCE_FW_HANG,
  294. WMI_10_4_SERVICE_SMART_ANTENNA_HW_SUPPORT,
  295. WMI_10_4_SERVICE_GPIO,
  296. WMI_10_4_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG,
  297. WMI_10_4_SERVICE_STA_UAPSD_VAR_AUTO_TRIG,
  298. WMI_10_4_SERVICE_STA_KEEP_ALIVE,
  299. WMI_10_4_SERVICE_TX_ENCAP,
  300. WMI_10_4_SERVICE_AP_PS_DETECT_OUT_OF_SYNC,
  301. WMI_10_4_SERVICE_EARLY_RX,
  302. WMI_10_4_SERVICE_ENHANCED_PROXY_STA,
  303. WMI_10_4_SERVICE_TT,
  304. WMI_10_4_SERVICE_ATF,
  305. WMI_10_4_SERVICE_PEER_CACHING,
  306. WMI_10_4_SERVICE_COEX_GPIO,
  307. WMI_10_4_SERVICE_AUX_SPECTRAL_INTF,
  308. WMI_10_4_SERVICE_AUX_CHAN_LOAD_INTF,
  309. WMI_10_4_SERVICE_BSS_CHANNEL_INFO_64,
  310. WMI_10_4_SERVICE_EXT_RES_CFG_SUPPORT,
  311. WMI_10_4_SERVICE_MESH_NON_11S,
  312. WMI_10_4_SERVICE_RESTRT_CHNL_SUPPORT,
  313. WMI_10_4_SERVICE_PEER_STATS,
  314. WMI_10_4_SERVICE_MESH_11S,
  315. WMI_10_4_SERVICE_PERIODIC_CHAN_STAT_SUPPORT,
  316. WMI_10_4_SERVICE_TX_MODE_PUSH_ONLY,
  317. WMI_10_4_SERVICE_TX_MODE_PUSH_PULL,
  318. WMI_10_4_SERVICE_TX_MODE_DYNAMIC,
  319. WMI_10_4_SERVICE_VDEV_RX_FILTER,
  320. WMI_10_4_SERVICE_BTCOEX,
  321. WMI_10_4_SERVICE_CHECK_CAL_VERSION,
  322. WMI_10_4_SERVICE_DBGLOG_WARN2,
  323. WMI_10_4_SERVICE_BTCOEX_DUTY_CYCLE,
  324. WMI_10_4_SERVICE_4_WIRE_COEX_SUPPORT,
  325. WMI_10_4_SERVICE_EXTENDED_NSS_SUPPORT,
  326. WMI_10_4_SERVICE_PROG_GPIO_BAND_SELECT,
  327. WMI_10_4_SERVICE_SMART_LOGGING_SUPPORT,
  328. WMI_10_4_SERVICE_TDLS,
  329. WMI_10_4_SERVICE_TDLS_OFFCHAN,
  330. WMI_10_4_SERVICE_TDLS_UAPSD_BUFFER_STA,
  331. WMI_10_4_SERVICE_TDLS_UAPSD_SLEEP_STA,
  332. WMI_10_4_SERVICE_TDLS_CONN_TRACKER_IN_HOST_MODE,
  333. WMI_10_4_SERVICE_TDLS_EXPLICIT_MODE_ONLY,
  334. WMI_10_4_SERVICE_TDLS_WIDER_BANDWIDTH,
  335. WMI_10_4_SERVICE_HTT_MGMT_TX_COMP_VALID_FLAGS,
  336. WMI_10_4_SERVICE_HOST_DFS_CHECK_SUPPORT,
  337. WMI_10_4_SERVICE_TPC_STATS_FINAL,
  338. };
  339. static inline char *wmi_service_name(int service_id)
  340. {
  341. #define SVCSTR(x) case x: return #x
  342. switch (service_id) {
  343. SVCSTR(WMI_SERVICE_BEACON_OFFLOAD);
  344. SVCSTR(WMI_SERVICE_SCAN_OFFLOAD);
  345. SVCSTR(WMI_SERVICE_ROAM_OFFLOAD);
  346. SVCSTR(WMI_SERVICE_BCN_MISS_OFFLOAD);
  347. SVCSTR(WMI_SERVICE_STA_PWRSAVE);
  348. SVCSTR(WMI_SERVICE_STA_ADVANCED_PWRSAVE);
  349. SVCSTR(WMI_SERVICE_AP_UAPSD);
  350. SVCSTR(WMI_SERVICE_AP_DFS);
  351. SVCSTR(WMI_SERVICE_11AC);
  352. SVCSTR(WMI_SERVICE_BLOCKACK);
  353. SVCSTR(WMI_SERVICE_PHYERR);
  354. SVCSTR(WMI_SERVICE_BCN_FILTER);
  355. SVCSTR(WMI_SERVICE_RTT);
  356. SVCSTR(WMI_SERVICE_RATECTRL);
  357. SVCSTR(WMI_SERVICE_WOW);
  358. SVCSTR(WMI_SERVICE_RATECTRL_CACHE);
  359. SVCSTR(WMI_SERVICE_IRAM_TIDS);
  360. SVCSTR(WMI_SERVICE_ARPNS_OFFLOAD);
  361. SVCSTR(WMI_SERVICE_NLO);
  362. SVCSTR(WMI_SERVICE_GTK_OFFLOAD);
  363. SVCSTR(WMI_SERVICE_SCAN_SCH);
  364. SVCSTR(WMI_SERVICE_CSA_OFFLOAD);
  365. SVCSTR(WMI_SERVICE_CHATTER);
  366. SVCSTR(WMI_SERVICE_COEX_FREQAVOID);
  367. SVCSTR(WMI_SERVICE_PACKET_POWER_SAVE);
  368. SVCSTR(WMI_SERVICE_FORCE_FW_HANG);
  369. SVCSTR(WMI_SERVICE_GPIO);
  370. SVCSTR(WMI_SERVICE_STA_DTIM_PS_MODULATED_DTIM);
  371. SVCSTR(WMI_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG);
  372. SVCSTR(WMI_SERVICE_STA_UAPSD_VAR_AUTO_TRIG);
  373. SVCSTR(WMI_SERVICE_STA_KEEP_ALIVE);
  374. SVCSTR(WMI_SERVICE_TX_ENCAP);
  375. SVCSTR(WMI_SERVICE_BURST);
  376. SVCSTR(WMI_SERVICE_SMART_ANTENNA_SW_SUPPORT);
  377. SVCSTR(WMI_SERVICE_SMART_ANTENNA_HW_SUPPORT);
  378. SVCSTR(WMI_SERVICE_ROAM_SCAN_OFFLOAD);
  379. SVCSTR(WMI_SERVICE_AP_PS_DETECT_OUT_OF_SYNC);
  380. SVCSTR(WMI_SERVICE_EARLY_RX);
  381. SVCSTR(WMI_SERVICE_STA_SMPS);
  382. SVCSTR(WMI_SERVICE_FWTEST);
  383. SVCSTR(WMI_SERVICE_STA_WMMAC);
  384. SVCSTR(WMI_SERVICE_TDLS);
  385. SVCSTR(WMI_SERVICE_MCC_BCN_INTERVAL_CHANGE);
  386. SVCSTR(WMI_SERVICE_ADAPTIVE_OCS);
  387. SVCSTR(WMI_SERVICE_BA_SSN_SUPPORT);
  388. SVCSTR(WMI_SERVICE_FILTER_IPSEC_NATKEEPALIVE);
  389. SVCSTR(WMI_SERVICE_WLAN_HB);
  390. SVCSTR(WMI_SERVICE_LTE_ANT_SHARE_SUPPORT);
  391. SVCSTR(WMI_SERVICE_BATCH_SCAN);
  392. SVCSTR(WMI_SERVICE_QPOWER);
  393. SVCSTR(WMI_SERVICE_PLMREQ);
  394. SVCSTR(WMI_SERVICE_THERMAL_MGMT);
  395. SVCSTR(WMI_SERVICE_RMC);
  396. SVCSTR(WMI_SERVICE_MHF_OFFLOAD);
  397. SVCSTR(WMI_SERVICE_COEX_SAR);
  398. SVCSTR(WMI_SERVICE_BCN_TXRATE_OVERRIDE);
  399. SVCSTR(WMI_SERVICE_NAN);
  400. SVCSTR(WMI_SERVICE_L1SS_STAT);
  401. SVCSTR(WMI_SERVICE_ESTIMATE_LINKSPEED);
  402. SVCSTR(WMI_SERVICE_OBSS_SCAN);
  403. SVCSTR(WMI_SERVICE_TDLS_OFFCHAN);
  404. SVCSTR(WMI_SERVICE_TDLS_UAPSD_BUFFER_STA);
  405. SVCSTR(WMI_SERVICE_TDLS_UAPSD_SLEEP_STA);
  406. SVCSTR(WMI_SERVICE_IBSS_PWRSAVE);
  407. SVCSTR(WMI_SERVICE_LPASS);
  408. SVCSTR(WMI_SERVICE_EXTSCAN);
  409. SVCSTR(WMI_SERVICE_D0WOW);
  410. SVCSTR(WMI_SERVICE_HSOFFLOAD);
  411. SVCSTR(WMI_SERVICE_ROAM_HO_OFFLOAD);
  412. SVCSTR(WMI_SERVICE_RX_FULL_REORDER);
  413. SVCSTR(WMI_SERVICE_DHCP_OFFLOAD);
  414. SVCSTR(WMI_SERVICE_STA_RX_IPA_OFFLOAD_SUPPORT);
  415. SVCSTR(WMI_SERVICE_MDNS_OFFLOAD);
  416. SVCSTR(WMI_SERVICE_SAP_AUTH_OFFLOAD);
  417. SVCSTR(WMI_SERVICE_ATF);
  418. SVCSTR(WMI_SERVICE_COEX_GPIO);
  419. SVCSTR(WMI_SERVICE_ENHANCED_PROXY_STA);
  420. SVCSTR(WMI_SERVICE_TT);
  421. SVCSTR(WMI_SERVICE_PEER_CACHING);
  422. SVCSTR(WMI_SERVICE_AUX_SPECTRAL_INTF);
  423. SVCSTR(WMI_SERVICE_AUX_CHAN_LOAD_INTF);
  424. SVCSTR(WMI_SERVICE_BSS_CHANNEL_INFO_64);
  425. SVCSTR(WMI_SERVICE_EXT_RES_CFG_SUPPORT);
  426. SVCSTR(WMI_SERVICE_MESH_11S);
  427. SVCSTR(WMI_SERVICE_MESH_NON_11S);
  428. SVCSTR(WMI_SERVICE_PEER_STATS);
  429. SVCSTR(WMI_SERVICE_RESTRT_CHNL_SUPPORT);
  430. SVCSTR(WMI_SERVICE_PERIODIC_CHAN_STAT_SUPPORT);
  431. SVCSTR(WMI_SERVICE_TX_MODE_PUSH_ONLY);
  432. SVCSTR(WMI_SERVICE_TX_MODE_PUSH_PULL);
  433. SVCSTR(WMI_SERVICE_TX_MODE_DYNAMIC);
  434. SVCSTR(WMI_SERVICE_VDEV_RX_FILTER);
  435. SVCSTR(WMI_SERVICE_CHECK_CAL_VERSION);
  436. SVCSTR(WMI_SERVICE_DBGLOG_WARN2);
  437. SVCSTR(WMI_SERVICE_BTCOEX_DUTY_CYCLE);
  438. SVCSTR(WMI_SERVICE_4_WIRE_COEX_SUPPORT);
  439. SVCSTR(WMI_SERVICE_EXTENDED_NSS_SUPPORT);
  440. SVCSTR(WMI_SERVICE_PROG_GPIO_BAND_SELECT);
  441. SVCSTR(WMI_SERVICE_SMART_LOGGING_SUPPORT);
  442. SVCSTR(WMI_SERVICE_TDLS_CONN_TRACKER_IN_HOST_MODE);
  443. SVCSTR(WMI_SERVICE_TDLS_EXPLICIT_MODE_ONLY);
  444. SVCSTR(WMI_SERVICE_TDLS_WIDER_BANDWIDTH);
  445. SVCSTR(WMI_SERVICE_HTT_MGMT_TX_COMP_VALID_FLAGS);
  446. SVCSTR(WMI_SERVICE_HOST_DFS_CHECK_SUPPORT);
  447. SVCSTR(WMI_SERVICE_TPC_STATS_FINAL);
  448. SVCSTR(WMI_SERVICE_RESET_CHIP);
  449. default:
  450. return NULL;
  451. }
  452. #undef SVCSTR
  453. }
  454. #define WMI_SERVICE_IS_ENABLED(wmi_svc_bmap, svc_id, len) \
  455. ((svc_id) < (len) && \
  456. __le32_to_cpu((wmi_svc_bmap)[(svc_id) / (sizeof(u32))]) & \
  457. BIT((svc_id) % (sizeof(u32))))
  458. /* This extension is required to accommodate new services, current limit
  459. * for wmi_services is 64 as target is using only 4-bits of each 32-bit
  460. * wmi_service word. Extending this to make use of remaining unused bits
  461. * for new services.
  462. */
  463. #define WMI_EXT_SERVICE_IS_ENABLED(wmi_svc_bmap, svc_id, len) \
  464. ((svc_id) >= (len) && \
  465. __le32_to_cpu((wmi_svc_bmap)[((svc_id) - (len)) / 28]) & \
  466. BIT(((((svc_id) - (len)) % 28) & 0x1f) + 4))
  467. #define SVCMAP(x, y, len) \
  468. do { \
  469. if ((WMI_SERVICE_IS_ENABLED((in), (x), (len))) || \
  470. (WMI_EXT_SERVICE_IS_ENABLED((in), (x), (len)))) \
  471. __set_bit(y, out); \
  472. } while (0)
  473. static inline void wmi_10x_svc_map(const __le32 *in, unsigned long *out,
  474. size_t len)
  475. {
  476. SVCMAP(WMI_10X_SERVICE_BEACON_OFFLOAD,
  477. WMI_SERVICE_BEACON_OFFLOAD, len);
  478. SVCMAP(WMI_10X_SERVICE_SCAN_OFFLOAD,
  479. WMI_SERVICE_SCAN_OFFLOAD, len);
  480. SVCMAP(WMI_10X_SERVICE_ROAM_OFFLOAD,
  481. WMI_SERVICE_ROAM_OFFLOAD, len);
  482. SVCMAP(WMI_10X_SERVICE_BCN_MISS_OFFLOAD,
  483. WMI_SERVICE_BCN_MISS_OFFLOAD, len);
  484. SVCMAP(WMI_10X_SERVICE_STA_PWRSAVE,
  485. WMI_SERVICE_STA_PWRSAVE, len);
  486. SVCMAP(WMI_10X_SERVICE_STA_ADVANCED_PWRSAVE,
  487. WMI_SERVICE_STA_ADVANCED_PWRSAVE, len);
  488. SVCMAP(WMI_10X_SERVICE_AP_UAPSD,
  489. WMI_SERVICE_AP_UAPSD, len);
  490. SVCMAP(WMI_10X_SERVICE_AP_DFS,
  491. WMI_SERVICE_AP_DFS, len);
  492. SVCMAP(WMI_10X_SERVICE_11AC,
  493. WMI_SERVICE_11AC, len);
  494. SVCMAP(WMI_10X_SERVICE_BLOCKACK,
  495. WMI_SERVICE_BLOCKACK, len);
  496. SVCMAP(WMI_10X_SERVICE_PHYERR,
  497. WMI_SERVICE_PHYERR, len);
  498. SVCMAP(WMI_10X_SERVICE_BCN_FILTER,
  499. WMI_SERVICE_BCN_FILTER, len);
  500. SVCMAP(WMI_10X_SERVICE_RTT,
  501. WMI_SERVICE_RTT, len);
  502. SVCMAP(WMI_10X_SERVICE_RATECTRL,
  503. WMI_SERVICE_RATECTRL, len);
  504. SVCMAP(WMI_10X_SERVICE_WOW,
  505. WMI_SERVICE_WOW, len);
  506. SVCMAP(WMI_10X_SERVICE_RATECTRL_CACHE,
  507. WMI_SERVICE_RATECTRL_CACHE, len);
  508. SVCMAP(WMI_10X_SERVICE_IRAM_TIDS,
  509. WMI_SERVICE_IRAM_TIDS, len);
  510. SVCMAP(WMI_10X_SERVICE_BURST,
  511. WMI_SERVICE_BURST, len);
  512. SVCMAP(WMI_10X_SERVICE_SMART_ANTENNA_SW_SUPPORT,
  513. WMI_SERVICE_SMART_ANTENNA_SW_SUPPORT, len);
  514. SVCMAP(WMI_10X_SERVICE_FORCE_FW_HANG,
  515. WMI_SERVICE_FORCE_FW_HANG, len);
  516. SVCMAP(WMI_10X_SERVICE_SMART_ANTENNA_HW_SUPPORT,
  517. WMI_SERVICE_SMART_ANTENNA_HW_SUPPORT, len);
  518. SVCMAP(WMI_10X_SERVICE_ATF,
  519. WMI_SERVICE_ATF, len);
  520. SVCMAP(WMI_10X_SERVICE_COEX_GPIO,
  521. WMI_SERVICE_COEX_GPIO, len);
  522. SVCMAP(WMI_10X_SERVICE_AUX_SPECTRAL_INTF,
  523. WMI_SERVICE_AUX_SPECTRAL_INTF, len);
  524. SVCMAP(WMI_10X_SERVICE_AUX_CHAN_LOAD_INTF,
  525. WMI_SERVICE_AUX_CHAN_LOAD_INTF, len);
  526. SVCMAP(WMI_10X_SERVICE_BSS_CHANNEL_INFO_64,
  527. WMI_SERVICE_BSS_CHANNEL_INFO_64, len);
  528. SVCMAP(WMI_10X_SERVICE_MESH,
  529. WMI_SERVICE_MESH_11S, len);
  530. SVCMAP(WMI_10X_SERVICE_EXT_RES_CFG_SUPPORT,
  531. WMI_SERVICE_EXT_RES_CFG_SUPPORT, len);
  532. SVCMAP(WMI_10X_SERVICE_PEER_STATS,
  533. WMI_SERVICE_PEER_STATS, len);
  534. SVCMAP(WMI_10X_SERVICE_RESET_CHIP,
  535. WMI_SERVICE_RESET_CHIP, len);
  536. SVCMAP(WMI_10X_SERVICE_HTT_MGMT_TX_COMP_VALID_FLAGS,
  537. WMI_SERVICE_HTT_MGMT_TX_COMP_VALID_FLAGS, len);
  538. }
  539. static inline void wmi_main_svc_map(const __le32 *in, unsigned long *out,
  540. size_t len)
  541. {
  542. SVCMAP(WMI_MAIN_SERVICE_BEACON_OFFLOAD,
  543. WMI_SERVICE_BEACON_OFFLOAD, len);
  544. SVCMAP(WMI_MAIN_SERVICE_SCAN_OFFLOAD,
  545. WMI_SERVICE_SCAN_OFFLOAD, len);
  546. SVCMAP(WMI_MAIN_SERVICE_ROAM_OFFLOAD,
  547. WMI_SERVICE_ROAM_OFFLOAD, len);
  548. SVCMAP(WMI_MAIN_SERVICE_BCN_MISS_OFFLOAD,
  549. WMI_SERVICE_BCN_MISS_OFFLOAD, len);
  550. SVCMAP(WMI_MAIN_SERVICE_STA_PWRSAVE,
  551. WMI_SERVICE_STA_PWRSAVE, len);
  552. SVCMAP(WMI_MAIN_SERVICE_STA_ADVANCED_PWRSAVE,
  553. WMI_SERVICE_STA_ADVANCED_PWRSAVE, len);
  554. SVCMAP(WMI_MAIN_SERVICE_AP_UAPSD,
  555. WMI_SERVICE_AP_UAPSD, len);
  556. SVCMAP(WMI_MAIN_SERVICE_AP_DFS,
  557. WMI_SERVICE_AP_DFS, len);
  558. SVCMAP(WMI_MAIN_SERVICE_11AC,
  559. WMI_SERVICE_11AC, len);
  560. SVCMAP(WMI_MAIN_SERVICE_BLOCKACK,
  561. WMI_SERVICE_BLOCKACK, len);
  562. SVCMAP(WMI_MAIN_SERVICE_PHYERR,
  563. WMI_SERVICE_PHYERR, len);
  564. SVCMAP(WMI_MAIN_SERVICE_BCN_FILTER,
  565. WMI_SERVICE_BCN_FILTER, len);
  566. SVCMAP(WMI_MAIN_SERVICE_RTT,
  567. WMI_SERVICE_RTT, len);
  568. SVCMAP(WMI_MAIN_SERVICE_RATECTRL,
  569. WMI_SERVICE_RATECTRL, len);
  570. SVCMAP(WMI_MAIN_SERVICE_WOW,
  571. WMI_SERVICE_WOW, len);
  572. SVCMAP(WMI_MAIN_SERVICE_RATECTRL_CACHE,
  573. WMI_SERVICE_RATECTRL_CACHE, len);
  574. SVCMAP(WMI_MAIN_SERVICE_IRAM_TIDS,
  575. WMI_SERVICE_IRAM_TIDS, len);
  576. SVCMAP(WMI_MAIN_SERVICE_ARPNS_OFFLOAD,
  577. WMI_SERVICE_ARPNS_OFFLOAD, len);
  578. SVCMAP(WMI_MAIN_SERVICE_NLO,
  579. WMI_SERVICE_NLO, len);
  580. SVCMAP(WMI_MAIN_SERVICE_GTK_OFFLOAD,
  581. WMI_SERVICE_GTK_OFFLOAD, len);
  582. SVCMAP(WMI_MAIN_SERVICE_SCAN_SCH,
  583. WMI_SERVICE_SCAN_SCH, len);
  584. SVCMAP(WMI_MAIN_SERVICE_CSA_OFFLOAD,
  585. WMI_SERVICE_CSA_OFFLOAD, len);
  586. SVCMAP(WMI_MAIN_SERVICE_CHATTER,
  587. WMI_SERVICE_CHATTER, len);
  588. SVCMAP(WMI_MAIN_SERVICE_COEX_FREQAVOID,
  589. WMI_SERVICE_COEX_FREQAVOID, len);
  590. SVCMAP(WMI_MAIN_SERVICE_PACKET_POWER_SAVE,
  591. WMI_SERVICE_PACKET_POWER_SAVE, len);
  592. SVCMAP(WMI_MAIN_SERVICE_FORCE_FW_HANG,
  593. WMI_SERVICE_FORCE_FW_HANG, len);
  594. SVCMAP(WMI_MAIN_SERVICE_GPIO,
  595. WMI_SERVICE_GPIO, len);
  596. SVCMAP(WMI_MAIN_SERVICE_STA_DTIM_PS_MODULATED_DTIM,
  597. WMI_SERVICE_STA_DTIM_PS_MODULATED_DTIM, len);
  598. SVCMAP(WMI_MAIN_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG,
  599. WMI_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG, len);
  600. SVCMAP(WMI_MAIN_SERVICE_STA_UAPSD_VAR_AUTO_TRIG,
  601. WMI_SERVICE_STA_UAPSD_VAR_AUTO_TRIG, len);
  602. SVCMAP(WMI_MAIN_SERVICE_STA_KEEP_ALIVE,
  603. WMI_SERVICE_STA_KEEP_ALIVE, len);
  604. SVCMAP(WMI_MAIN_SERVICE_TX_ENCAP,
  605. WMI_SERVICE_TX_ENCAP, len);
  606. }
  607. static inline void wmi_10_4_svc_map(const __le32 *in, unsigned long *out,
  608. size_t len)
  609. {
  610. SVCMAP(WMI_10_4_SERVICE_BEACON_OFFLOAD,
  611. WMI_SERVICE_BEACON_OFFLOAD, len);
  612. SVCMAP(WMI_10_4_SERVICE_SCAN_OFFLOAD,
  613. WMI_SERVICE_SCAN_OFFLOAD, len);
  614. SVCMAP(WMI_10_4_SERVICE_ROAM_OFFLOAD,
  615. WMI_SERVICE_ROAM_OFFLOAD, len);
  616. SVCMAP(WMI_10_4_SERVICE_BCN_MISS_OFFLOAD,
  617. WMI_SERVICE_BCN_MISS_OFFLOAD, len);
  618. SVCMAP(WMI_10_4_SERVICE_STA_PWRSAVE,
  619. WMI_SERVICE_STA_PWRSAVE, len);
  620. SVCMAP(WMI_10_4_SERVICE_STA_ADVANCED_PWRSAVE,
  621. WMI_SERVICE_STA_ADVANCED_PWRSAVE, len);
  622. SVCMAP(WMI_10_4_SERVICE_AP_UAPSD,
  623. WMI_SERVICE_AP_UAPSD, len);
  624. SVCMAP(WMI_10_4_SERVICE_AP_DFS,
  625. WMI_SERVICE_AP_DFS, len);
  626. SVCMAP(WMI_10_4_SERVICE_11AC,
  627. WMI_SERVICE_11AC, len);
  628. SVCMAP(WMI_10_4_SERVICE_BLOCKACK,
  629. WMI_SERVICE_BLOCKACK, len);
  630. SVCMAP(WMI_10_4_SERVICE_PHYERR,
  631. WMI_SERVICE_PHYERR, len);
  632. SVCMAP(WMI_10_4_SERVICE_BCN_FILTER,
  633. WMI_SERVICE_BCN_FILTER, len);
  634. SVCMAP(WMI_10_4_SERVICE_RTT,
  635. WMI_SERVICE_RTT, len);
  636. SVCMAP(WMI_10_4_SERVICE_RATECTRL,
  637. WMI_SERVICE_RATECTRL, len);
  638. SVCMAP(WMI_10_4_SERVICE_WOW,
  639. WMI_SERVICE_WOW, len);
  640. SVCMAP(WMI_10_4_SERVICE_RATECTRL_CACHE,
  641. WMI_SERVICE_RATECTRL_CACHE, len);
  642. SVCMAP(WMI_10_4_SERVICE_IRAM_TIDS,
  643. WMI_SERVICE_IRAM_TIDS, len);
  644. SVCMAP(WMI_10_4_SERVICE_BURST,
  645. WMI_SERVICE_BURST, len);
  646. SVCMAP(WMI_10_4_SERVICE_SMART_ANTENNA_SW_SUPPORT,
  647. WMI_SERVICE_SMART_ANTENNA_SW_SUPPORT, len);
  648. SVCMAP(WMI_10_4_SERVICE_GTK_OFFLOAD,
  649. WMI_SERVICE_GTK_OFFLOAD, len);
  650. SVCMAP(WMI_10_4_SERVICE_SCAN_SCH,
  651. WMI_SERVICE_SCAN_SCH, len);
  652. SVCMAP(WMI_10_4_SERVICE_CSA_OFFLOAD,
  653. WMI_SERVICE_CSA_OFFLOAD, len);
  654. SVCMAP(WMI_10_4_SERVICE_CHATTER,
  655. WMI_SERVICE_CHATTER, len);
  656. SVCMAP(WMI_10_4_SERVICE_COEX_FREQAVOID,
  657. WMI_SERVICE_COEX_FREQAVOID, len);
  658. SVCMAP(WMI_10_4_SERVICE_PACKET_POWER_SAVE,
  659. WMI_SERVICE_PACKET_POWER_SAVE, len);
  660. SVCMAP(WMI_10_4_SERVICE_FORCE_FW_HANG,
  661. WMI_SERVICE_FORCE_FW_HANG, len);
  662. SVCMAP(WMI_10_4_SERVICE_SMART_ANTENNA_HW_SUPPORT,
  663. WMI_SERVICE_SMART_ANTENNA_HW_SUPPORT, len);
  664. SVCMAP(WMI_10_4_SERVICE_GPIO,
  665. WMI_SERVICE_GPIO, len);
  666. SVCMAP(WMI_10_4_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG,
  667. WMI_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG, len);
  668. SVCMAP(WMI_10_4_SERVICE_STA_UAPSD_VAR_AUTO_TRIG,
  669. WMI_SERVICE_STA_UAPSD_VAR_AUTO_TRIG, len);
  670. SVCMAP(WMI_10_4_SERVICE_STA_KEEP_ALIVE,
  671. WMI_SERVICE_STA_KEEP_ALIVE, len);
  672. SVCMAP(WMI_10_4_SERVICE_TX_ENCAP,
  673. WMI_SERVICE_TX_ENCAP, len);
  674. SVCMAP(WMI_10_4_SERVICE_AP_PS_DETECT_OUT_OF_SYNC,
  675. WMI_SERVICE_AP_PS_DETECT_OUT_OF_SYNC, len);
  676. SVCMAP(WMI_10_4_SERVICE_EARLY_RX,
  677. WMI_SERVICE_EARLY_RX, len);
  678. SVCMAP(WMI_10_4_SERVICE_ENHANCED_PROXY_STA,
  679. WMI_SERVICE_ENHANCED_PROXY_STA, len);
  680. SVCMAP(WMI_10_4_SERVICE_TT,
  681. WMI_SERVICE_TT, len);
  682. SVCMAP(WMI_10_4_SERVICE_ATF,
  683. WMI_SERVICE_ATF, len);
  684. SVCMAP(WMI_10_4_SERVICE_PEER_CACHING,
  685. WMI_SERVICE_PEER_CACHING, len);
  686. SVCMAP(WMI_10_4_SERVICE_COEX_GPIO,
  687. WMI_SERVICE_COEX_GPIO, len);
  688. SVCMAP(WMI_10_4_SERVICE_AUX_SPECTRAL_INTF,
  689. WMI_SERVICE_AUX_SPECTRAL_INTF, len);
  690. SVCMAP(WMI_10_4_SERVICE_AUX_CHAN_LOAD_INTF,
  691. WMI_SERVICE_AUX_CHAN_LOAD_INTF, len);
  692. SVCMAP(WMI_10_4_SERVICE_BSS_CHANNEL_INFO_64,
  693. WMI_SERVICE_BSS_CHANNEL_INFO_64, len);
  694. SVCMAP(WMI_10_4_SERVICE_EXT_RES_CFG_SUPPORT,
  695. WMI_SERVICE_EXT_RES_CFG_SUPPORT, len);
  696. SVCMAP(WMI_10_4_SERVICE_MESH_NON_11S,
  697. WMI_SERVICE_MESH_NON_11S, len);
  698. SVCMAP(WMI_10_4_SERVICE_RESTRT_CHNL_SUPPORT,
  699. WMI_SERVICE_RESTRT_CHNL_SUPPORT, len);
  700. SVCMAP(WMI_10_4_SERVICE_PEER_STATS,
  701. WMI_SERVICE_PEER_STATS, len);
  702. SVCMAP(WMI_10_4_SERVICE_MESH_11S,
  703. WMI_SERVICE_MESH_11S, len);
  704. SVCMAP(WMI_10_4_SERVICE_PERIODIC_CHAN_STAT_SUPPORT,
  705. WMI_SERVICE_PERIODIC_CHAN_STAT_SUPPORT, len);
  706. SVCMAP(WMI_10_4_SERVICE_TX_MODE_PUSH_ONLY,
  707. WMI_SERVICE_TX_MODE_PUSH_ONLY, len);
  708. SVCMAP(WMI_10_4_SERVICE_TX_MODE_PUSH_PULL,
  709. WMI_SERVICE_TX_MODE_PUSH_PULL, len);
  710. SVCMAP(WMI_10_4_SERVICE_TX_MODE_DYNAMIC,
  711. WMI_SERVICE_TX_MODE_DYNAMIC, len);
  712. SVCMAP(WMI_10_4_SERVICE_VDEV_RX_FILTER,
  713. WMI_SERVICE_VDEV_RX_FILTER, len);
  714. SVCMAP(WMI_10_4_SERVICE_BTCOEX,
  715. WMI_SERVICE_BTCOEX, len);
  716. SVCMAP(WMI_10_4_SERVICE_CHECK_CAL_VERSION,
  717. WMI_SERVICE_CHECK_CAL_VERSION, len);
  718. SVCMAP(WMI_10_4_SERVICE_DBGLOG_WARN2,
  719. WMI_SERVICE_DBGLOG_WARN2, len);
  720. SVCMAP(WMI_10_4_SERVICE_BTCOEX_DUTY_CYCLE,
  721. WMI_SERVICE_BTCOEX_DUTY_CYCLE, len);
  722. SVCMAP(WMI_10_4_SERVICE_4_WIRE_COEX_SUPPORT,
  723. WMI_SERVICE_4_WIRE_COEX_SUPPORT, len);
  724. SVCMAP(WMI_10_4_SERVICE_EXTENDED_NSS_SUPPORT,
  725. WMI_SERVICE_EXTENDED_NSS_SUPPORT, len);
  726. SVCMAP(WMI_10_4_SERVICE_PROG_GPIO_BAND_SELECT,
  727. WMI_SERVICE_PROG_GPIO_BAND_SELECT, len);
  728. SVCMAP(WMI_10_4_SERVICE_SMART_LOGGING_SUPPORT,
  729. WMI_SERVICE_SMART_LOGGING_SUPPORT, len);
  730. SVCMAP(WMI_10_4_SERVICE_TDLS,
  731. WMI_SERVICE_TDLS, len);
  732. SVCMAP(WMI_10_4_SERVICE_TDLS_OFFCHAN,
  733. WMI_SERVICE_TDLS_OFFCHAN, len);
  734. SVCMAP(WMI_10_4_SERVICE_TDLS_UAPSD_BUFFER_STA,
  735. WMI_SERVICE_TDLS_UAPSD_BUFFER_STA, len);
  736. SVCMAP(WMI_10_4_SERVICE_TDLS_UAPSD_SLEEP_STA,
  737. WMI_SERVICE_TDLS_UAPSD_SLEEP_STA, len);
  738. SVCMAP(WMI_10_4_SERVICE_TDLS_CONN_TRACKER_IN_HOST_MODE,
  739. WMI_SERVICE_TDLS_CONN_TRACKER_IN_HOST_MODE, len);
  740. SVCMAP(WMI_10_4_SERVICE_TDLS_EXPLICIT_MODE_ONLY,
  741. WMI_SERVICE_TDLS_EXPLICIT_MODE_ONLY, len);
  742. SVCMAP(WMI_10_4_SERVICE_TDLS_WIDER_BANDWIDTH,
  743. WMI_SERVICE_TDLS_WIDER_BANDWIDTH, len);
  744. SVCMAP(WMI_10_4_SERVICE_HTT_MGMT_TX_COMP_VALID_FLAGS,
  745. WMI_SERVICE_HTT_MGMT_TX_COMP_VALID_FLAGS, len);
  746. SVCMAP(WMI_10_4_SERVICE_HOST_DFS_CHECK_SUPPORT,
  747. WMI_SERVICE_HOST_DFS_CHECK_SUPPORT, len);
  748. SVCMAP(WMI_10_4_SERVICE_TPC_STATS_FINAL,
  749. WMI_SERVICE_TPC_STATS_FINAL, len);
  750. }
  751. #undef SVCMAP
  752. /* 2 word representation of MAC addr */
  753. struct wmi_mac_addr {
  754. union {
  755. u8 addr[6];
  756. struct {
  757. u32 word0;
  758. u32 word1;
  759. } __packed;
  760. } __packed;
  761. } __packed;
  762. struct wmi_cmd_map {
  763. u32 init_cmdid;
  764. u32 start_scan_cmdid;
  765. u32 stop_scan_cmdid;
  766. u32 scan_chan_list_cmdid;
  767. u32 scan_sch_prio_tbl_cmdid;
  768. u32 scan_prob_req_oui_cmdid;
  769. u32 pdev_set_regdomain_cmdid;
  770. u32 pdev_set_channel_cmdid;
  771. u32 pdev_set_param_cmdid;
  772. u32 pdev_pktlog_enable_cmdid;
  773. u32 pdev_pktlog_disable_cmdid;
  774. u32 pdev_set_wmm_params_cmdid;
  775. u32 pdev_set_ht_cap_ie_cmdid;
  776. u32 pdev_set_vht_cap_ie_cmdid;
  777. u32 pdev_set_dscp_tid_map_cmdid;
  778. u32 pdev_set_quiet_mode_cmdid;
  779. u32 pdev_green_ap_ps_enable_cmdid;
  780. u32 pdev_get_tpc_config_cmdid;
  781. u32 pdev_set_base_macaddr_cmdid;
  782. u32 vdev_create_cmdid;
  783. u32 vdev_delete_cmdid;
  784. u32 vdev_start_request_cmdid;
  785. u32 vdev_restart_request_cmdid;
  786. u32 vdev_up_cmdid;
  787. u32 vdev_stop_cmdid;
  788. u32 vdev_down_cmdid;
  789. u32 vdev_set_param_cmdid;
  790. u32 vdev_install_key_cmdid;
  791. u32 peer_create_cmdid;
  792. u32 peer_delete_cmdid;
  793. u32 peer_flush_tids_cmdid;
  794. u32 peer_set_param_cmdid;
  795. u32 peer_assoc_cmdid;
  796. u32 peer_add_wds_entry_cmdid;
  797. u32 peer_remove_wds_entry_cmdid;
  798. u32 peer_mcast_group_cmdid;
  799. u32 bcn_tx_cmdid;
  800. u32 pdev_send_bcn_cmdid;
  801. u32 bcn_tmpl_cmdid;
  802. u32 bcn_filter_rx_cmdid;
  803. u32 prb_req_filter_rx_cmdid;
  804. u32 mgmt_tx_cmdid;
  805. u32 mgmt_tx_send_cmdid;
  806. u32 prb_tmpl_cmdid;
  807. u32 addba_clear_resp_cmdid;
  808. u32 addba_send_cmdid;
  809. u32 addba_status_cmdid;
  810. u32 delba_send_cmdid;
  811. u32 addba_set_resp_cmdid;
  812. u32 send_singleamsdu_cmdid;
  813. u32 sta_powersave_mode_cmdid;
  814. u32 sta_powersave_param_cmdid;
  815. u32 sta_mimo_ps_mode_cmdid;
  816. u32 pdev_dfs_enable_cmdid;
  817. u32 pdev_dfs_disable_cmdid;
  818. u32 roam_scan_mode;
  819. u32 roam_scan_rssi_threshold;
  820. u32 roam_scan_period;
  821. u32 roam_scan_rssi_change_threshold;
  822. u32 roam_ap_profile;
  823. u32 ofl_scan_add_ap_profile;
  824. u32 ofl_scan_remove_ap_profile;
  825. u32 ofl_scan_period;
  826. u32 p2p_dev_set_device_info;
  827. u32 p2p_dev_set_discoverability;
  828. u32 p2p_go_set_beacon_ie;
  829. u32 p2p_go_set_probe_resp_ie;
  830. u32 p2p_set_vendor_ie_data_cmdid;
  831. u32 ap_ps_peer_param_cmdid;
  832. u32 ap_ps_peer_uapsd_coex_cmdid;
  833. u32 peer_rate_retry_sched_cmdid;
  834. u32 wlan_profile_trigger_cmdid;
  835. u32 wlan_profile_set_hist_intvl_cmdid;
  836. u32 wlan_profile_get_profile_data_cmdid;
  837. u32 wlan_profile_enable_profile_id_cmdid;
  838. u32 wlan_profile_list_profile_id_cmdid;
  839. u32 pdev_suspend_cmdid;
  840. u32 pdev_resume_cmdid;
  841. u32 add_bcn_filter_cmdid;
  842. u32 rmv_bcn_filter_cmdid;
  843. u32 wow_add_wake_pattern_cmdid;
  844. u32 wow_del_wake_pattern_cmdid;
  845. u32 wow_enable_disable_wake_event_cmdid;
  846. u32 wow_enable_cmdid;
  847. u32 wow_hostwakeup_from_sleep_cmdid;
  848. u32 rtt_measreq_cmdid;
  849. u32 rtt_tsf_cmdid;
  850. u32 vdev_spectral_scan_configure_cmdid;
  851. u32 vdev_spectral_scan_enable_cmdid;
  852. u32 request_stats_cmdid;
  853. u32 set_arp_ns_offload_cmdid;
  854. u32 network_list_offload_config_cmdid;
  855. u32 gtk_offload_cmdid;
  856. u32 csa_offload_enable_cmdid;
  857. u32 csa_offload_chanswitch_cmdid;
  858. u32 chatter_set_mode_cmdid;
  859. u32 peer_tid_addba_cmdid;
  860. u32 peer_tid_delba_cmdid;
  861. u32 sta_dtim_ps_method_cmdid;
  862. u32 sta_uapsd_auto_trig_cmdid;
  863. u32 sta_keepalive_cmd;
  864. u32 echo_cmdid;
  865. u32 pdev_utf_cmdid;
  866. u32 dbglog_cfg_cmdid;
  867. u32 pdev_qvit_cmdid;
  868. u32 pdev_ftm_intg_cmdid;
  869. u32 vdev_set_keepalive_cmdid;
  870. u32 vdev_get_keepalive_cmdid;
  871. u32 force_fw_hang_cmdid;
  872. u32 gpio_config_cmdid;
  873. u32 gpio_output_cmdid;
  874. u32 pdev_get_temperature_cmdid;
  875. u32 vdev_set_wmm_params_cmdid;
  876. u32 tdls_set_state_cmdid;
  877. u32 tdls_peer_update_cmdid;
  878. u32 adaptive_qcs_cmdid;
  879. u32 scan_update_request_cmdid;
  880. u32 vdev_standby_response_cmdid;
  881. u32 vdev_resume_response_cmdid;
  882. u32 wlan_peer_caching_add_peer_cmdid;
  883. u32 wlan_peer_caching_evict_peer_cmdid;
  884. u32 wlan_peer_caching_restore_peer_cmdid;
  885. u32 wlan_peer_caching_print_all_peers_info_cmdid;
  886. u32 peer_update_wds_entry_cmdid;
  887. u32 peer_add_proxy_sta_entry_cmdid;
  888. u32 rtt_keepalive_cmdid;
  889. u32 oem_req_cmdid;
  890. u32 nan_cmdid;
  891. u32 vdev_ratemask_cmdid;
  892. u32 qboost_cfg_cmdid;
  893. u32 pdev_smart_ant_enable_cmdid;
  894. u32 pdev_smart_ant_set_rx_antenna_cmdid;
  895. u32 peer_smart_ant_set_tx_antenna_cmdid;
  896. u32 peer_smart_ant_set_train_info_cmdid;
  897. u32 peer_smart_ant_set_node_config_ops_cmdid;
  898. u32 pdev_set_antenna_switch_table_cmdid;
  899. u32 pdev_set_ctl_table_cmdid;
  900. u32 pdev_set_mimogain_table_cmdid;
  901. u32 pdev_ratepwr_table_cmdid;
  902. u32 pdev_ratepwr_chainmsk_table_cmdid;
  903. u32 pdev_fips_cmdid;
  904. u32 tt_set_conf_cmdid;
  905. u32 fwtest_cmdid;
  906. u32 vdev_atf_request_cmdid;
  907. u32 peer_atf_request_cmdid;
  908. u32 pdev_get_ani_cck_config_cmdid;
  909. u32 pdev_get_ani_ofdm_config_cmdid;
  910. u32 pdev_reserve_ast_entry_cmdid;
  911. u32 pdev_get_nfcal_power_cmdid;
  912. u32 pdev_get_tpc_cmdid;
  913. u32 pdev_get_ast_info_cmdid;
  914. u32 vdev_set_dscp_tid_map_cmdid;
  915. u32 pdev_get_info_cmdid;
  916. u32 vdev_get_info_cmdid;
  917. u32 vdev_filter_neighbor_rx_packets_cmdid;
  918. u32 mu_cal_start_cmdid;
  919. u32 set_cca_params_cmdid;
  920. u32 pdev_bss_chan_info_request_cmdid;
  921. u32 pdev_enable_adaptive_cca_cmdid;
  922. u32 ext_resource_cfg_cmdid;
  923. u32 vdev_set_ie_cmdid;
  924. u32 set_lteu_config_cmdid;
  925. u32 atf_ssid_grouping_request_cmdid;
  926. u32 peer_atf_ext_request_cmdid;
  927. u32 set_periodic_channel_stats_cfg_cmdid;
  928. u32 peer_bwf_request_cmdid;
  929. u32 btcoex_cfg_cmdid;
  930. u32 peer_tx_mu_txmit_count_cmdid;
  931. u32 peer_tx_mu_txmit_rstcnt_cmdid;
  932. u32 peer_gid_userpos_list_cmdid;
  933. u32 pdev_check_cal_version_cmdid;
  934. u32 coex_version_cfg_cmid;
  935. u32 pdev_get_rx_filter_cmdid;
  936. u32 pdev_extended_nss_cfg_cmdid;
  937. u32 vdev_set_scan_nac_rssi_cmdid;
  938. u32 prog_gpio_band_select_cmdid;
  939. u32 config_smart_logging_cmdid;
  940. u32 debug_fatal_condition_cmdid;
  941. u32 get_tsf_timer_cmdid;
  942. u32 pdev_get_tpc_table_cmdid;
  943. u32 vdev_sifs_trigger_time_cmdid;
  944. u32 pdev_wds_entry_list_cmdid;
  945. u32 tdls_set_offchan_mode_cmdid;
  946. u32 radar_found_cmdid;
  947. };
  948. /*
  949. * wmi command groups.
  950. */
  951. enum wmi_cmd_group {
  952. /* 0 to 2 are reserved */
  953. WMI_GRP_START = 0x3,
  954. WMI_GRP_SCAN = WMI_GRP_START,
  955. WMI_GRP_PDEV,
  956. WMI_GRP_VDEV,
  957. WMI_GRP_PEER,
  958. WMI_GRP_MGMT,
  959. WMI_GRP_BA_NEG,
  960. WMI_GRP_STA_PS,
  961. WMI_GRP_DFS,
  962. WMI_GRP_ROAM,
  963. WMI_GRP_OFL_SCAN,
  964. WMI_GRP_P2P,
  965. WMI_GRP_AP_PS,
  966. WMI_GRP_RATE_CTRL,
  967. WMI_GRP_PROFILE,
  968. WMI_GRP_SUSPEND,
  969. WMI_GRP_BCN_FILTER,
  970. WMI_GRP_WOW,
  971. WMI_GRP_RTT,
  972. WMI_GRP_SPECTRAL,
  973. WMI_GRP_STATS,
  974. WMI_GRP_ARP_NS_OFL,
  975. WMI_GRP_NLO_OFL,
  976. WMI_GRP_GTK_OFL,
  977. WMI_GRP_CSA_OFL,
  978. WMI_GRP_CHATTER,
  979. WMI_GRP_TID_ADDBA,
  980. WMI_GRP_MISC,
  981. WMI_GRP_GPIO,
  982. };
  983. #define WMI_CMD_GRP(grp_id) (((grp_id) << 12) | 0x1)
  984. #define WMI_EVT_GRP_START_ID(grp_id) (((grp_id) << 12) | 0x1)
  985. #define WMI_CMD_UNSUPPORTED 0
  986. /* Command IDs and command events for MAIN FW. */
  987. enum wmi_cmd_id {
  988. WMI_INIT_CMDID = 0x1,
  989. /* Scan specific commands */
  990. WMI_START_SCAN_CMDID = WMI_CMD_GRP(WMI_GRP_SCAN),
  991. WMI_STOP_SCAN_CMDID,
  992. WMI_SCAN_CHAN_LIST_CMDID,
  993. WMI_SCAN_SCH_PRIO_TBL_CMDID,
  994. /* PDEV (physical device) specific commands */
  995. WMI_PDEV_SET_REGDOMAIN_CMDID = WMI_CMD_GRP(WMI_GRP_PDEV),
  996. WMI_PDEV_SET_CHANNEL_CMDID,
  997. WMI_PDEV_SET_PARAM_CMDID,
  998. WMI_PDEV_PKTLOG_ENABLE_CMDID,
  999. WMI_PDEV_PKTLOG_DISABLE_CMDID,
  1000. WMI_PDEV_SET_WMM_PARAMS_CMDID,
  1001. WMI_PDEV_SET_HT_CAP_IE_CMDID,
  1002. WMI_PDEV_SET_VHT_CAP_IE_CMDID,
  1003. WMI_PDEV_SET_DSCP_TID_MAP_CMDID,
  1004. WMI_PDEV_SET_QUIET_MODE_CMDID,
  1005. WMI_PDEV_GREEN_AP_PS_ENABLE_CMDID,
  1006. WMI_PDEV_GET_TPC_CONFIG_CMDID,
  1007. WMI_PDEV_SET_BASE_MACADDR_CMDID,
  1008. /* VDEV (virtual device) specific commands */
  1009. WMI_VDEV_CREATE_CMDID = WMI_CMD_GRP(WMI_GRP_VDEV),
  1010. WMI_VDEV_DELETE_CMDID,
  1011. WMI_VDEV_START_REQUEST_CMDID,
  1012. WMI_VDEV_RESTART_REQUEST_CMDID,
  1013. WMI_VDEV_UP_CMDID,
  1014. WMI_VDEV_STOP_CMDID,
  1015. WMI_VDEV_DOWN_CMDID,
  1016. WMI_VDEV_SET_PARAM_CMDID,
  1017. WMI_VDEV_INSTALL_KEY_CMDID,
  1018. /* peer specific commands */
  1019. WMI_PEER_CREATE_CMDID = WMI_CMD_GRP(WMI_GRP_PEER),
  1020. WMI_PEER_DELETE_CMDID,
  1021. WMI_PEER_FLUSH_TIDS_CMDID,
  1022. WMI_PEER_SET_PARAM_CMDID,
  1023. WMI_PEER_ASSOC_CMDID,
  1024. WMI_PEER_ADD_WDS_ENTRY_CMDID,
  1025. WMI_PEER_REMOVE_WDS_ENTRY_CMDID,
  1026. WMI_PEER_MCAST_GROUP_CMDID,
  1027. /* beacon/management specific commands */
  1028. WMI_BCN_TX_CMDID = WMI_CMD_GRP(WMI_GRP_MGMT),
  1029. WMI_PDEV_SEND_BCN_CMDID,
  1030. WMI_BCN_TMPL_CMDID,
  1031. WMI_BCN_FILTER_RX_CMDID,
  1032. WMI_PRB_REQ_FILTER_RX_CMDID,
  1033. WMI_MGMT_TX_CMDID,
  1034. WMI_PRB_TMPL_CMDID,
  1035. /* commands to directly control BA negotiation directly from host. */
  1036. WMI_ADDBA_CLEAR_RESP_CMDID = WMI_CMD_GRP(WMI_GRP_BA_NEG),
  1037. WMI_ADDBA_SEND_CMDID,
  1038. WMI_ADDBA_STATUS_CMDID,
  1039. WMI_DELBA_SEND_CMDID,
  1040. WMI_ADDBA_SET_RESP_CMDID,
  1041. WMI_SEND_SINGLEAMSDU_CMDID,
  1042. /* Station power save specific config */
  1043. WMI_STA_POWERSAVE_MODE_CMDID = WMI_CMD_GRP(WMI_GRP_STA_PS),
  1044. WMI_STA_POWERSAVE_PARAM_CMDID,
  1045. WMI_STA_MIMO_PS_MODE_CMDID,
  1046. /** DFS-specific commands */
  1047. WMI_PDEV_DFS_ENABLE_CMDID = WMI_CMD_GRP(WMI_GRP_DFS),
  1048. WMI_PDEV_DFS_DISABLE_CMDID,
  1049. /* Roaming specific commands */
  1050. WMI_ROAM_SCAN_MODE = WMI_CMD_GRP(WMI_GRP_ROAM),
  1051. WMI_ROAM_SCAN_RSSI_THRESHOLD,
  1052. WMI_ROAM_SCAN_PERIOD,
  1053. WMI_ROAM_SCAN_RSSI_CHANGE_THRESHOLD,
  1054. WMI_ROAM_AP_PROFILE,
  1055. /* offload scan specific commands */
  1056. WMI_OFL_SCAN_ADD_AP_PROFILE = WMI_CMD_GRP(WMI_GRP_OFL_SCAN),
  1057. WMI_OFL_SCAN_REMOVE_AP_PROFILE,
  1058. WMI_OFL_SCAN_PERIOD,
  1059. /* P2P specific commands */
  1060. WMI_P2P_DEV_SET_DEVICE_INFO = WMI_CMD_GRP(WMI_GRP_P2P),
  1061. WMI_P2P_DEV_SET_DISCOVERABILITY,
  1062. WMI_P2P_GO_SET_BEACON_IE,
  1063. WMI_P2P_GO_SET_PROBE_RESP_IE,
  1064. WMI_P2P_SET_VENDOR_IE_DATA_CMDID,
  1065. /* AP power save specific config */
  1066. WMI_AP_PS_PEER_PARAM_CMDID = WMI_CMD_GRP(WMI_GRP_AP_PS),
  1067. WMI_AP_PS_PEER_UAPSD_COEX_CMDID,
  1068. /* Rate-control specific commands */
  1069. WMI_PEER_RATE_RETRY_SCHED_CMDID =
  1070. WMI_CMD_GRP(WMI_GRP_RATE_CTRL),
  1071. /* WLAN Profiling commands. */
  1072. WMI_WLAN_PROFILE_TRIGGER_CMDID = WMI_CMD_GRP(WMI_GRP_PROFILE),
  1073. WMI_WLAN_PROFILE_SET_HIST_INTVL_CMDID,
  1074. WMI_WLAN_PROFILE_GET_PROFILE_DATA_CMDID,
  1075. WMI_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID,
  1076. WMI_WLAN_PROFILE_LIST_PROFILE_ID_CMDID,
  1077. /* Suspend resume command Ids */
  1078. WMI_PDEV_SUSPEND_CMDID = WMI_CMD_GRP(WMI_GRP_SUSPEND),
  1079. WMI_PDEV_RESUME_CMDID,
  1080. /* Beacon filter commands */
  1081. WMI_ADD_BCN_FILTER_CMDID = WMI_CMD_GRP(WMI_GRP_BCN_FILTER),
  1082. WMI_RMV_BCN_FILTER_CMDID,
  1083. /* WOW Specific WMI commands*/
  1084. WMI_WOW_ADD_WAKE_PATTERN_CMDID = WMI_CMD_GRP(WMI_GRP_WOW),
  1085. WMI_WOW_DEL_WAKE_PATTERN_CMDID,
  1086. WMI_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID,
  1087. WMI_WOW_ENABLE_CMDID,
  1088. WMI_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID,
  1089. /* RTT measurement related cmd */
  1090. WMI_RTT_MEASREQ_CMDID = WMI_CMD_GRP(WMI_GRP_RTT),
  1091. WMI_RTT_TSF_CMDID,
  1092. /* spectral scan commands */
  1093. WMI_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID = WMI_CMD_GRP(WMI_GRP_SPECTRAL),
  1094. WMI_VDEV_SPECTRAL_SCAN_ENABLE_CMDID,
  1095. /* F/W stats */
  1096. WMI_REQUEST_STATS_CMDID = WMI_CMD_GRP(WMI_GRP_STATS),
  1097. /* ARP OFFLOAD REQUEST*/
  1098. WMI_SET_ARP_NS_OFFLOAD_CMDID = WMI_CMD_GRP(WMI_GRP_ARP_NS_OFL),
  1099. /* NS offload confid*/
  1100. WMI_NETWORK_LIST_OFFLOAD_CONFIG_CMDID = WMI_CMD_GRP(WMI_GRP_NLO_OFL),
  1101. /* GTK offload Specific WMI commands*/
  1102. WMI_GTK_OFFLOAD_CMDID = WMI_CMD_GRP(WMI_GRP_GTK_OFL),
  1103. /* CSA offload Specific WMI commands*/
  1104. WMI_CSA_OFFLOAD_ENABLE_CMDID = WMI_CMD_GRP(WMI_GRP_CSA_OFL),
  1105. WMI_CSA_OFFLOAD_CHANSWITCH_CMDID,
  1106. /* Chatter commands*/
  1107. WMI_CHATTER_SET_MODE_CMDID = WMI_CMD_GRP(WMI_GRP_CHATTER),
  1108. /* addba specific commands */
  1109. WMI_PEER_TID_ADDBA_CMDID = WMI_CMD_GRP(WMI_GRP_TID_ADDBA),
  1110. WMI_PEER_TID_DELBA_CMDID,
  1111. /* set station mimo powersave method */
  1112. WMI_STA_DTIM_PS_METHOD_CMDID,
  1113. /* Configure the Station UAPSD AC Auto Trigger Parameters */
  1114. WMI_STA_UAPSD_AUTO_TRIG_CMDID,
  1115. /* STA Keep alive parameter configuration,
  1116. * Requires WMI_SERVICE_STA_KEEP_ALIVE
  1117. */
  1118. WMI_STA_KEEPALIVE_CMD,
  1119. /* misc command group */
  1120. WMI_ECHO_CMDID = WMI_CMD_GRP(WMI_GRP_MISC),
  1121. WMI_PDEV_UTF_CMDID,
  1122. WMI_DBGLOG_CFG_CMDID,
  1123. WMI_PDEV_QVIT_CMDID,
  1124. WMI_PDEV_FTM_INTG_CMDID,
  1125. WMI_VDEV_SET_KEEPALIVE_CMDID,
  1126. WMI_VDEV_GET_KEEPALIVE_CMDID,
  1127. WMI_FORCE_FW_HANG_CMDID,
  1128. /* GPIO Configuration */
  1129. WMI_GPIO_CONFIG_CMDID = WMI_CMD_GRP(WMI_GRP_GPIO),
  1130. WMI_GPIO_OUTPUT_CMDID,
  1131. };
  1132. enum wmi_event_id {
  1133. WMI_SERVICE_READY_EVENTID = 0x1,
  1134. WMI_READY_EVENTID,
  1135. WMI_SERVICE_AVAILABLE_EVENTID,
  1136. /* Scan specific events */
  1137. WMI_SCAN_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_SCAN),
  1138. /* PDEV specific events */
  1139. WMI_PDEV_TPC_CONFIG_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_PDEV),
  1140. WMI_CHAN_INFO_EVENTID,
  1141. WMI_PHYERR_EVENTID,
  1142. /* VDEV specific events */
  1143. WMI_VDEV_START_RESP_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_VDEV),
  1144. WMI_VDEV_STOPPED_EVENTID,
  1145. WMI_VDEV_INSTALL_KEY_COMPLETE_EVENTID,
  1146. /* peer specific events */
  1147. WMI_PEER_STA_KICKOUT_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_PEER),
  1148. /* beacon/mgmt specific events */
  1149. WMI_MGMT_RX_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_MGMT),
  1150. WMI_HOST_SWBA_EVENTID,
  1151. WMI_TBTTOFFSET_UPDATE_EVENTID,
  1152. /* ADDBA Related WMI Events*/
  1153. WMI_TX_DELBA_COMPLETE_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_BA_NEG),
  1154. WMI_TX_ADDBA_COMPLETE_EVENTID,
  1155. /* Roam event to trigger roaming on host */
  1156. WMI_ROAM_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_ROAM),
  1157. WMI_PROFILE_MATCH,
  1158. /* WoW */
  1159. WMI_WOW_WAKEUP_HOST_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_WOW),
  1160. /* RTT */
  1161. WMI_RTT_MEASUREMENT_REPORT_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_RTT),
  1162. WMI_TSF_MEASUREMENT_REPORT_EVENTID,
  1163. WMI_RTT_ERROR_REPORT_EVENTID,
  1164. /* GTK offload */
  1165. WMI_GTK_OFFLOAD_STATUS_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_GTK_OFL),
  1166. WMI_GTK_REKEY_FAIL_EVENTID,
  1167. /* CSA IE received event */
  1168. WMI_CSA_HANDLING_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_CSA_OFL),
  1169. /* Misc events */
  1170. WMI_ECHO_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_MISC),
  1171. WMI_PDEV_UTF_EVENTID,
  1172. WMI_DEBUG_MESG_EVENTID,
  1173. WMI_UPDATE_STATS_EVENTID,
  1174. WMI_DEBUG_PRINT_EVENTID,
  1175. WMI_DCS_INTERFERENCE_EVENTID,
  1176. WMI_PDEV_QVIT_EVENTID,
  1177. WMI_WLAN_PROFILE_DATA_EVENTID,
  1178. WMI_PDEV_FTM_INTG_EVENTID,
  1179. WMI_WLAN_FREQ_AVOID_EVENTID,
  1180. WMI_VDEV_GET_KEEPALIVE_EVENTID,
  1181. /* GPIO Event */
  1182. WMI_GPIO_INPUT_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_GPIO),
  1183. };
  1184. /* Command IDs and command events for 10.X firmware */
  1185. enum wmi_10x_cmd_id {
  1186. WMI_10X_START_CMDID = 0x9000,
  1187. WMI_10X_END_CMDID = 0x9FFF,
  1188. /* initialize the wlan sub system */
  1189. WMI_10X_INIT_CMDID,
  1190. /* Scan specific commands */
  1191. WMI_10X_START_SCAN_CMDID = WMI_10X_START_CMDID,
  1192. WMI_10X_STOP_SCAN_CMDID,
  1193. WMI_10X_SCAN_CHAN_LIST_CMDID,
  1194. WMI_10X_ECHO_CMDID,
  1195. /* PDEV(physical device) specific commands */
  1196. WMI_10X_PDEV_SET_REGDOMAIN_CMDID,
  1197. WMI_10X_PDEV_SET_CHANNEL_CMDID,
  1198. WMI_10X_PDEV_SET_PARAM_CMDID,
  1199. WMI_10X_PDEV_PKTLOG_ENABLE_CMDID,
  1200. WMI_10X_PDEV_PKTLOG_DISABLE_CMDID,
  1201. WMI_10X_PDEV_SET_WMM_PARAMS_CMDID,
  1202. WMI_10X_PDEV_SET_HT_CAP_IE_CMDID,
  1203. WMI_10X_PDEV_SET_VHT_CAP_IE_CMDID,
  1204. WMI_10X_PDEV_SET_BASE_MACADDR_CMDID,
  1205. WMI_10X_PDEV_SET_DSCP_TID_MAP_CMDID,
  1206. WMI_10X_PDEV_SET_QUIET_MODE_CMDID,
  1207. WMI_10X_PDEV_GREEN_AP_PS_ENABLE_CMDID,
  1208. WMI_10X_PDEV_GET_TPC_CONFIG_CMDID,
  1209. /* VDEV(virtual device) specific commands */
  1210. WMI_10X_VDEV_CREATE_CMDID,
  1211. WMI_10X_VDEV_DELETE_CMDID,
  1212. WMI_10X_VDEV_START_REQUEST_CMDID,
  1213. WMI_10X_VDEV_RESTART_REQUEST_CMDID,
  1214. WMI_10X_VDEV_UP_CMDID,
  1215. WMI_10X_VDEV_STOP_CMDID,
  1216. WMI_10X_VDEV_DOWN_CMDID,
  1217. WMI_10X_VDEV_STANDBY_RESPONSE_CMDID,
  1218. WMI_10X_VDEV_RESUME_RESPONSE_CMDID,
  1219. WMI_10X_VDEV_SET_PARAM_CMDID,
  1220. WMI_10X_VDEV_INSTALL_KEY_CMDID,
  1221. /* peer specific commands */
  1222. WMI_10X_PEER_CREATE_CMDID,
  1223. WMI_10X_PEER_DELETE_CMDID,
  1224. WMI_10X_PEER_FLUSH_TIDS_CMDID,
  1225. WMI_10X_PEER_SET_PARAM_CMDID,
  1226. WMI_10X_PEER_ASSOC_CMDID,
  1227. WMI_10X_PEER_ADD_WDS_ENTRY_CMDID,
  1228. WMI_10X_PEER_REMOVE_WDS_ENTRY_CMDID,
  1229. WMI_10X_PEER_MCAST_GROUP_CMDID,
  1230. /* beacon/management specific commands */
  1231. WMI_10X_BCN_TX_CMDID,
  1232. WMI_10X_BCN_PRB_TMPL_CMDID,
  1233. WMI_10X_BCN_FILTER_RX_CMDID,
  1234. WMI_10X_PRB_REQ_FILTER_RX_CMDID,
  1235. WMI_10X_MGMT_TX_CMDID,
  1236. /* commands to directly control ba negotiation directly from host. */
  1237. WMI_10X_ADDBA_CLEAR_RESP_CMDID,
  1238. WMI_10X_ADDBA_SEND_CMDID,
  1239. WMI_10X_ADDBA_STATUS_CMDID,
  1240. WMI_10X_DELBA_SEND_CMDID,
  1241. WMI_10X_ADDBA_SET_RESP_CMDID,
  1242. WMI_10X_SEND_SINGLEAMSDU_CMDID,
  1243. /* Station power save specific config */
  1244. WMI_10X_STA_POWERSAVE_MODE_CMDID,
  1245. WMI_10X_STA_POWERSAVE_PARAM_CMDID,
  1246. WMI_10X_STA_MIMO_PS_MODE_CMDID,
  1247. /* set debug log config */
  1248. WMI_10X_DBGLOG_CFG_CMDID,
  1249. /* DFS-specific commands */
  1250. WMI_10X_PDEV_DFS_ENABLE_CMDID,
  1251. WMI_10X_PDEV_DFS_DISABLE_CMDID,
  1252. /* QVIT specific command id */
  1253. WMI_10X_PDEV_QVIT_CMDID,
  1254. /* Offload Scan and Roaming related commands */
  1255. WMI_10X_ROAM_SCAN_MODE,
  1256. WMI_10X_ROAM_SCAN_RSSI_THRESHOLD,
  1257. WMI_10X_ROAM_SCAN_PERIOD,
  1258. WMI_10X_ROAM_SCAN_RSSI_CHANGE_THRESHOLD,
  1259. WMI_10X_ROAM_AP_PROFILE,
  1260. WMI_10X_OFL_SCAN_ADD_AP_PROFILE,
  1261. WMI_10X_OFL_SCAN_REMOVE_AP_PROFILE,
  1262. WMI_10X_OFL_SCAN_PERIOD,
  1263. /* P2P specific commands */
  1264. WMI_10X_P2P_DEV_SET_DEVICE_INFO,
  1265. WMI_10X_P2P_DEV_SET_DISCOVERABILITY,
  1266. WMI_10X_P2P_GO_SET_BEACON_IE,
  1267. WMI_10X_P2P_GO_SET_PROBE_RESP_IE,
  1268. /* AP power save specific config */
  1269. WMI_10X_AP_PS_PEER_PARAM_CMDID,
  1270. WMI_10X_AP_PS_PEER_UAPSD_COEX_CMDID,
  1271. /* Rate-control specific commands */
  1272. WMI_10X_PEER_RATE_RETRY_SCHED_CMDID,
  1273. /* WLAN Profiling commands. */
  1274. WMI_10X_WLAN_PROFILE_TRIGGER_CMDID,
  1275. WMI_10X_WLAN_PROFILE_SET_HIST_INTVL_CMDID,
  1276. WMI_10X_WLAN_PROFILE_GET_PROFILE_DATA_CMDID,
  1277. WMI_10X_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID,
  1278. WMI_10X_WLAN_PROFILE_LIST_PROFILE_ID_CMDID,
  1279. /* Suspend resume command Ids */
  1280. WMI_10X_PDEV_SUSPEND_CMDID,
  1281. WMI_10X_PDEV_RESUME_CMDID,
  1282. /* Beacon filter commands */
  1283. WMI_10X_ADD_BCN_FILTER_CMDID,
  1284. WMI_10X_RMV_BCN_FILTER_CMDID,
  1285. /* WOW Specific WMI commands*/
  1286. WMI_10X_WOW_ADD_WAKE_PATTERN_CMDID,
  1287. WMI_10X_WOW_DEL_WAKE_PATTERN_CMDID,
  1288. WMI_10X_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID,
  1289. WMI_10X_WOW_ENABLE_CMDID,
  1290. WMI_10X_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID,
  1291. /* RTT measurement related cmd */
  1292. WMI_10X_RTT_MEASREQ_CMDID,
  1293. WMI_10X_RTT_TSF_CMDID,
  1294. /* transmit beacon by value */
  1295. WMI_10X_PDEV_SEND_BCN_CMDID,
  1296. /* F/W stats */
  1297. WMI_10X_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID,
  1298. WMI_10X_VDEV_SPECTRAL_SCAN_ENABLE_CMDID,
  1299. WMI_10X_REQUEST_STATS_CMDID,
  1300. /* GPIO Configuration */
  1301. WMI_10X_GPIO_CONFIG_CMDID,
  1302. WMI_10X_GPIO_OUTPUT_CMDID,
  1303. WMI_10X_PDEV_UTF_CMDID = WMI_10X_END_CMDID - 1,
  1304. };
  1305. enum wmi_10x_event_id {
  1306. WMI_10X_SERVICE_READY_EVENTID = 0x8000,
  1307. WMI_10X_READY_EVENTID,
  1308. WMI_10X_START_EVENTID = 0x9000,
  1309. WMI_10X_END_EVENTID = 0x9FFF,
  1310. /* Scan specific events */
  1311. WMI_10X_SCAN_EVENTID = WMI_10X_START_EVENTID,
  1312. WMI_10X_ECHO_EVENTID,
  1313. WMI_10X_DEBUG_MESG_EVENTID,
  1314. WMI_10X_UPDATE_STATS_EVENTID,
  1315. /* Instantaneous RSSI event */
  1316. WMI_10X_INST_RSSI_STATS_EVENTID,
  1317. /* VDEV specific events */
  1318. WMI_10X_VDEV_START_RESP_EVENTID,
  1319. WMI_10X_VDEV_STANDBY_REQ_EVENTID,
  1320. WMI_10X_VDEV_RESUME_REQ_EVENTID,
  1321. WMI_10X_VDEV_STOPPED_EVENTID,
  1322. /* peer specific events */
  1323. WMI_10X_PEER_STA_KICKOUT_EVENTID,
  1324. /* beacon/mgmt specific events */
  1325. WMI_10X_HOST_SWBA_EVENTID,
  1326. WMI_10X_TBTTOFFSET_UPDATE_EVENTID,
  1327. WMI_10X_MGMT_RX_EVENTID,
  1328. /* Channel stats event */
  1329. WMI_10X_CHAN_INFO_EVENTID,
  1330. /* PHY Error specific WMI event */
  1331. WMI_10X_PHYERR_EVENTID,
  1332. /* Roam event to trigger roaming on host */
  1333. WMI_10X_ROAM_EVENTID,
  1334. /* matching AP found from list of profiles */
  1335. WMI_10X_PROFILE_MATCH,
  1336. /* debug print message used for tracing FW code while debugging */
  1337. WMI_10X_DEBUG_PRINT_EVENTID,
  1338. /* VI spoecific event */
  1339. WMI_10X_PDEV_QVIT_EVENTID,
  1340. /* FW code profile data in response to profile request */
  1341. WMI_10X_WLAN_PROFILE_DATA_EVENTID,
  1342. /*RTT related event ID*/
  1343. WMI_10X_RTT_MEASUREMENT_REPORT_EVENTID,
  1344. WMI_10X_TSF_MEASUREMENT_REPORT_EVENTID,
  1345. WMI_10X_RTT_ERROR_REPORT_EVENTID,
  1346. WMI_10X_WOW_WAKEUP_HOST_EVENTID,
  1347. WMI_10X_DCS_INTERFERENCE_EVENTID,
  1348. /* TPC config for the current operating channel */
  1349. WMI_10X_PDEV_TPC_CONFIG_EVENTID,
  1350. WMI_10X_GPIO_INPUT_EVENTID,
  1351. WMI_10X_PDEV_UTF_EVENTID = WMI_10X_END_EVENTID - 1,
  1352. };
  1353. enum wmi_10_2_cmd_id {
  1354. WMI_10_2_START_CMDID = 0x9000,
  1355. WMI_10_2_END_CMDID = 0x9FFF,
  1356. WMI_10_2_INIT_CMDID,
  1357. WMI_10_2_START_SCAN_CMDID = WMI_10_2_START_CMDID,
  1358. WMI_10_2_STOP_SCAN_CMDID,
  1359. WMI_10_2_SCAN_CHAN_LIST_CMDID,
  1360. WMI_10_2_ECHO_CMDID,
  1361. WMI_10_2_PDEV_SET_REGDOMAIN_CMDID,
  1362. WMI_10_2_PDEV_SET_CHANNEL_CMDID,
  1363. WMI_10_2_PDEV_SET_PARAM_CMDID,
  1364. WMI_10_2_PDEV_PKTLOG_ENABLE_CMDID,
  1365. WMI_10_2_PDEV_PKTLOG_DISABLE_CMDID,
  1366. WMI_10_2_PDEV_SET_WMM_PARAMS_CMDID,
  1367. WMI_10_2_PDEV_SET_HT_CAP_IE_CMDID,
  1368. WMI_10_2_PDEV_SET_VHT_CAP_IE_CMDID,
  1369. WMI_10_2_PDEV_SET_BASE_MACADDR_CMDID,
  1370. WMI_10_2_PDEV_SET_QUIET_MODE_CMDID,
  1371. WMI_10_2_PDEV_GREEN_AP_PS_ENABLE_CMDID,
  1372. WMI_10_2_PDEV_GET_TPC_CONFIG_CMDID,
  1373. WMI_10_2_VDEV_CREATE_CMDID,
  1374. WMI_10_2_VDEV_DELETE_CMDID,
  1375. WMI_10_2_VDEV_START_REQUEST_CMDID,
  1376. WMI_10_2_VDEV_RESTART_REQUEST_CMDID,
  1377. WMI_10_2_VDEV_UP_CMDID,
  1378. WMI_10_2_VDEV_STOP_CMDID,
  1379. WMI_10_2_VDEV_DOWN_CMDID,
  1380. WMI_10_2_VDEV_STANDBY_RESPONSE_CMDID,
  1381. WMI_10_2_VDEV_RESUME_RESPONSE_CMDID,
  1382. WMI_10_2_VDEV_SET_PARAM_CMDID,
  1383. WMI_10_2_VDEV_INSTALL_KEY_CMDID,
  1384. WMI_10_2_VDEV_SET_DSCP_TID_MAP_CMDID,
  1385. WMI_10_2_PEER_CREATE_CMDID,
  1386. WMI_10_2_PEER_DELETE_CMDID,
  1387. WMI_10_2_PEER_FLUSH_TIDS_CMDID,
  1388. WMI_10_2_PEER_SET_PARAM_CMDID,
  1389. WMI_10_2_PEER_ASSOC_CMDID,
  1390. WMI_10_2_PEER_ADD_WDS_ENTRY_CMDID,
  1391. WMI_10_2_PEER_UPDATE_WDS_ENTRY_CMDID,
  1392. WMI_10_2_PEER_REMOVE_WDS_ENTRY_CMDID,
  1393. WMI_10_2_PEER_MCAST_GROUP_CMDID,
  1394. WMI_10_2_BCN_TX_CMDID,
  1395. WMI_10_2_BCN_PRB_TMPL_CMDID,
  1396. WMI_10_2_BCN_FILTER_RX_CMDID,
  1397. WMI_10_2_PRB_REQ_FILTER_RX_CMDID,
  1398. WMI_10_2_MGMT_TX_CMDID,
  1399. WMI_10_2_ADDBA_CLEAR_RESP_CMDID,
  1400. WMI_10_2_ADDBA_SEND_CMDID,
  1401. WMI_10_2_ADDBA_STATUS_CMDID,
  1402. WMI_10_2_DELBA_SEND_CMDID,
  1403. WMI_10_2_ADDBA_SET_RESP_CMDID,
  1404. WMI_10_2_SEND_SINGLEAMSDU_CMDID,
  1405. WMI_10_2_STA_POWERSAVE_MODE_CMDID,
  1406. WMI_10_2_STA_POWERSAVE_PARAM_CMDID,
  1407. WMI_10_2_STA_MIMO_PS_MODE_CMDID,
  1408. WMI_10_2_DBGLOG_CFG_CMDID,
  1409. WMI_10_2_PDEV_DFS_ENABLE_CMDID,
  1410. WMI_10_2_PDEV_DFS_DISABLE_CMDID,
  1411. WMI_10_2_PDEV_QVIT_CMDID,
  1412. WMI_10_2_ROAM_SCAN_MODE,
  1413. WMI_10_2_ROAM_SCAN_RSSI_THRESHOLD,
  1414. WMI_10_2_ROAM_SCAN_PERIOD,
  1415. WMI_10_2_ROAM_SCAN_RSSI_CHANGE_THRESHOLD,
  1416. WMI_10_2_ROAM_AP_PROFILE,
  1417. WMI_10_2_OFL_SCAN_ADD_AP_PROFILE,
  1418. WMI_10_2_OFL_SCAN_REMOVE_AP_PROFILE,
  1419. WMI_10_2_OFL_SCAN_PERIOD,
  1420. WMI_10_2_P2P_DEV_SET_DEVICE_INFO,
  1421. WMI_10_2_P2P_DEV_SET_DISCOVERABILITY,
  1422. WMI_10_2_P2P_GO_SET_BEACON_IE,
  1423. WMI_10_2_P2P_GO_SET_PROBE_RESP_IE,
  1424. WMI_10_2_AP_PS_PEER_PARAM_CMDID,
  1425. WMI_10_2_AP_PS_PEER_UAPSD_COEX_CMDID,
  1426. WMI_10_2_PEER_RATE_RETRY_SCHED_CMDID,
  1427. WMI_10_2_WLAN_PROFILE_TRIGGER_CMDID,
  1428. WMI_10_2_WLAN_PROFILE_SET_HIST_INTVL_CMDID,
  1429. WMI_10_2_WLAN_PROFILE_GET_PROFILE_DATA_CMDID,
  1430. WMI_10_2_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID,
  1431. WMI_10_2_WLAN_PROFILE_LIST_PROFILE_ID_CMDID,
  1432. WMI_10_2_PDEV_SUSPEND_CMDID,
  1433. WMI_10_2_PDEV_RESUME_CMDID,
  1434. WMI_10_2_ADD_BCN_FILTER_CMDID,
  1435. WMI_10_2_RMV_BCN_FILTER_CMDID,
  1436. WMI_10_2_WOW_ADD_WAKE_PATTERN_CMDID,
  1437. WMI_10_2_WOW_DEL_WAKE_PATTERN_CMDID,
  1438. WMI_10_2_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID,
  1439. WMI_10_2_WOW_ENABLE_CMDID,
  1440. WMI_10_2_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID,
  1441. WMI_10_2_RTT_MEASREQ_CMDID,
  1442. WMI_10_2_RTT_TSF_CMDID,
  1443. WMI_10_2_RTT_KEEPALIVE_CMDID,
  1444. WMI_10_2_PDEV_SEND_BCN_CMDID,
  1445. WMI_10_2_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID,
  1446. WMI_10_2_VDEV_SPECTRAL_SCAN_ENABLE_CMDID,
  1447. WMI_10_2_REQUEST_STATS_CMDID,
  1448. WMI_10_2_GPIO_CONFIG_CMDID,
  1449. WMI_10_2_GPIO_OUTPUT_CMDID,
  1450. WMI_10_2_VDEV_RATEMASK_CMDID,
  1451. WMI_10_2_PDEV_SMART_ANT_ENABLE_CMDID,
  1452. WMI_10_2_PDEV_SMART_ANT_SET_RX_ANTENNA_CMDID,
  1453. WMI_10_2_PEER_SMART_ANT_SET_TX_ANTENNA_CMDID,
  1454. WMI_10_2_PEER_SMART_ANT_SET_TRAIN_INFO_CMDID,
  1455. WMI_10_2_PEER_SMART_ANT_SET_NODE_CONFIG_OPS_CMDID,
  1456. WMI_10_2_FORCE_FW_HANG_CMDID,
  1457. WMI_10_2_PDEV_SET_ANTENNA_SWITCH_TABLE_CMDID,
  1458. WMI_10_2_PDEV_SET_CTL_TABLE_CMDID,
  1459. WMI_10_2_PDEV_SET_MIMOGAIN_TABLE_CMDID,
  1460. WMI_10_2_PDEV_RATEPWR_TABLE_CMDID,
  1461. WMI_10_2_PDEV_RATEPWR_CHAINMSK_TABLE_CMDID,
  1462. WMI_10_2_PDEV_GET_INFO,
  1463. WMI_10_2_VDEV_GET_INFO,
  1464. WMI_10_2_VDEV_ATF_REQUEST_CMDID,
  1465. WMI_10_2_PEER_ATF_REQUEST_CMDID,
  1466. WMI_10_2_PDEV_GET_TEMPERATURE_CMDID,
  1467. WMI_10_2_MU_CAL_START_CMDID,
  1468. WMI_10_2_SET_LTEU_CONFIG_CMDID,
  1469. WMI_10_2_SET_CCA_PARAMS,
  1470. WMI_10_2_PDEV_BSS_CHAN_INFO_REQUEST_CMDID,
  1471. WMI_10_2_PDEV_UTF_CMDID = WMI_10_2_END_CMDID - 1,
  1472. };
  1473. enum wmi_10_2_event_id {
  1474. WMI_10_2_SERVICE_READY_EVENTID = 0x8000,
  1475. WMI_10_2_READY_EVENTID,
  1476. WMI_10_2_DEBUG_MESG_EVENTID,
  1477. WMI_10_2_START_EVENTID = 0x9000,
  1478. WMI_10_2_END_EVENTID = 0x9FFF,
  1479. WMI_10_2_SCAN_EVENTID = WMI_10_2_START_EVENTID,
  1480. WMI_10_2_ECHO_EVENTID,
  1481. WMI_10_2_UPDATE_STATS_EVENTID,
  1482. WMI_10_2_INST_RSSI_STATS_EVENTID,
  1483. WMI_10_2_VDEV_START_RESP_EVENTID,
  1484. WMI_10_2_VDEV_STANDBY_REQ_EVENTID,
  1485. WMI_10_2_VDEV_RESUME_REQ_EVENTID,
  1486. WMI_10_2_VDEV_STOPPED_EVENTID,
  1487. WMI_10_2_PEER_STA_KICKOUT_EVENTID,
  1488. WMI_10_2_HOST_SWBA_EVENTID,
  1489. WMI_10_2_TBTTOFFSET_UPDATE_EVENTID,
  1490. WMI_10_2_MGMT_RX_EVENTID,
  1491. WMI_10_2_CHAN_INFO_EVENTID,
  1492. WMI_10_2_PHYERR_EVENTID,
  1493. WMI_10_2_ROAM_EVENTID,
  1494. WMI_10_2_PROFILE_MATCH,
  1495. WMI_10_2_DEBUG_PRINT_EVENTID,
  1496. WMI_10_2_PDEV_QVIT_EVENTID,
  1497. WMI_10_2_WLAN_PROFILE_DATA_EVENTID,
  1498. WMI_10_2_RTT_MEASUREMENT_REPORT_EVENTID,
  1499. WMI_10_2_TSF_MEASUREMENT_REPORT_EVENTID,
  1500. WMI_10_2_RTT_ERROR_REPORT_EVENTID,
  1501. WMI_10_2_RTT_KEEPALIVE_EVENTID,
  1502. WMI_10_2_WOW_WAKEUP_HOST_EVENTID,
  1503. WMI_10_2_DCS_INTERFERENCE_EVENTID,
  1504. WMI_10_2_PDEV_TPC_CONFIG_EVENTID,
  1505. WMI_10_2_GPIO_INPUT_EVENTID,
  1506. WMI_10_2_PEER_RATECODE_LIST_EVENTID,
  1507. WMI_10_2_GENERIC_BUFFER_EVENTID,
  1508. WMI_10_2_MCAST_BUF_RELEASE_EVENTID,
  1509. WMI_10_2_MCAST_LIST_AGEOUT_EVENTID,
  1510. WMI_10_2_WDS_PEER_EVENTID,
  1511. WMI_10_2_PEER_STA_PS_STATECHG_EVENTID,
  1512. WMI_10_2_PDEV_TEMPERATURE_EVENTID,
  1513. WMI_10_2_MU_REPORT_EVENTID,
  1514. WMI_10_2_PDEV_BSS_CHAN_INFO_EVENTID,
  1515. WMI_10_2_PDEV_UTF_EVENTID = WMI_10_2_END_EVENTID - 1,
  1516. };
  1517. enum wmi_10_4_cmd_id {
  1518. WMI_10_4_START_CMDID = 0x9000,
  1519. WMI_10_4_END_CMDID = 0x9FFF,
  1520. WMI_10_4_INIT_CMDID,
  1521. WMI_10_4_START_SCAN_CMDID = WMI_10_4_START_CMDID,
  1522. WMI_10_4_STOP_SCAN_CMDID,
  1523. WMI_10_4_SCAN_CHAN_LIST_CMDID,
  1524. WMI_10_4_SCAN_SCH_PRIO_TBL_CMDID,
  1525. WMI_10_4_SCAN_UPDATE_REQUEST_CMDID,
  1526. WMI_10_4_ECHO_CMDID,
  1527. WMI_10_4_PDEV_SET_REGDOMAIN_CMDID,
  1528. WMI_10_4_PDEV_SET_CHANNEL_CMDID,
  1529. WMI_10_4_PDEV_SET_PARAM_CMDID,
  1530. WMI_10_4_PDEV_PKTLOG_ENABLE_CMDID,
  1531. WMI_10_4_PDEV_PKTLOG_DISABLE_CMDID,
  1532. WMI_10_4_PDEV_SET_WMM_PARAMS_CMDID,
  1533. WMI_10_4_PDEV_SET_HT_CAP_IE_CMDID,
  1534. WMI_10_4_PDEV_SET_VHT_CAP_IE_CMDID,
  1535. WMI_10_4_PDEV_SET_BASE_MACADDR_CMDID,
  1536. WMI_10_4_PDEV_SET_DSCP_TID_MAP_CMDID,
  1537. WMI_10_4_PDEV_SET_QUIET_MODE_CMDID,
  1538. WMI_10_4_PDEV_GREEN_AP_PS_ENABLE_CMDID,
  1539. WMI_10_4_PDEV_GET_TPC_CONFIG_CMDID,
  1540. WMI_10_4_VDEV_CREATE_CMDID,
  1541. WMI_10_4_VDEV_DELETE_CMDID,
  1542. WMI_10_4_VDEV_START_REQUEST_CMDID,
  1543. WMI_10_4_VDEV_RESTART_REQUEST_CMDID,
  1544. WMI_10_4_VDEV_UP_CMDID,
  1545. WMI_10_4_VDEV_STOP_CMDID,
  1546. WMI_10_4_VDEV_DOWN_CMDID,
  1547. WMI_10_4_VDEV_STANDBY_RESPONSE_CMDID,
  1548. WMI_10_4_VDEV_RESUME_RESPONSE_CMDID,
  1549. WMI_10_4_VDEV_SET_PARAM_CMDID,
  1550. WMI_10_4_VDEV_INSTALL_KEY_CMDID,
  1551. WMI_10_4_WLAN_PEER_CACHING_ADD_PEER_CMDID,
  1552. WMI_10_4_WLAN_PEER_CACHING_EVICT_PEER_CMDID,
  1553. WMI_10_4_WLAN_PEER_CACHING_RESTORE_PEER_CMDID,
  1554. WMI_10_4_WLAN_PEER_CACHING_PRINT_ALL_PEERS_INFO_CMDID,
  1555. WMI_10_4_PEER_CREATE_CMDID,
  1556. WMI_10_4_PEER_DELETE_CMDID,
  1557. WMI_10_4_PEER_FLUSH_TIDS_CMDID,
  1558. WMI_10_4_PEER_SET_PARAM_CMDID,
  1559. WMI_10_4_PEER_ASSOC_CMDID,
  1560. WMI_10_4_PEER_ADD_WDS_ENTRY_CMDID,
  1561. WMI_10_4_PEER_UPDATE_WDS_ENTRY_CMDID,
  1562. WMI_10_4_PEER_REMOVE_WDS_ENTRY_CMDID,
  1563. WMI_10_4_PEER_ADD_PROXY_STA_ENTRY_CMDID,
  1564. WMI_10_4_PEER_MCAST_GROUP_CMDID,
  1565. WMI_10_4_BCN_TX_CMDID,
  1566. WMI_10_4_PDEV_SEND_BCN_CMDID,
  1567. WMI_10_4_BCN_PRB_TMPL_CMDID,
  1568. WMI_10_4_BCN_FILTER_RX_CMDID,
  1569. WMI_10_4_PRB_REQ_FILTER_RX_CMDID,
  1570. WMI_10_4_MGMT_TX_CMDID,
  1571. WMI_10_4_PRB_TMPL_CMDID,
  1572. WMI_10_4_ADDBA_CLEAR_RESP_CMDID,
  1573. WMI_10_4_ADDBA_SEND_CMDID,
  1574. WMI_10_4_ADDBA_STATUS_CMDID,
  1575. WMI_10_4_DELBA_SEND_CMDID,
  1576. WMI_10_4_ADDBA_SET_RESP_CMDID,
  1577. WMI_10_4_SEND_SINGLEAMSDU_CMDID,
  1578. WMI_10_4_STA_POWERSAVE_MODE_CMDID,
  1579. WMI_10_4_STA_POWERSAVE_PARAM_CMDID,
  1580. WMI_10_4_STA_MIMO_PS_MODE_CMDID,
  1581. WMI_10_4_DBGLOG_CFG_CMDID,
  1582. WMI_10_4_PDEV_DFS_ENABLE_CMDID,
  1583. WMI_10_4_PDEV_DFS_DISABLE_CMDID,
  1584. WMI_10_4_PDEV_QVIT_CMDID,
  1585. WMI_10_4_ROAM_SCAN_MODE,
  1586. WMI_10_4_ROAM_SCAN_RSSI_THRESHOLD,
  1587. WMI_10_4_ROAM_SCAN_PERIOD,
  1588. WMI_10_4_ROAM_SCAN_RSSI_CHANGE_THRESHOLD,
  1589. WMI_10_4_ROAM_AP_PROFILE,
  1590. WMI_10_4_OFL_SCAN_ADD_AP_PROFILE,
  1591. WMI_10_4_OFL_SCAN_REMOVE_AP_PROFILE,
  1592. WMI_10_4_OFL_SCAN_PERIOD,
  1593. WMI_10_4_P2P_DEV_SET_DEVICE_INFO,
  1594. WMI_10_4_P2P_DEV_SET_DISCOVERABILITY,
  1595. WMI_10_4_P2P_GO_SET_BEACON_IE,
  1596. WMI_10_4_P2P_GO_SET_PROBE_RESP_IE,
  1597. WMI_10_4_P2P_SET_VENDOR_IE_DATA_CMDID,
  1598. WMI_10_4_AP_PS_PEER_PARAM_CMDID,
  1599. WMI_10_4_AP_PS_PEER_UAPSD_COEX_CMDID,
  1600. WMI_10_4_PEER_RATE_RETRY_SCHED_CMDID,
  1601. WMI_10_4_WLAN_PROFILE_TRIGGER_CMDID,
  1602. WMI_10_4_WLAN_PROFILE_SET_HIST_INTVL_CMDID,
  1603. WMI_10_4_WLAN_PROFILE_GET_PROFILE_DATA_CMDID,
  1604. WMI_10_4_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID,
  1605. WMI_10_4_WLAN_PROFILE_LIST_PROFILE_ID_CMDID,
  1606. WMI_10_4_PDEV_SUSPEND_CMDID,
  1607. WMI_10_4_PDEV_RESUME_CMDID,
  1608. WMI_10_4_ADD_BCN_FILTER_CMDID,
  1609. WMI_10_4_RMV_BCN_FILTER_CMDID,
  1610. WMI_10_4_WOW_ADD_WAKE_PATTERN_CMDID,
  1611. WMI_10_4_WOW_DEL_WAKE_PATTERN_CMDID,
  1612. WMI_10_4_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID,
  1613. WMI_10_4_WOW_ENABLE_CMDID,
  1614. WMI_10_4_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID,
  1615. WMI_10_4_RTT_MEASREQ_CMDID,
  1616. WMI_10_4_RTT_TSF_CMDID,
  1617. WMI_10_4_RTT_KEEPALIVE_CMDID,
  1618. WMI_10_4_OEM_REQ_CMDID,
  1619. WMI_10_4_NAN_CMDID,
  1620. WMI_10_4_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID,
  1621. WMI_10_4_VDEV_SPECTRAL_SCAN_ENABLE_CMDID,
  1622. WMI_10_4_REQUEST_STATS_CMDID,
  1623. WMI_10_4_GPIO_CONFIG_CMDID,
  1624. WMI_10_4_GPIO_OUTPUT_CMDID,
  1625. WMI_10_4_VDEV_RATEMASK_CMDID,
  1626. WMI_10_4_CSA_OFFLOAD_ENABLE_CMDID,
  1627. WMI_10_4_GTK_OFFLOAD_CMDID,
  1628. WMI_10_4_QBOOST_CFG_CMDID,
  1629. WMI_10_4_CSA_OFFLOAD_CHANSWITCH_CMDID,
  1630. WMI_10_4_PDEV_SMART_ANT_ENABLE_CMDID,
  1631. WMI_10_4_PDEV_SMART_ANT_SET_RX_ANTENNA_CMDID,
  1632. WMI_10_4_PEER_SMART_ANT_SET_TX_ANTENNA_CMDID,
  1633. WMI_10_4_PEER_SMART_ANT_SET_TRAIN_INFO_CMDID,
  1634. WMI_10_4_PEER_SMART_ANT_SET_NODE_CONFIG_OPS_CMDID,
  1635. WMI_10_4_VDEV_SET_KEEPALIVE_CMDID,
  1636. WMI_10_4_VDEV_GET_KEEPALIVE_CMDID,
  1637. WMI_10_4_FORCE_FW_HANG_CMDID,
  1638. WMI_10_4_PDEV_SET_ANTENNA_SWITCH_TABLE_CMDID,
  1639. WMI_10_4_PDEV_SET_CTL_TABLE_CMDID,
  1640. WMI_10_4_PDEV_SET_MIMOGAIN_TABLE_CMDID,
  1641. WMI_10_4_PDEV_RATEPWR_TABLE_CMDID,
  1642. WMI_10_4_PDEV_RATEPWR_CHAINMSK_TABLE_CMDID,
  1643. WMI_10_4_PDEV_FIPS_CMDID,
  1644. WMI_10_4_TT_SET_CONF_CMDID,
  1645. WMI_10_4_FWTEST_CMDID,
  1646. WMI_10_4_VDEV_ATF_REQUEST_CMDID,
  1647. WMI_10_4_PEER_ATF_REQUEST_CMDID,
  1648. WMI_10_4_PDEV_GET_ANI_CCK_CONFIG_CMDID,
  1649. WMI_10_4_PDEV_GET_ANI_OFDM_CONFIG_CMDID,
  1650. WMI_10_4_PDEV_RESERVE_AST_ENTRY_CMDID,
  1651. WMI_10_4_PDEV_GET_NFCAL_POWER_CMDID,
  1652. WMI_10_4_PDEV_GET_TPC_CMDID,
  1653. WMI_10_4_PDEV_GET_AST_INFO_CMDID,
  1654. WMI_10_4_VDEV_SET_DSCP_TID_MAP_CMDID,
  1655. WMI_10_4_PDEV_GET_TEMPERATURE_CMDID,
  1656. WMI_10_4_PDEV_GET_INFO_CMDID,
  1657. WMI_10_4_VDEV_GET_INFO_CMDID,
  1658. WMI_10_4_VDEV_FILTER_NEIGHBOR_RX_PACKETS_CMDID,
  1659. WMI_10_4_MU_CAL_START_CMDID,
  1660. WMI_10_4_SET_CCA_PARAMS_CMDID,
  1661. WMI_10_4_PDEV_BSS_CHAN_INFO_REQUEST_CMDID,
  1662. WMI_10_4_EXT_RESOURCE_CFG_CMDID,
  1663. WMI_10_4_VDEV_SET_IE_CMDID,
  1664. WMI_10_4_SET_LTEU_CONFIG_CMDID,
  1665. WMI_10_4_ATF_SSID_GROUPING_REQUEST_CMDID,
  1666. WMI_10_4_PEER_ATF_EXT_REQUEST_CMDID,
  1667. WMI_10_4_SET_PERIODIC_CHANNEL_STATS_CONFIG,
  1668. WMI_10_4_PEER_BWF_REQUEST_CMDID,
  1669. WMI_10_4_BTCOEX_CFG_CMDID,
  1670. WMI_10_4_PEER_TX_MU_TXMIT_COUNT_CMDID,
  1671. WMI_10_4_PEER_TX_MU_TXMIT_RSTCNT_CMDID,
  1672. WMI_10_4_PEER_GID_USERPOS_LIST_CMDID,
  1673. WMI_10_4_PDEV_CHECK_CAL_VERSION_CMDID,
  1674. WMI_10_4_COEX_VERSION_CFG_CMID,
  1675. WMI_10_4_PDEV_GET_RX_FILTER_CMDID,
  1676. WMI_10_4_PDEV_EXTENDED_NSS_CFG_CMDID,
  1677. WMI_10_4_VDEV_SET_SCAN_NAC_RSSI_CMDID,
  1678. WMI_10_4_PROG_GPIO_BAND_SELECT_CMDID,
  1679. WMI_10_4_CONFIG_SMART_LOGGING_CMDID,
  1680. WMI_10_4_DEBUG_FATAL_CONDITION_CMDID,
  1681. WMI_10_4_GET_TSF_TIMER_CMDID,
  1682. WMI_10_4_PDEV_GET_TPC_TABLE_CMDID,
  1683. WMI_10_4_VDEV_SIFS_TRIGGER_TIME_CMDID,
  1684. WMI_10_4_PDEV_WDS_ENTRY_LIST_CMDID,
  1685. WMI_10_4_TDLS_SET_STATE_CMDID,
  1686. WMI_10_4_TDLS_PEER_UPDATE_CMDID,
  1687. WMI_10_4_TDLS_SET_OFFCHAN_MODE_CMDID,
  1688. WMI_10_4_PDEV_SEND_FD_CMDID,
  1689. WMI_10_4_ENABLE_FILS_CMDID,
  1690. WMI_10_4_PDEV_SET_BRIDGE_MACADDR_CMDID,
  1691. WMI_10_4_ATF_GROUP_WMM_AC_CONFIG_REQUEST_CMDID,
  1692. WMI_10_4_RADAR_FOUND_CMDID,
  1693. WMI_10_4_PDEV_UTF_CMDID = WMI_10_4_END_CMDID - 1,
  1694. };
  1695. enum wmi_10_4_event_id {
  1696. WMI_10_4_SERVICE_READY_EVENTID = 0x8000,
  1697. WMI_10_4_READY_EVENTID,
  1698. WMI_10_4_DEBUG_MESG_EVENTID,
  1699. WMI_10_4_START_EVENTID = 0x9000,
  1700. WMI_10_4_END_EVENTID = 0x9FFF,
  1701. WMI_10_4_SCAN_EVENTID = WMI_10_4_START_EVENTID,
  1702. WMI_10_4_ECHO_EVENTID,
  1703. WMI_10_4_UPDATE_STATS_EVENTID,
  1704. WMI_10_4_INST_RSSI_STATS_EVENTID,
  1705. WMI_10_4_VDEV_START_RESP_EVENTID,
  1706. WMI_10_4_VDEV_STANDBY_REQ_EVENTID,
  1707. WMI_10_4_VDEV_RESUME_REQ_EVENTID,
  1708. WMI_10_4_VDEV_STOPPED_EVENTID,
  1709. WMI_10_4_PEER_STA_KICKOUT_EVENTID,
  1710. WMI_10_4_HOST_SWBA_EVENTID,
  1711. WMI_10_4_TBTTOFFSET_UPDATE_EVENTID,
  1712. WMI_10_4_MGMT_RX_EVENTID,
  1713. WMI_10_4_CHAN_INFO_EVENTID,
  1714. WMI_10_4_PHYERR_EVENTID,
  1715. WMI_10_4_ROAM_EVENTID,
  1716. WMI_10_4_PROFILE_MATCH,
  1717. WMI_10_4_DEBUG_PRINT_EVENTID,
  1718. WMI_10_4_PDEV_QVIT_EVENTID,
  1719. WMI_10_4_WLAN_PROFILE_DATA_EVENTID,
  1720. WMI_10_4_RTT_MEASUREMENT_REPORT_EVENTID,
  1721. WMI_10_4_TSF_MEASUREMENT_REPORT_EVENTID,
  1722. WMI_10_4_RTT_ERROR_REPORT_EVENTID,
  1723. WMI_10_4_RTT_KEEPALIVE_EVENTID,
  1724. WMI_10_4_OEM_CAPABILITY_EVENTID,
  1725. WMI_10_4_OEM_MEASUREMENT_REPORT_EVENTID,
  1726. WMI_10_4_OEM_ERROR_REPORT_EVENTID,
  1727. WMI_10_4_NAN_EVENTID,
  1728. WMI_10_4_WOW_WAKEUP_HOST_EVENTID,
  1729. WMI_10_4_GTK_OFFLOAD_STATUS_EVENTID,
  1730. WMI_10_4_GTK_REKEY_FAIL_EVENTID,
  1731. WMI_10_4_DCS_INTERFERENCE_EVENTID,
  1732. WMI_10_4_PDEV_TPC_CONFIG_EVENTID,
  1733. WMI_10_4_CSA_HANDLING_EVENTID,
  1734. WMI_10_4_GPIO_INPUT_EVENTID,
  1735. WMI_10_4_PEER_RATECODE_LIST_EVENTID,
  1736. WMI_10_4_GENERIC_BUFFER_EVENTID,
  1737. WMI_10_4_MCAST_BUF_RELEASE_EVENTID,
  1738. WMI_10_4_MCAST_LIST_AGEOUT_EVENTID,
  1739. WMI_10_4_VDEV_GET_KEEPALIVE_EVENTID,
  1740. WMI_10_4_WDS_PEER_EVENTID,
  1741. WMI_10_4_PEER_STA_PS_STATECHG_EVENTID,
  1742. WMI_10_4_PDEV_FIPS_EVENTID,
  1743. WMI_10_4_TT_STATS_EVENTID,
  1744. WMI_10_4_PDEV_CHANNEL_HOPPING_EVENTID,
  1745. WMI_10_4_PDEV_ANI_CCK_LEVEL_EVENTID,
  1746. WMI_10_4_PDEV_ANI_OFDM_LEVEL_EVENTID,
  1747. WMI_10_4_PDEV_RESERVE_AST_ENTRY_EVENTID,
  1748. WMI_10_4_PDEV_NFCAL_POWER_EVENTID,
  1749. WMI_10_4_PDEV_TPC_EVENTID,
  1750. WMI_10_4_PDEV_GET_AST_INFO_EVENTID,
  1751. WMI_10_4_PDEV_TEMPERATURE_EVENTID,
  1752. WMI_10_4_PDEV_NFCAL_POWER_ALL_CHANNELS_EVENTID,
  1753. WMI_10_4_PDEV_BSS_CHAN_INFO_EVENTID,
  1754. WMI_10_4_MU_REPORT_EVENTID,
  1755. WMI_10_4_TX_DATA_TRAFFIC_CTRL_EVENTID,
  1756. WMI_10_4_PEER_TX_MU_TXMIT_COUNT_EVENTID,
  1757. WMI_10_4_PEER_GID_USERPOS_LIST_EVENTID,
  1758. WMI_10_4_PDEV_CHECK_CAL_VERSION_EVENTID,
  1759. WMI_10_4_ATF_PEER_STATS_EVENTID,
  1760. WMI_10_4_PDEV_GET_RX_FILTER_EVENTID,
  1761. WMI_10_4_NAC_RSSI_EVENTID,
  1762. WMI_10_4_DEBUG_FATAL_CONDITION_EVENTID,
  1763. WMI_10_4_GET_TSF_TIMER_RESP_EVENTID,
  1764. WMI_10_4_PDEV_TPC_TABLE_EVENTID,
  1765. WMI_10_4_PDEV_WDS_ENTRY_LIST_EVENTID,
  1766. WMI_10_4_TDLS_PEER_EVENTID,
  1767. WMI_10_4_HOST_SWFDA_EVENTID,
  1768. WMI_10_4_ESP_ESTIMATE_EVENTID,
  1769. WMI_10_4_DFS_STATUS_CHECK_EVENTID,
  1770. WMI_10_4_PDEV_UTF_EVENTID = WMI_10_4_END_EVENTID - 1,
  1771. };
  1772. enum wmi_phy_mode {
  1773. MODE_11A = 0, /* 11a Mode */
  1774. MODE_11G = 1, /* 11b/g Mode */
  1775. MODE_11B = 2, /* 11b Mode */
  1776. MODE_11GONLY = 3, /* 11g only Mode */
  1777. MODE_11NA_HT20 = 4, /* 11a HT20 mode */
  1778. MODE_11NG_HT20 = 5, /* 11g HT20 mode */
  1779. MODE_11NA_HT40 = 6, /* 11a HT40 mode */
  1780. MODE_11NG_HT40 = 7, /* 11g HT40 mode */
  1781. MODE_11AC_VHT20 = 8,
  1782. MODE_11AC_VHT40 = 9,
  1783. MODE_11AC_VHT80 = 10,
  1784. /* MODE_11AC_VHT160 = 11, */
  1785. MODE_11AC_VHT20_2G = 11,
  1786. MODE_11AC_VHT40_2G = 12,
  1787. MODE_11AC_VHT80_2G = 13,
  1788. MODE_11AC_VHT80_80 = 14,
  1789. MODE_11AC_VHT160 = 15,
  1790. MODE_UNKNOWN = 16,
  1791. MODE_MAX = 16
  1792. };
  1793. static inline const char *ath10k_wmi_phymode_str(enum wmi_phy_mode mode)
  1794. {
  1795. switch (mode) {
  1796. case MODE_11A:
  1797. return "11a";
  1798. case MODE_11G:
  1799. return "11g";
  1800. case MODE_11B:
  1801. return "11b";
  1802. case MODE_11GONLY:
  1803. return "11gonly";
  1804. case MODE_11NA_HT20:
  1805. return "11na-ht20";
  1806. case MODE_11NG_HT20:
  1807. return "11ng-ht20";
  1808. case MODE_11NA_HT40:
  1809. return "11na-ht40";
  1810. case MODE_11NG_HT40:
  1811. return "11ng-ht40";
  1812. case MODE_11AC_VHT20:
  1813. return "11ac-vht20";
  1814. case MODE_11AC_VHT40:
  1815. return "11ac-vht40";
  1816. case MODE_11AC_VHT80:
  1817. return "11ac-vht80";
  1818. case MODE_11AC_VHT160:
  1819. return "11ac-vht160";
  1820. case MODE_11AC_VHT80_80:
  1821. return "11ac-vht80+80";
  1822. case MODE_11AC_VHT20_2G:
  1823. return "11ac-vht20-2g";
  1824. case MODE_11AC_VHT40_2G:
  1825. return "11ac-vht40-2g";
  1826. case MODE_11AC_VHT80_2G:
  1827. return "11ac-vht80-2g";
  1828. case MODE_UNKNOWN:
  1829. /* skip */
  1830. break;
  1831. /* no default handler to allow compiler to check that the
  1832. * enum is fully handled
  1833. */
  1834. };
  1835. return "<unknown>";
  1836. }
  1837. #define WMI_CHAN_LIST_TAG 0x1
  1838. #define WMI_SSID_LIST_TAG 0x2
  1839. #define WMI_BSSID_LIST_TAG 0x3
  1840. #define WMI_IE_TAG 0x4
  1841. struct wmi_channel {
  1842. __le32 mhz;
  1843. __le32 band_center_freq1;
  1844. __le32 band_center_freq2; /* valid for 11ac, 80plus80 */
  1845. union {
  1846. __le32 flags; /* WMI_CHAN_FLAG_ */
  1847. struct {
  1848. u8 mode; /* only 6 LSBs */
  1849. } __packed;
  1850. } __packed;
  1851. union {
  1852. __le32 reginfo0;
  1853. struct {
  1854. /* note: power unit is 0.5 dBm */
  1855. u8 min_power;
  1856. u8 max_power;
  1857. u8 reg_power;
  1858. u8 reg_classid;
  1859. } __packed;
  1860. } __packed;
  1861. union {
  1862. __le32 reginfo1;
  1863. struct {
  1864. u8 antenna_max;
  1865. u8 max_tx_power;
  1866. } __packed;
  1867. } __packed;
  1868. } __packed;
  1869. struct wmi_channel_arg {
  1870. u32 freq;
  1871. u32 band_center_freq1;
  1872. u32 band_center_freq2;
  1873. bool passive;
  1874. bool allow_ibss;
  1875. bool allow_ht;
  1876. bool allow_vht;
  1877. bool ht40plus;
  1878. bool chan_radar;
  1879. /* note: power unit is 0.5 dBm */
  1880. u32 min_power;
  1881. u32 max_power;
  1882. u32 max_reg_power;
  1883. u32 max_antenna_gain;
  1884. u32 reg_class_id;
  1885. enum wmi_phy_mode mode;
  1886. };
  1887. enum wmi_channel_change_cause {
  1888. WMI_CHANNEL_CHANGE_CAUSE_NONE = 0,
  1889. WMI_CHANNEL_CHANGE_CAUSE_CSA,
  1890. };
  1891. #define WMI_CHAN_FLAG_HT40_PLUS (1 << 6)
  1892. #define WMI_CHAN_FLAG_PASSIVE (1 << 7)
  1893. #define WMI_CHAN_FLAG_ADHOC_ALLOWED (1 << 8)
  1894. #define WMI_CHAN_FLAG_AP_DISABLED (1 << 9)
  1895. #define WMI_CHAN_FLAG_DFS (1 << 10)
  1896. #define WMI_CHAN_FLAG_ALLOW_HT (1 << 11)
  1897. #define WMI_CHAN_FLAG_ALLOW_VHT (1 << 12)
  1898. /* Indicate reason for channel switch */
  1899. #define WMI_CHANNEL_CHANGE_CAUSE_CSA (1 << 13)
  1900. #define WMI_MAX_SPATIAL_STREAM 3 /* default max ss */
  1901. /* HT Capabilities*/
  1902. #define WMI_HT_CAP_ENABLED 0x0001 /* HT Enabled/ disabled */
  1903. #define WMI_HT_CAP_HT20_SGI 0x0002 /* Short Guard Interval with HT20 */
  1904. #define WMI_HT_CAP_DYNAMIC_SMPS 0x0004 /* Dynamic MIMO powersave */
  1905. #define WMI_HT_CAP_TX_STBC 0x0008 /* B3 TX STBC */
  1906. #define WMI_HT_CAP_TX_STBC_MASK_SHIFT 3
  1907. #define WMI_HT_CAP_RX_STBC 0x0030 /* B4-B5 RX STBC */
  1908. #define WMI_HT_CAP_RX_STBC_MASK_SHIFT 4
  1909. #define WMI_HT_CAP_LDPC 0x0040 /* LDPC supported */
  1910. #define WMI_HT_CAP_L_SIG_TXOP_PROT 0x0080 /* L-SIG TXOP Protection */
  1911. #define WMI_HT_CAP_MPDU_DENSITY 0x0700 /* MPDU Density */
  1912. #define WMI_HT_CAP_MPDU_DENSITY_MASK_SHIFT 8
  1913. #define WMI_HT_CAP_HT40_SGI 0x0800
  1914. #define WMI_HT_CAP_DEFAULT_ALL (WMI_HT_CAP_ENABLED | \
  1915. WMI_HT_CAP_HT20_SGI | \
  1916. WMI_HT_CAP_HT40_SGI | \
  1917. WMI_HT_CAP_TX_STBC | \
  1918. WMI_HT_CAP_RX_STBC | \
  1919. WMI_HT_CAP_LDPC)
  1920. /*
  1921. * WMI_VHT_CAP_* these maps to ieee 802.11ac vht capability information
  1922. * field. The fields not defined here are not supported, or reserved.
  1923. * Do not change these masks and if you have to add new one follow the
  1924. * bitmask as specified by 802.11ac draft.
  1925. */
  1926. #define WMI_VHT_CAP_MAX_MPDU_LEN_MASK 0x00000003
  1927. #define WMI_VHT_CAP_RX_LDPC 0x00000010
  1928. #define WMI_VHT_CAP_SGI_80MHZ 0x00000020
  1929. #define WMI_VHT_CAP_SGI_160MHZ 0x00000040
  1930. #define WMI_VHT_CAP_TX_STBC 0x00000080
  1931. #define WMI_VHT_CAP_RX_STBC_MASK 0x00000300
  1932. #define WMI_VHT_CAP_RX_STBC_MASK_SHIFT 8
  1933. #define WMI_VHT_CAP_SU_BFER 0x00000800
  1934. #define WMI_VHT_CAP_SU_BFEE 0x00001000
  1935. #define WMI_VHT_CAP_MAX_CS_ANT_MASK 0x0000E000
  1936. #define WMI_VHT_CAP_MAX_CS_ANT_MASK_SHIFT 13
  1937. #define WMI_VHT_CAP_MAX_SND_DIM_MASK 0x00070000
  1938. #define WMI_VHT_CAP_MAX_SND_DIM_MASK_SHIFT 16
  1939. #define WMI_VHT_CAP_MU_BFER 0x00080000
  1940. #define WMI_VHT_CAP_MU_BFEE 0x00100000
  1941. #define WMI_VHT_CAP_MAX_AMPDU_LEN_EXP 0x03800000
  1942. #define WMI_VHT_CAP_MAX_AMPDU_LEN_EXP_SHIFT 23
  1943. #define WMI_VHT_CAP_RX_FIXED_ANT 0x10000000
  1944. #define WMI_VHT_CAP_TX_FIXED_ANT 0x20000000
  1945. /* The following also refer for max HT AMSDU */
  1946. #define WMI_VHT_CAP_MAX_MPDU_LEN_3839 0x00000000
  1947. #define WMI_VHT_CAP_MAX_MPDU_LEN_7935 0x00000001
  1948. #define WMI_VHT_CAP_MAX_MPDU_LEN_11454 0x00000002
  1949. #define WMI_VHT_CAP_DEFAULT_ALL (WMI_VHT_CAP_MAX_MPDU_LEN_11454 | \
  1950. WMI_VHT_CAP_RX_LDPC | \
  1951. WMI_VHT_CAP_SGI_80MHZ | \
  1952. WMI_VHT_CAP_TX_STBC | \
  1953. WMI_VHT_CAP_RX_STBC_MASK | \
  1954. WMI_VHT_CAP_MAX_AMPDU_LEN_EXP | \
  1955. WMI_VHT_CAP_RX_FIXED_ANT | \
  1956. WMI_VHT_CAP_TX_FIXED_ANT)
  1957. /*
  1958. * Interested readers refer to Rx/Tx MCS Map definition as defined in
  1959. * 802.11ac
  1960. */
  1961. #define WMI_VHT_MAX_MCS_4_SS_MASK(r, ss) ((3 & (r)) << (((ss) - 1) << 1))
  1962. #define WMI_VHT_MAX_SUPP_RATE_MASK 0x1fff0000
  1963. #define WMI_VHT_MAX_SUPP_RATE_MASK_SHIFT 16
  1964. enum {
  1965. REGDMN_MODE_11A = 0x00001, /* 11a channels */
  1966. REGDMN_MODE_TURBO = 0x00002, /* 11a turbo-only channels */
  1967. REGDMN_MODE_11B = 0x00004, /* 11b channels */
  1968. REGDMN_MODE_PUREG = 0x00008, /* 11g channels (OFDM only) */
  1969. REGDMN_MODE_11G = 0x00008, /* XXX historical */
  1970. REGDMN_MODE_108G = 0x00020, /* 11a+Turbo channels */
  1971. REGDMN_MODE_108A = 0x00040, /* 11g+Turbo channels */
  1972. REGDMN_MODE_XR = 0x00100, /* XR channels */
  1973. REGDMN_MODE_11A_HALF_RATE = 0x00200, /* 11A half rate channels */
  1974. REGDMN_MODE_11A_QUARTER_RATE = 0x00400, /* 11A quarter rate channels */
  1975. REGDMN_MODE_11NG_HT20 = 0x00800, /* 11N-G HT20 channels */
  1976. REGDMN_MODE_11NA_HT20 = 0x01000, /* 11N-A HT20 channels */
  1977. REGDMN_MODE_11NG_HT40PLUS = 0x02000, /* 11N-G HT40 + channels */
  1978. REGDMN_MODE_11NG_HT40MINUS = 0x04000, /* 11N-G HT40 - channels */
  1979. REGDMN_MODE_11NA_HT40PLUS = 0x08000, /* 11N-A HT40 + channels */
  1980. REGDMN_MODE_11NA_HT40MINUS = 0x10000, /* 11N-A HT40 - channels */
  1981. REGDMN_MODE_11AC_VHT20 = 0x20000, /* 5Ghz, VHT20 */
  1982. REGDMN_MODE_11AC_VHT40PLUS = 0x40000, /* 5Ghz, VHT40 + channels */
  1983. REGDMN_MODE_11AC_VHT40MINUS = 0x80000, /* 5Ghz VHT40 - channels */
  1984. REGDMN_MODE_11AC_VHT80 = 0x100000, /* 5Ghz, VHT80 channels */
  1985. REGDMN_MODE_11AC_VHT160 = 0x200000, /* 5Ghz, VHT160 channels */
  1986. REGDMN_MODE_11AC_VHT80_80 = 0x400000, /* 5Ghz, VHT80+80 channels */
  1987. REGDMN_MODE_ALL = 0xffffffff
  1988. };
  1989. #define REGDMN_CAP1_CHAN_HALF_RATE 0x00000001
  1990. #define REGDMN_CAP1_CHAN_QUARTER_RATE 0x00000002
  1991. #define REGDMN_CAP1_CHAN_HAL49GHZ 0x00000004
  1992. /* regulatory capabilities */
  1993. #define REGDMN_EEPROM_EEREGCAP_EN_FCC_MIDBAND 0x0040
  1994. #define REGDMN_EEPROM_EEREGCAP_EN_KK_U1_EVEN 0x0080
  1995. #define REGDMN_EEPROM_EEREGCAP_EN_KK_U2 0x0100
  1996. #define REGDMN_EEPROM_EEREGCAP_EN_KK_MIDBAND 0x0200
  1997. #define REGDMN_EEPROM_EEREGCAP_EN_KK_U1_ODD 0x0400
  1998. #define REGDMN_EEPROM_EEREGCAP_EN_KK_NEW_11A 0x0800
  1999. struct hal_reg_capabilities {
  2000. /* regdomain value specified in EEPROM */
  2001. __le32 eeprom_rd;
  2002. /*regdomain */
  2003. __le32 eeprom_rd_ext;
  2004. /* CAP1 capabilities bit map. */
  2005. __le32 regcap1;
  2006. /* REGDMN EEPROM CAP. */
  2007. __le32 regcap2;
  2008. /* REGDMN MODE */
  2009. __le32 wireless_modes;
  2010. __le32 low_2ghz_chan;
  2011. __le32 high_2ghz_chan;
  2012. __le32 low_5ghz_chan;
  2013. __le32 high_5ghz_chan;
  2014. } __packed;
  2015. enum wlan_mode_capability {
  2016. WHAL_WLAN_11A_CAPABILITY = 0x1,
  2017. WHAL_WLAN_11G_CAPABILITY = 0x2,
  2018. WHAL_WLAN_11AG_CAPABILITY = 0x3,
  2019. };
  2020. /* structure used by FW for requesting host memory */
  2021. struct wlan_host_mem_req {
  2022. /* ID of the request */
  2023. __le32 req_id;
  2024. /* size of the of each unit */
  2025. __le32 unit_size;
  2026. /* flags to indicate that
  2027. * the number units is dependent
  2028. * on number of resources(num vdevs num peers .. etc)
  2029. */
  2030. __le32 num_unit_info;
  2031. /*
  2032. * actual number of units to allocate . if flags in the num_unit_info
  2033. * indicate that number of units is tied to number of a particular
  2034. * resource to allocate then num_units filed is set to 0 and host
  2035. * will derive the number units from number of the resources it is
  2036. * requesting.
  2037. */
  2038. __le32 num_units;
  2039. } __packed;
  2040. /*
  2041. * The following struct holds optional payload for
  2042. * wmi_service_ready_event,e.g., 11ac pass some of the
  2043. * device capability to the host.
  2044. */
  2045. struct wmi_service_ready_event {
  2046. __le32 sw_version;
  2047. __le32 sw_version_1;
  2048. __le32 abi_version;
  2049. /* WMI_PHY_CAPABILITY */
  2050. __le32 phy_capability;
  2051. /* Maximum number of frag table entries that SW will populate less 1 */
  2052. __le32 max_frag_entry;
  2053. __le32 wmi_service_bitmap[16];
  2054. __le32 num_rf_chains;
  2055. /*
  2056. * The following field is only valid for service type
  2057. * WMI_SERVICE_11AC
  2058. */
  2059. __le32 ht_cap_info; /* WMI HT Capability */
  2060. __le32 vht_cap_info; /* VHT capability info field of 802.11ac */
  2061. __le32 vht_supp_mcs; /* VHT Supported MCS Set field Rx/Tx same */
  2062. __le32 hw_min_tx_power;
  2063. __le32 hw_max_tx_power;
  2064. struct hal_reg_capabilities hal_reg_capabilities;
  2065. __le32 sys_cap_info;
  2066. __le32 min_pkt_size_enable; /* Enterprise mode short pkt enable */
  2067. /*
  2068. * Max beacon and Probe Response IE offload size
  2069. * (includes optional P2P IEs)
  2070. */
  2071. __le32 max_bcn_ie_size;
  2072. /*
  2073. * request to host to allocate a chuck of memory and pss it down to FW
  2074. * via WM_INIT. FW uses this as FW extesnsion memory for saving its
  2075. * data structures. Only valid for low latency interfaces like PCIE
  2076. * where FW can access this memory directly (or) by DMA.
  2077. */
  2078. __le32 num_mem_reqs;
  2079. struct wlan_host_mem_req mem_reqs[0];
  2080. } __packed;
  2081. /* This is the definition from 10.X firmware branch */
  2082. struct wmi_10x_service_ready_event {
  2083. __le32 sw_version;
  2084. __le32 abi_version;
  2085. /* WMI_PHY_CAPABILITY */
  2086. __le32 phy_capability;
  2087. /* Maximum number of frag table entries that SW will populate less 1 */
  2088. __le32 max_frag_entry;
  2089. __le32 wmi_service_bitmap[16];
  2090. __le32 num_rf_chains;
  2091. /*
  2092. * The following field is only valid for service type
  2093. * WMI_SERVICE_11AC
  2094. */
  2095. __le32 ht_cap_info; /* WMI HT Capability */
  2096. __le32 vht_cap_info; /* VHT capability info field of 802.11ac */
  2097. __le32 vht_supp_mcs; /* VHT Supported MCS Set field Rx/Tx same */
  2098. __le32 hw_min_tx_power;
  2099. __le32 hw_max_tx_power;
  2100. struct hal_reg_capabilities hal_reg_capabilities;
  2101. __le32 sys_cap_info;
  2102. __le32 min_pkt_size_enable; /* Enterprise mode short pkt enable */
  2103. /*
  2104. * request to host to allocate a chuck of memory and pss it down to FW
  2105. * via WM_INIT. FW uses this as FW extesnsion memory for saving its
  2106. * data structures. Only valid for low latency interfaces like PCIE
  2107. * where FW can access this memory directly (or) by DMA.
  2108. */
  2109. __le32 num_mem_reqs;
  2110. struct wlan_host_mem_req mem_reqs[0];
  2111. } __packed;
  2112. #define WMI_SERVICE_READY_TIMEOUT_HZ (5 * HZ)
  2113. #define WMI_UNIFIED_READY_TIMEOUT_HZ (5 * HZ)
  2114. struct wmi_ready_event {
  2115. __le32 sw_version;
  2116. __le32 abi_version;
  2117. struct wmi_mac_addr mac_addr;
  2118. __le32 status;
  2119. } __packed;
  2120. struct wmi_resource_config {
  2121. /* number of virtual devices (VAPs) to support */
  2122. __le32 num_vdevs;
  2123. /* number of peer nodes to support */
  2124. __le32 num_peers;
  2125. /*
  2126. * In offload mode target supports features like WOW, chatter and
  2127. * other protocol offloads. In order to support them some
  2128. * functionalities like reorder buffering, PN checking need to be
  2129. * done in target. This determines maximum number of peers supported
  2130. * by target in offload mode
  2131. */
  2132. __le32 num_offload_peers;
  2133. /* For target-based RX reordering */
  2134. __le32 num_offload_reorder_bufs;
  2135. /* number of keys per peer */
  2136. __le32 num_peer_keys;
  2137. /* total number of TX/RX data TIDs */
  2138. __le32 num_tids;
  2139. /*
  2140. * max skid for resolving hash collisions
  2141. *
  2142. * The address search table is sparse, so that if two MAC addresses
  2143. * result in the same hash value, the second of these conflicting
  2144. * entries can slide to the next index in the address search table,
  2145. * and use it, if it is unoccupied. This ast_skid_limit parameter
  2146. * specifies the upper bound on how many subsequent indices to search
  2147. * over to find an unoccupied space.
  2148. */
  2149. __le32 ast_skid_limit;
  2150. /*
  2151. * the nominal chain mask for transmit
  2152. *
  2153. * The chain mask may be modified dynamically, e.g. to operate AP
  2154. * tx with a reduced number of chains if no clients are associated.
  2155. * This configuration parameter specifies the nominal chain-mask that
  2156. * should be used when not operating with a reduced set of tx chains.
  2157. */
  2158. __le32 tx_chain_mask;
  2159. /*
  2160. * the nominal chain mask for receive
  2161. *
  2162. * The chain mask may be modified dynamically, e.g. for a client
  2163. * to use a reduced number of chains for receive if the traffic to
  2164. * the client is low enough that it doesn't require downlink MIMO
  2165. * or antenna diversity.
  2166. * This configuration parameter specifies the nominal chain-mask that
  2167. * should be used when not operating with a reduced set of rx chains.
  2168. */
  2169. __le32 rx_chain_mask;
  2170. /*
  2171. * what rx reorder timeout (ms) to use for the AC
  2172. *
  2173. * Each WMM access class (voice, video, best-effort, background) will
  2174. * have its own timeout value to dictate how long to wait for missing
  2175. * rx MPDUs to arrive before flushing subsequent MPDUs that have
  2176. * already been received.
  2177. * This parameter specifies the timeout in milliseconds for each
  2178. * class.
  2179. */
  2180. __le32 rx_timeout_pri_vi;
  2181. __le32 rx_timeout_pri_vo;
  2182. __le32 rx_timeout_pri_be;
  2183. __le32 rx_timeout_pri_bk;
  2184. /*
  2185. * what mode the rx should decap packets to
  2186. *
  2187. * MAC can decap to RAW (no decap), native wifi or Ethernet types
  2188. * THis setting also determines the default TX behavior, however TX
  2189. * behavior can be modified on a per VAP basis during VAP init
  2190. */
  2191. __le32 rx_decap_mode;
  2192. /* what is the maximum number of scan requests that can be queued */
  2193. __le32 scan_max_pending_reqs;
  2194. /* maximum VDEV that could use BMISS offload */
  2195. __le32 bmiss_offload_max_vdev;
  2196. /* maximum VDEV that could use offload roaming */
  2197. __le32 roam_offload_max_vdev;
  2198. /* maximum AP profiles that would push to offload roaming */
  2199. __le32 roam_offload_max_ap_profiles;
  2200. /*
  2201. * how many groups to use for mcast->ucast conversion
  2202. *
  2203. * The target's WAL maintains a table to hold information regarding
  2204. * which peers belong to a given multicast group, so that if
  2205. * multicast->unicast conversion is enabled, the target can convert
  2206. * multicast tx frames to a series of unicast tx frames, to each
  2207. * peer within the multicast group.
  2208. This num_mcast_groups configuration parameter tells the target how
  2209. * many multicast groups to provide storage for within its multicast
  2210. * group membership table.
  2211. */
  2212. __le32 num_mcast_groups;
  2213. /*
  2214. * size to alloc for the mcast membership table
  2215. *
  2216. * This num_mcast_table_elems configuration parameter tells the
  2217. * target how many peer elements it needs to provide storage for in
  2218. * its multicast group membership table.
  2219. * These multicast group membership table elements are shared by the
  2220. * multicast groups stored within the table.
  2221. */
  2222. __le32 num_mcast_table_elems;
  2223. /*
  2224. * whether/how to do multicast->unicast conversion
  2225. *
  2226. * This configuration parameter specifies whether the target should
  2227. * perform multicast --> unicast conversion on transmit, and if so,
  2228. * what to do if it finds no entries in its multicast group
  2229. * membership table for the multicast IP address in the tx frame.
  2230. * Configuration value:
  2231. * 0 -> Do not perform multicast to unicast conversion.
  2232. * 1 -> Convert multicast frames to unicast, if the IP multicast
  2233. * address from the tx frame is found in the multicast group
  2234. * membership table. If the IP multicast address is not found,
  2235. * drop the frame.
  2236. * 2 -> Convert multicast frames to unicast, if the IP multicast
  2237. * address from the tx frame is found in the multicast group
  2238. * membership table. If the IP multicast address is not found,
  2239. * transmit the frame as multicast.
  2240. */
  2241. __le32 mcast2ucast_mode;
  2242. /*
  2243. * how much memory to allocate for a tx PPDU dbg log
  2244. *
  2245. * This parameter controls how much memory the target will allocate
  2246. * to store a log of tx PPDU meta-information (how large the PPDU
  2247. * was, when it was sent, whether it was successful, etc.)
  2248. */
  2249. __le32 tx_dbg_log_size;
  2250. /* how many AST entries to be allocated for WDS */
  2251. __le32 num_wds_entries;
  2252. /*
  2253. * MAC DMA burst size, e.g., For target PCI limit can be
  2254. * 0 -default, 1 256B
  2255. */
  2256. __le32 dma_burst_size;
  2257. /*
  2258. * Fixed delimiters to be inserted after every MPDU to
  2259. * account for interface latency to avoid underrun.
  2260. */
  2261. __le32 mac_aggr_delim;
  2262. /*
  2263. * determine whether target is responsible for detecting duplicate
  2264. * non-aggregate MPDU and timing out stale fragments.
  2265. *
  2266. * A-MPDU reordering is always performed on the target.
  2267. *
  2268. * 0: target responsible for frag timeout and dup checking
  2269. * 1: host responsible for frag timeout and dup checking
  2270. */
  2271. __le32 rx_skip_defrag_timeout_dup_detection_check;
  2272. /*
  2273. * Configuration for VoW :
  2274. * No of Video Nodes to be supported
  2275. * and Max no of descriptors for each Video link (node).
  2276. */
  2277. __le32 vow_config;
  2278. /* maximum VDEV that could use GTK offload */
  2279. __le32 gtk_offload_max_vdev;
  2280. /* Number of msdu descriptors target should use */
  2281. __le32 num_msdu_desc;
  2282. /*
  2283. * Max. number of Tx fragments per MSDU
  2284. * This parameter controls the max number of Tx fragments per MSDU.
  2285. * This is sent by the target as part of the WMI_SERVICE_READY event
  2286. * and is overridden by the OS shim as required.
  2287. */
  2288. __le32 max_frag_entries;
  2289. } __packed;
  2290. struct wmi_resource_config_10x {
  2291. /* number of virtual devices (VAPs) to support */
  2292. __le32 num_vdevs;
  2293. /* number of peer nodes to support */
  2294. __le32 num_peers;
  2295. /* number of keys per peer */
  2296. __le32 num_peer_keys;
  2297. /* total number of TX/RX data TIDs */
  2298. __le32 num_tids;
  2299. /*
  2300. * max skid for resolving hash collisions
  2301. *
  2302. * The address search table is sparse, so that if two MAC addresses
  2303. * result in the same hash value, the second of these conflicting
  2304. * entries can slide to the next index in the address search table,
  2305. * and use it, if it is unoccupied. This ast_skid_limit parameter
  2306. * specifies the upper bound on how many subsequent indices to search
  2307. * over to find an unoccupied space.
  2308. */
  2309. __le32 ast_skid_limit;
  2310. /*
  2311. * the nominal chain mask for transmit
  2312. *
  2313. * The chain mask may be modified dynamically, e.g. to operate AP
  2314. * tx with a reduced number of chains if no clients are associated.
  2315. * This configuration parameter specifies the nominal chain-mask that
  2316. * should be used when not operating with a reduced set of tx chains.
  2317. */
  2318. __le32 tx_chain_mask;
  2319. /*
  2320. * the nominal chain mask for receive
  2321. *
  2322. * The chain mask may be modified dynamically, e.g. for a client
  2323. * to use a reduced number of chains for receive if the traffic to
  2324. * the client is low enough that it doesn't require downlink MIMO
  2325. * or antenna diversity.
  2326. * This configuration parameter specifies the nominal chain-mask that
  2327. * should be used when not operating with a reduced set of rx chains.
  2328. */
  2329. __le32 rx_chain_mask;
  2330. /*
  2331. * what rx reorder timeout (ms) to use for the AC
  2332. *
  2333. * Each WMM access class (voice, video, best-effort, background) will
  2334. * have its own timeout value to dictate how long to wait for missing
  2335. * rx MPDUs to arrive before flushing subsequent MPDUs that have
  2336. * already been received.
  2337. * This parameter specifies the timeout in milliseconds for each
  2338. * class.
  2339. */
  2340. __le32 rx_timeout_pri_vi;
  2341. __le32 rx_timeout_pri_vo;
  2342. __le32 rx_timeout_pri_be;
  2343. __le32 rx_timeout_pri_bk;
  2344. /*
  2345. * what mode the rx should decap packets to
  2346. *
  2347. * MAC can decap to RAW (no decap), native wifi or Ethernet types
  2348. * THis setting also determines the default TX behavior, however TX
  2349. * behavior can be modified on a per VAP basis during VAP init
  2350. */
  2351. __le32 rx_decap_mode;
  2352. /* what is the maximum number of scan requests that can be queued */
  2353. __le32 scan_max_pending_reqs;
  2354. /* maximum VDEV that could use BMISS offload */
  2355. __le32 bmiss_offload_max_vdev;
  2356. /* maximum VDEV that could use offload roaming */
  2357. __le32 roam_offload_max_vdev;
  2358. /* maximum AP profiles that would push to offload roaming */
  2359. __le32 roam_offload_max_ap_profiles;
  2360. /*
  2361. * how many groups to use for mcast->ucast conversion
  2362. *
  2363. * The target's WAL maintains a table to hold information regarding
  2364. * which peers belong to a given multicast group, so that if
  2365. * multicast->unicast conversion is enabled, the target can convert
  2366. * multicast tx frames to a series of unicast tx frames, to each
  2367. * peer within the multicast group.
  2368. This num_mcast_groups configuration parameter tells the target how
  2369. * many multicast groups to provide storage for within its multicast
  2370. * group membership table.
  2371. */
  2372. __le32 num_mcast_groups;
  2373. /*
  2374. * size to alloc for the mcast membership table
  2375. *
  2376. * This num_mcast_table_elems configuration parameter tells the
  2377. * target how many peer elements it needs to provide storage for in
  2378. * its multicast group membership table.
  2379. * These multicast group membership table elements are shared by the
  2380. * multicast groups stored within the table.
  2381. */
  2382. __le32 num_mcast_table_elems;
  2383. /*
  2384. * whether/how to do multicast->unicast conversion
  2385. *
  2386. * This configuration parameter specifies whether the target should
  2387. * perform multicast --> unicast conversion on transmit, and if so,
  2388. * what to do if it finds no entries in its multicast group
  2389. * membership table for the multicast IP address in the tx frame.
  2390. * Configuration value:
  2391. * 0 -> Do not perform multicast to unicast conversion.
  2392. * 1 -> Convert multicast frames to unicast, if the IP multicast
  2393. * address from the tx frame is found in the multicast group
  2394. * membership table. If the IP multicast address is not found,
  2395. * drop the frame.
  2396. * 2 -> Convert multicast frames to unicast, if the IP multicast
  2397. * address from the tx frame is found in the multicast group
  2398. * membership table. If the IP multicast address is not found,
  2399. * transmit the frame as multicast.
  2400. */
  2401. __le32 mcast2ucast_mode;
  2402. /*
  2403. * how much memory to allocate for a tx PPDU dbg log
  2404. *
  2405. * This parameter controls how much memory the target will allocate
  2406. * to store a log of tx PPDU meta-information (how large the PPDU
  2407. * was, when it was sent, whether it was successful, etc.)
  2408. */
  2409. __le32 tx_dbg_log_size;
  2410. /* how many AST entries to be allocated for WDS */
  2411. __le32 num_wds_entries;
  2412. /*
  2413. * MAC DMA burst size, e.g., For target PCI limit can be
  2414. * 0 -default, 1 256B
  2415. */
  2416. __le32 dma_burst_size;
  2417. /*
  2418. * Fixed delimiters to be inserted after every MPDU to
  2419. * account for interface latency to avoid underrun.
  2420. */
  2421. __le32 mac_aggr_delim;
  2422. /*
  2423. * determine whether target is responsible for detecting duplicate
  2424. * non-aggregate MPDU and timing out stale fragments.
  2425. *
  2426. * A-MPDU reordering is always performed on the target.
  2427. *
  2428. * 0: target responsible for frag timeout and dup checking
  2429. * 1: host responsible for frag timeout and dup checking
  2430. */
  2431. __le32 rx_skip_defrag_timeout_dup_detection_check;
  2432. /*
  2433. * Configuration for VoW :
  2434. * No of Video Nodes to be supported
  2435. * and Max no of descriptors for each Video link (node).
  2436. */
  2437. __le32 vow_config;
  2438. /* Number of msdu descriptors target should use */
  2439. __le32 num_msdu_desc;
  2440. /*
  2441. * Max. number of Tx fragments per MSDU
  2442. * This parameter controls the max number of Tx fragments per MSDU.
  2443. * This is sent by the target as part of the WMI_SERVICE_READY event
  2444. * and is overridden by the OS shim as required.
  2445. */
  2446. __le32 max_frag_entries;
  2447. } __packed;
  2448. enum wmi_10_2_feature_mask {
  2449. WMI_10_2_RX_BATCH_MODE = BIT(0),
  2450. WMI_10_2_ATF_CONFIG = BIT(1),
  2451. WMI_10_2_COEX_GPIO = BIT(3),
  2452. WMI_10_2_BSS_CHAN_INFO = BIT(6),
  2453. WMI_10_2_PEER_STATS = BIT(7),
  2454. };
  2455. struct wmi_resource_config_10_2 {
  2456. struct wmi_resource_config_10x common;
  2457. __le32 max_peer_ext_stats;
  2458. __le32 smart_ant_cap; /* 0-disable, 1-enable */
  2459. __le32 bk_min_free;
  2460. __le32 be_min_free;
  2461. __le32 vi_min_free;
  2462. __le32 vo_min_free;
  2463. __le32 feature_mask;
  2464. } __packed;
  2465. #define NUM_UNITS_IS_NUM_VDEVS BIT(0)
  2466. #define NUM_UNITS_IS_NUM_PEERS BIT(1)
  2467. #define NUM_UNITS_IS_NUM_ACTIVE_PEERS BIT(2)
  2468. struct wmi_resource_config_10_4 {
  2469. /* Number of virtual devices (VAPs) to support */
  2470. __le32 num_vdevs;
  2471. /* Number of peer nodes to support */
  2472. __le32 num_peers;
  2473. /* Number of active peer nodes to support */
  2474. __le32 num_active_peers;
  2475. /* In offload mode, target supports features like WOW, chatter and other
  2476. * protocol offloads. In order to support them some functionalities like
  2477. * reorder buffering, PN checking need to be done in target.
  2478. * This determines maximum number of peers supported by target in
  2479. * offload mode.
  2480. */
  2481. __le32 num_offload_peers;
  2482. /* Number of reorder buffers available for doing target based reorder
  2483. * Rx reorder buffering
  2484. */
  2485. __le32 num_offload_reorder_buffs;
  2486. /* Number of keys per peer */
  2487. __le32 num_peer_keys;
  2488. /* Total number of TX/RX data TIDs */
  2489. __le32 num_tids;
  2490. /* Max skid for resolving hash collisions.
  2491. * The address search table is sparse, so that if two MAC addresses
  2492. * result in the same hash value, the second of these conflicting
  2493. * entries can slide to the next index in the address search table,
  2494. * and use it, if it is unoccupied. This ast_skid_limit parameter
  2495. * specifies the upper bound on how many subsequent indices to search
  2496. * over to find an unoccupied space.
  2497. */
  2498. __le32 ast_skid_limit;
  2499. /* The nominal chain mask for transmit.
  2500. * The chain mask may be modified dynamically, e.g. to operate AP tx
  2501. * with a reduced number of chains if no clients are associated.
  2502. * This configuration parameter specifies the nominal chain-mask that
  2503. * should be used when not operating with a reduced set of tx chains.
  2504. */
  2505. __le32 tx_chain_mask;
  2506. /* The nominal chain mask for receive.
  2507. * The chain mask may be modified dynamically, e.g. for a client to use
  2508. * a reduced number of chains for receive if the traffic to the client
  2509. * is low enough that it doesn't require downlink MIMO or antenna
  2510. * diversity. This configuration parameter specifies the nominal
  2511. * chain-mask that should be used when not operating with a reduced
  2512. * set of rx chains.
  2513. */
  2514. __le32 rx_chain_mask;
  2515. /* What rx reorder timeout (ms) to use for the AC.
  2516. * Each WMM access class (voice, video, best-effort, background) will
  2517. * have its own timeout value to dictate how long to wait for missing
  2518. * rx MPDUs to arrive before flushing subsequent MPDUs that have already
  2519. * been received. This parameter specifies the timeout in milliseconds
  2520. * for each class.
  2521. */
  2522. __le32 rx_timeout_pri[4];
  2523. /* What mode the rx should decap packets to.
  2524. * MAC can decap to RAW (no decap), native wifi or Ethernet types.
  2525. * This setting also determines the default TX behavior, however TX
  2526. * behavior can be modified on a per VAP basis during VAP init
  2527. */
  2528. __le32 rx_decap_mode;
  2529. __le32 scan_max_pending_req;
  2530. __le32 bmiss_offload_max_vdev;
  2531. __le32 roam_offload_max_vdev;
  2532. __le32 roam_offload_max_ap_profiles;
  2533. /* How many groups to use for mcast->ucast conversion.
  2534. * The target's WAL maintains a table to hold information regarding
  2535. * which peers belong to a given multicast group, so that if
  2536. * multicast->unicast conversion is enabled, the target can convert
  2537. * multicast tx frames to a series of unicast tx frames, to each peer
  2538. * within the multicast group. This num_mcast_groups configuration
  2539. * parameter tells the target how many multicast groups to provide
  2540. * storage for within its multicast group membership table.
  2541. */
  2542. __le32 num_mcast_groups;
  2543. /* Size to alloc for the mcast membership table.
  2544. * This num_mcast_table_elems configuration parameter tells the target
  2545. * how many peer elements it needs to provide storage for in its
  2546. * multicast group membership table. These multicast group membership
  2547. * table elements are shared by the multicast groups stored within
  2548. * the table.
  2549. */
  2550. __le32 num_mcast_table_elems;
  2551. /* Whether/how to do multicast->unicast conversion.
  2552. * This configuration parameter specifies whether the target should
  2553. * perform multicast --> unicast conversion on transmit, and if so,
  2554. * what to do if it finds no entries in its multicast group membership
  2555. * table for the multicast IP address in the tx frame.
  2556. * Configuration value:
  2557. * 0 -> Do not perform multicast to unicast conversion.
  2558. * 1 -> Convert multicast frames to unicast, if the IP multicast address
  2559. * from the tx frame is found in the multicast group membership
  2560. * table. If the IP multicast address is not found, drop the frame
  2561. * 2 -> Convert multicast frames to unicast, if the IP multicast address
  2562. * from the tx frame is found in the multicast group membership
  2563. * table. If the IP multicast address is not found, transmit the
  2564. * frame as multicast.
  2565. */
  2566. __le32 mcast2ucast_mode;
  2567. /* How much memory to allocate for a tx PPDU dbg log.
  2568. * This parameter controls how much memory the target will allocate to
  2569. * store a log of tx PPDU meta-information (how large the PPDU was,
  2570. * when it was sent, whether it was successful, etc.)
  2571. */
  2572. __le32 tx_dbg_log_size;
  2573. /* How many AST entries to be allocated for WDS */
  2574. __le32 num_wds_entries;
  2575. /* MAC DMA burst size. 0 -default, 1 -256B */
  2576. __le32 dma_burst_size;
  2577. /* Fixed delimiters to be inserted after every MPDU to account for
  2578. * interface latency to avoid underrun.
  2579. */
  2580. __le32 mac_aggr_delim;
  2581. /* Determine whether target is responsible for detecting duplicate
  2582. * non-aggregate MPDU and timing out stale fragments. A-MPDU reordering
  2583. * is always performed on the target.
  2584. *
  2585. * 0: target responsible for frag timeout and dup checking
  2586. * 1: host responsible for frag timeout and dup checking
  2587. */
  2588. __le32 rx_skip_defrag_timeout_dup_detection_check;
  2589. /* Configuration for VoW : No of Video nodes to be supported and max
  2590. * no of descriptors for each video link (node).
  2591. */
  2592. __le32 vow_config;
  2593. /* Maximum vdev that could use gtk offload */
  2594. __le32 gtk_offload_max_vdev;
  2595. /* Number of msdu descriptors target should use */
  2596. __le32 num_msdu_desc;
  2597. /* Max number of tx fragments per MSDU.
  2598. * This parameter controls the max number of tx fragments per MSDU.
  2599. * This will passed by target as part of the WMI_SERVICE_READY event
  2600. * and is overridden by the OS shim as required.
  2601. */
  2602. __le32 max_frag_entries;
  2603. /* Max number of extended peer stats.
  2604. * This parameter controls the max number of peers for which extended
  2605. * statistics are supported by target
  2606. */
  2607. __le32 max_peer_ext_stats;
  2608. /* Smart antenna capabilities information.
  2609. * 1 - Smart antenna is enabled
  2610. * 0 - Smart antenna is disabled
  2611. * In future this can contain smart antenna specific capabilities.
  2612. */
  2613. __le32 smart_ant_cap;
  2614. /* User can configure the buffers allocated for each AC (BE, BK, VI, VO)
  2615. * during init.
  2616. */
  2617. __le32 bk_minfree;
  2618. __le32 be_minfree;
  2619. __le32 vi_minfree;
  2620. __le32 vo_minfree;
  2621. /* Rx batch mode capability.
  2622. * 1 - Rx batch mode enabled
  2623. * 0 - Rx batch mode disabled
  2624. */
  2625. __le32 rx_batchmode;
  2626. /* Thermal throttling capability.
  2627. * 1 - Capable of thermal throttling
  2628. * 0 - Not capable of thermal throttling
  2629. */
  2630. __le32 tt_support;
  2631. /* ATF configuration.
  2632. * 1 - Enable ATF
  2633. * 0 - Disable ATF
  2634. */
  2635. __le32 atf_config;
  2636. /* Configure padding to manage IP header un-alignment
  2637. * 1 - Enable padding
  2638. * 0 - Disable padding
  2639. */
  2640. __le32 iphdr_pad_config;
  2641. /* qwrap configuration (bits 15-0)
  2642. * 1 - This is qwrap configuration
  2643. * 0 - This is not qwrap
  2644. *
  2645. * Bits 31-16 is alloc_frag_desc_for_data_pkt (1 enables, 0 disables)
  2646. * In order to get ack-RSSI reporting and to specify the tx-rate for
  2647. * individual frames, this option must be enabled. This uses an extra
  2648. * 4 bytes per tx-msdu descriptor, so don't enable it unless you need it.
  2649. */
  2650. __le32 qwrap_config;
  2651. } __packed;
  2652. enum wmi_coex_version {
  2653. WMI_NO_COEX_VERSION_SUPPORT = 0,
  2654. /* 3 wire coex support*/
  2655. WMI_COEX_VERSION_1 = 1,
  2656. /* 2.5 wire coex support*/
  2657. WMI_COEX_VERSION_2 = 2,
  2658. /* 2.5 wire coex with duty cycle support */
  2659. WMI_COEX_VERSION_3 = 3,
  2660. /* 4 wire coex support*/
  2661. WMI_COEX_VERSION_4 = 4,
  2662. };
  2663. /**
  2664. * enum wmi_10_4_feature_mask - WMI 10.4 feature enable/disable flags
  2665. * @WMI_10_4_LTEU_SUPPORT: LTEU config
  2666. * @WMI_10_4_COEX_GPIO_SUPPORT: COEX GPIO config
  2667. * @WMI_10_4_AUX_RADIO_SPECTRAL_INTF: AUX Radio Enhancement for spectral scan
  2668. * @WMI_10_4_AUX_RADIO_CHAN_LOAD_INTF: AUX Radio Enhancement for chan load scan
  2669. * @WMI_10_4_BSS_CHANNEL_INFO_64: BSS channel info stats
  2670. * @WMI_10_4_PEER_STATS: Per station stats
  2671. * @WMI_10_4_VDEV_STATS: Per vdev stats
  2672. * @WMI_10_4_TDLS: Implicit TDLS support in firmware enable/disable
  2673. * @WMI_10_4_TDLS_OFFCHAN: TDLS offchannel support enable/disable
  2674. * @WMI_10_4_TDLS_UAPSD_BUFFER_STA: TDLS buffer sta support enable/disable
  2675. * @WMI_10_4_TDLS_UAPSD_SLEEP_STA: TDLS sleep sta support enable/disable
  2676. * @WMI_10_4_TDLS_CONN_TRACKER_IN_HOST_MODE: TDLS connection tracker in host
  2677. * enable/disable
  2678. * @WMI_10_4_TDLS_EXPLICIT_MODE_ONLY:Explicit TDLS mode enable/disable
  2679. */
  2680. enum wmi_10_4_feature_mask {
  2681. WMI_10_4_LTEU_SUPPORT = BIT(0),
  2682. WMI_10_4_COEX_GPIO_SUPPORT = BIT(1),
  2683. WMI_10_4_AUX_RADIO_SPECTRAL_INTF = BIT(2),
  2684. WMI_10_4_AUX_RADIO_CHAN_LOAD_INTF = BIT(3),
  2685. WMI_10_4_BSS_CHANNEL_INFO_64 = BIT(4),
  2686. WMI_10_4_PEER_STATS = BIT(5),
  2687. WMI_10_4_VDEV_STATS = BIT(6),
  2688. WMI_10_4_TDLS = BIT(7),
  2689. WMI_10_4_TDLS_OFFCHAN = BIT(8),
  2690. WMI_10_4_TDLS_UAPSD_BUFFER_STA = BIT(9),
  2691. WMI_10_4_TDLS_UAPSD_SLEEP_STA = BIT(10),
  2692. WMI_10_4_TDLS_CONN_TRACKER_IN_HOST_MODE = BIT(11),
  2693. WMI_10_4_TDLS_EXPLICIT_MODE_ONLY = BIT(12),
  2694. };
  2695. struct wmi_ext_resource_config_10_4_cmd {
  2696. /* contains enum wmi_host_platform_type */
  2697. __le32 host_platform_config;
  2698. /* see enum wmi_10_4_feature_mask */
  2699. __le32 fw_feature_bitmap;
  2700. /* WLAN priority GPIO number */
  2701. __le32 wlan_gpio_priority;
  2702. /* see enum wmi_coex_version */
  2703. __le32 coex_version;
  2704. /* COEX GPIO config */
  2705. __le32 coex_gpio_pin1;
  2706. __le32 coex_gpio_pin2;
  2707. __le32 coex_gpio_pin3;
  2708. /* number of vdevs allowed to perform tdls */
  2709. __le32 num_tdls_vdevs;
  2710. /* number of peers to track per TDLS vdev */
  2711. __le32 num_tdls_conn_table_entries;
  2712. /* number of tdls sleep sta supported */
  2713. __le32 max_tdls_concurrent_sleep_sta;
  2714. /* number of tdls buffer sta supported */
  2715. __le32 max_tdls_concurrent_buffer_sta;
  2716. };
  2717. /* structure describing host memory chunk. */
  2718. struct host_memory_chunk {
  2719. /* id of the request that is passed up in service ready */
  2720. __le32 req_id;
  2721. /* the physical address the memory chunk */
  2722. __le32 ptr;
  2723. /* size of the chunk */
  2724. __le32 size;
  2725. } __packed;
  2726. struct wmi_host_mem_chunks {
  2727. __le32 count;
  2728. /* some fw revisions require at least 1 chunk regardless of count */
  2729. struct host_memory_chunk items[1];
  2730. } __packed;
  2731. struct wmi_init_cmd {
  2732. struct wmi_resource_config resource_config;
  2733. struct wmi_host_mem_chunks mem_chunks;
  2734. } __packed;
  2735. /* _10x structure is from 10.X FW API */
  2736. struct wmi_init_cmd_10x {
  2737. struct wmi_resource_config_10x resource_config;
  2738. struct wmi_host_mem_chunks mem_chunks;
  2739. } __packed;
  2740. struct wmi_init_cmd_10_2 {
  2741. struct wmi_resource_config_10_2 resource_config;
  2742. struct wmi_host_mem_chunks mem_chunks;
  2743. } __packed;
  2744. struct wmi_init_cmd_10_4 {
  2745. struct wmi_resource_config_10_4 resource_config;
  2746. struct wmi_host_mem_chunks mem_chunks;
  2747. } __packed;
  2748. struct wmi_chan_list_entry {
  2749. __le16 freq;
  2750. u8 phy_mode; /* valid for 10.2 only */
  2751. u8 reserved;
  2752. } __packed;
  2753. /* TLV for channel list */
  2754. struct wmi_chan_list {
  2755. __le32 tag; /* WMI_CHAN_LIST_TAG */
  2756. __le32 num_chan;
  2757. struct wmi_chan_list_entry channel_list[0];
  2758. } __packed;
  2759. struct wmi_bssid_list {
  2760. __le32 tag; /* WMI_BSSID_LIST_TAG */
  2761. __le32 num_bssid;
  2762. struct wmi_mac_addr bssid_list[0];
  2763. } __packed;
  2764. struct wmi_ie_data {
  2765. __le32 tag; /* WMI_IE_TAG */
  2766. __le32 ie_len;
  2767. u8 ie_data[0];
  2768. } __packed;
  2769. struct wmi_ssid {
  2770. __le32 ssid_len;
  2771. u8 ssid[32];
  2772. } __packed;
  2773. struct wmi_ssid_list {
  2774. __le32 tag; /* WMI_SSID_LIST_TAG */
  2775. __le32 num_ssids;
  2776. struct wmi_ssid ssids[0];
  2777. } __packed;
  2778. /* prefix used by scan requestor ids on the host */
  2779. #define WMI_HOST_SCAN_REQUESTOR_ID_PREFIX 0xA000
  2780. /* prefix used by scan request ids generated on the host */
  2781. /* host cycles through the lower 12 bits to generate ids */
  2782. #define WMI_HOST_SCAN_REQ_ID_PREFIX 0xA000
  2783. #define WLAN_SCAN_PARAMS_MAX_SSID 16
  2784. #define WLAN_SCAN_PARAMS_MAX_BSSID 4
  2785. #define WLAN_SCAN_PARAMS_MAX_IE_LEN 256
  2786. /* Values lower than this may be refused by some firmware revisions with a scan
  2787. * completion with a timedout reason.
  2788. */
  2789. #define WMI_SCAN_CHAN_MIN_TIME_MSEC 40
  2790. /* Scan priority numbers must be sequential, starting with 0 */
  2791. enum wmi_scan_priority {
  2792. WMI_SCAN_PRIORITY_VERY_LOW = 0,
  2793. WMI_SCAN_PRIORITY_LOW,
  2794. WMI_SCAN_PRIORITY_MEDIUM,
  2795. WMI_SCAN_PRIORITY_HIGH,
  2796. WMI_SCAN_PRIORITY_VERY_HIGH,
  2797. WMI_SCAN_PRIORITY_COUNT /* number of priorities supported */
  2798. };
  2799. struct wmi_start_scan_common {
  2800. /* Scan ID */
  2801. __le32 scan_id;
  2802. /* Scan requestor ID */
  2803. __le32 scan_req_id;
  2804. /* VDEV id(interface) that is requesting scan */
  2805. __le32 vdev_id;
  2806. /* Scan Priority, input to scan scheduler */
  2807. __le32 scan_priority;
  2808. /* Scan events subscription */
  2809. __le32 notify_scan_events;
  2810. /* dwell time in msec on active channels */
  2811. __le32 dwell_time_active;
  2812. /* dwell time in msec on passive channels */
  2813. __le32 dwell_time_passive;
  2814. /*
  2815. * min time in msec on the BSS channel,only valid if atleast one
  2816. * VDEV is active
  2817. */
  2818. __le32 min_rest_time;
  2819. /*
  2820. * max rest time in msec on the BSS channel,only valid if at least
  2821. * one VDEV is active
  2822. */
  2823. /*
  2824. * the scanner will rest on the bss channel at least min_rest_time
  2825. * after min_rest_time the scanner will start checking for tx/rx
  2826. * activity on all VDEVs. if there is no activity the scanner will
  2827. * switch to off channel. if there is activity the scanner will let
  2828. * the radio on the bss channel until max_rest_time expires.at
  2829. * max_rest_time scanner will switch to off channel irrespective of
  2830. * activity. activity is determined by the idle_time parameter.
  2831. */
  2832. __le32 max_rest_time;
  2833. /*
  2834. * time before sending next set of probe requests.
  2835. * The scanner keeps repeating probe requests transmission with
  2836. * period specified by repeat_probe_time.
  2837. * The number of probe requests specified depends on the ssid_list
  2838. * and bssid_list
  2839. */
  2840. __le32 repeat_probe_time;
  2841. /* time in msec between 2 consequetive probe requests with in a set. */
  2842. __le32 probe_spacing_time;
  2843. /*
  2844. * data inactivity time in msec on bss channel that will be used by
  2845. * scanner for measuring the inactivity.
  2846. */
  2847. __le32 idle_time;
  2848. /* maximum time in msec allowed for scan */
  2849. __le32 max_scan_time;
  2850. /*
  2851. * delay in msec before sending first probe request after switching
  2852. * to a channel
  2853. */
  2854. __le32 probe_delay;
  2855. /* Scan control flags */
  2856. __le32 scan_ctrl_flags;
  2857. } __packed;
  2858. struct wmi_start_scan_tlvs {
  2859. /* TLV parameters. These includes channel list, ssid list, bssid list,
  2860. * extra ies.
  2861. */
  2862. u8 tlvs[0];
  2863. } __packed;
  2864. struct wmi_start_scan_cmd {
  2865. struct wmi_start_scan_common common;
  2866. __le32 burst_duration_ms;
  2867. struct wmi_start_scan_tlvs tlvs;
  2868. } __packed;
  2869. /* This is the definition from 10.X firmware branch */
  2870. struct wmi_10x_start_scan_cmd {
  2871. struct wmi_start_scan_common common;
  2872. struct wmi_start_scan_tlvs tlvs;
  2873. } __packed;
  2874. struct wmi_ssid_arg {
  2875. int len;
  2876. const u8 *ssid;
  2877. };
  2878. struct wmi_bssid_arg {
  2879. const u8 *bssid;
  2880. };
  2881. struct wmi_start_scan_arg {
  2882. u32 scan_id;
  2883. u32 scan_req_id;
  2884. u32 vdev_id;
  2885. u32 scan_priority;
  2886. u32 notify_scan_events;
  2887. u32 dwell_time_active;
  2888. u32 dwell_time_passive;
  2889. u32 min_rest_time;
  2890. u32 max_rest_time;
  2891. u32 repeat_probe_time;
  2892. u32 probe_spacing_time;
  2893. u32 idle_time;
  2894. u32 max_scan_time;
  2895. u32 probe_delay;
  2896. u32 scan_ctrl_flags;
  2897. u32 burst_duration_ms;
  2898. u32 ie_len;
  2899. u32 n_channels;
  2900. u32 n_ssids;
  2901. u32 n_bssids;
  2902. u8 ie[WLAN_SCAN_PARAMS_MAX_IE_LEN];
  2903. u16 channels[64];
  2904. struct wmi_ssid_arg ssids[WLAN_SCAN_PARAMS_MAX_SSID];
  2905. struct wmi_bssid_arg bssids[WLAN_SCAN_PARAMS_MAX_BSSID];
  2906. struct wmi_mac_addr mac_addr;
  2907. struct wmi_mac_addr mac_mask;
  2908. };
  2909. /* scan control flags */
  2910. /* passively scan all channels including active channels */
  2911. #define WMI_SCAN_FLAG_PASSIVE 0x1
  2912. /* add wild card ssid probe request even though ssid_list is specified. */
  2913. #define WMI_SCAN_ADD_BCAST_PROBE_REQ 0x2
  2914. /* add cck rates to rates/xrate ie for the generated probe request */
  2915. #define WMI_SCAN_ADD_CCK_RATES 0x4
  2916. /* add ofdm rates to rates/xrate ie for the generated probe request */
  2917. #define WMI_SCAN_ADD_OFDM_RATES 0x8
  2918. /* To enable indication of Chan load and Noise floor to host */
  2919. #define WMI_SCAN_CHAN_STAT_EVENT 0x10
  2920. /* Filter Probe request frames */
  2921. #define WMI_SCAN_FILTER_PROBE_REQ 0x20
  2922. /* When set, DFS channels will not be scanned */
  2923. #define WMI_SCAN_BYPASS_DFS_CHN 0x40
  2924. /* Different FW scan engine may choose to bail out on errors.
  2925. * Allow the driver to have influence over that.
  2926. */
  2927. #define WMI_SCAN_CONTINUE_ON_ERROR 0x80
  2928. /* Use random MAC address for TA for Probe Request frame and add
  2929. * OUI specified by WMI_SCAN_PROB_REQ_OUI_CMDID to the Probe Request frame.
  2930. * if OUI is not set by WMI_SCAN_PROB_REQ_OUI_CMDID then the flag is ignored.
  2931. */
  2932. #define WMI_SCAN_ADD_SPOOFED_MAC_IN_PROBE_REQ 0x1000
  2933. /* WMI_SCAN_CLASS_MASK must be the same value as IEEE80211_SCAN_CLASS_MASK */
  2934. #define WMI_SCAN_CLASS_MASK 0xFF000000
  2935. enum wmi_stop_scan_type {
  2936. WMI_SCAN_STOP_ONE = 0x00000000, /* stop by scan_id */
  2937. WMI_SCAN_STOP_VDEV_ALL = 0x01000000, /* stop by vdev_id */
  2938. WMI_SCAN_STOP_ALL = 0x04000000, /* stop all scans */
  2939. };
  2940. struct wmi_stop_scan_cmd {
  2941. __le32 scan_req_id;
  2942. __le32 scan_id;
  2943. __le32 req_type;
  2944. __le32 vdev_id;
  2945. } __packed;
  2946. struct wmi_stop_scan_arg {
  2947. u32 req_id;
  2948. enum wmi_stop_scan_type req_type;
  2949. union {
  2950. u32 scan_id;
  2951. u32 vdev_id;
  2952. } u;
  2953. };
  2954. struct wmi_scan_chan_list_cmd {
  2955. __le32 num_scan_chans;
  2956. struct wmi_channel chan_info[0];
  2957. } __packed;
  2958. struct wmi_scan_chan_list_arg {
  2959. u32 n_channels;
  2960. struct wmi_channel_arg *channels;
  2961. };
  2962. enum wmi_bss_filter {
  2963. WMI_BSS_FILTER_NONE = 0, /* no beacons forwarded */
  2964. WMI_BSS_FILTER_ALL, /* all beacons forwarded */
  2965. WMI_BSS_FILTER_PROFILE, /* only beacons matching profile */
  2966. WMI_BSS_FILTER_ALL_BUT_PROFILE, /* all but beacons matching profile */
  2967. WMI_BSS_FILTER_CURRENT_BSS, /* only beacons matching current BSS */
  2968. WMI_BSS_FILTER_ALL_BUT_BSS, /* all but beacons matching BSS */
  2969. WMI_BSS_FILTER_PROBED_SSID, /* beacons matching probed ssid */
  2970. WMI_BSS_FILTER_LAST_BSS, /* marker only */
  2971. };
  2972. enum wmi_scan_event_type {
  2973. WMI_SCAN_EVENT_STARTED = BIT(0),
  2974. WMI_SCAN_EVENT_COMPLETED = BIT(1),
  2975. WMI_SCAN_EVENT_BSS_CHANNEL = BIT(2),
  2976. WMI_SCAN_EVENT_FOREIGN_CHANNEL = BIT(3),
  2977. WMI_SCAN_EVENT_DEQUEUED = BIT(4),
  2978. /* possibly by high-prio scan */
  2979. WMI_SCAN_EVENT_PREEMPTED = BIT(5),
  2980. WMI_SCAN_EVENT_START_FAILED = BIT(6),
  2981. WMI_SCAN_EVENT_RESTARTED = BIT(7),
  2982. WMI_SCAN_EVENT_FOREIGN_CHANNEL_EXIT = BIT(8),
  2983. WMI_SCAN_EVENT_MAX = BIT(15),
  2984. };
  2985. enum wmi_scan_completion_reason {
  2986. WMI_SCAN_REASON_COMPLETED,
  2987. WMI_SCAN_REASON_CANCELLED,
  2988. WMI_SCAN_REASON_PREEMPTED,
  2989. WMI_SCAN_REASON_TIMEDOUT,
  2990. WMI_SCAN_REASON_INTERNAL_FAILURE,
  2991. WMI_SCAN_REASON_MAX,
  2992. };
  2993. struct wmi_scan_event {
  2994. __le32 event_type; /* %WMI_SCAN_EVENT_ */
  2995. __le32 reason; /* %WMI_SCAN_REASON_ */
  2996. __le32 channel_freq; /* only valid for WMI_SCAN_EVENT_FOREIGN_CHANNEL */
  2997. __le32 scan_req_id;
  2998. __le32 scan_id;
  2999. __le32 vdev_id;
  3000. } __packed;
  3001. /*
  3002. * This defines how much headroom is kept in the
  3003. * receive frame between the descriptor and the
  3004. * payload, in order for the WMI PHY error and
  3005. * management handler to insert header contents.
  3006. *
  3007. * This is in bytes.
  3008. */
  3009. #define WMI_MGMT_RX_HDR_HEADROOM 52
  3010. /*
  3011. * This event will be used for sending scan results
  3012. * as well as rx mgmt frames to the host. The rx buffer
  3013. * will be sent as part of this WMI event. It would be a
  3014. * good idea to pass all the fields in the RX status
  3015. * descriptor up to the host.
  3016. */
  3017. struct wmi_mgmt_rx_hdr_v1 {
  3018. __le32 channel;
  3019. __le32 snr;
  3020. __le32 rate;
  3021. __le32 phy_mode;
  3022. __le32 buf_len;
  3023. __le32 status; /* %WMI_RX_STATUS_ */
  3024. } __packed;
  3025. struct wmi_mgmt_rx_hdr_v2 {
  3026. struct wmi_mgmt_rx_hdr_v1 v1;
  3027. __le32 rssi_ctl[4];
  3028. } __packed;
  3029. struct wmi_mgmt_rx_event_v1 {
  3030. struct wmi_mgmt_rx_hdr_v1 hdr;
  3031. u8 buf[0];
  3032. } __packed;
  3033. struct wmi_mgmt_rx_event_v2 {
  3034. struct wmi_mgmt_rx_hdr_v2 hdr;
  3035. u8 buf[0];
  3036. } __packed;
  3037. struct wmi_10_4_mgmt_rx_hdr {
  3038. __le32 channel;
  3039. __le32 snr;
  3040. u8 rssi_ctl[4];
  3041. __le32 rate;
  3042. __le32 phy_mode;
  3043. __le32 buf_len;
  3044. __le32 status;
  3045. } __packed;
  3046. struct wmi_10_4_mgmt_rx_event {
  3047. struct wmi_10_4_mgmt_rx_hdr hdr;
  3048. u8 buf[0];
  3049. } __packed;
  3050. struct wmi_mgmt_rx_ext_info {
  3051. __le64 rx_mac_timestamp;
  3052. } __packed __aligned(4);
  3053. #define WMI_RX_STATUS_OK 0x00
  3054. #define WMI_RX_STATUS_ERR_CRC 0x01
  3055. #define WMI_RX_STATUS_ERR_DECRYPT 0x08
  3056. #define WMI_RX_STATUS_ERR_MIC 0x10
  3057. #define WMI_RX_STATUS_ERR_KEY_CACHE_MISS 0x20
  3058. /* Extension data at the end of mgmt frame */
  3059. #define WMI_RX_STATUS_EXT_INFO 0x40
  3060. #define PHY_ERROR_GEN_SPECTRAL_SCAN 0x26
  3061. #define PHY_ERROR_GEN_FALSE_RADAR_EXT 0x24
  3062. #define PHY_ERROR_GEN_RADAR 0x05
  3063. #define PHY_ERROR_10_4_RADAR_MASK 0x4
  3064. #define PHY_ERROR_10_4_SPECTRAL_SCAN_MASK 0x4000000
  3065. enum phy_err_type {
  3066. PHY_ERROR_UNKNOWN,
  3067. PHY_ERROR_SPECTRAL_SCAN,
  3068. PHY_ERROR_FALSE_RADAR_EXT,
  3069. PHY_ERROR_RADAR
  3070. };
  3071. struct wmi_phyerr {
  3072. __le32 tsf_timestamp;
  3073. __le16 freq1;
  3074. __le16 freq2;
  3075. u8 rssi_combined;
  3076. u8 chan_width_mhz;
  3077. u8 phy_err_code;
  3078. u8 rsvd0;
  3079. __le32 rssi_chains[4];
  3080. __le16 nf_chains[4];
  3081. __le32 buf_len;
  3082. u8 buf[0];
  3083. } __packed;
  3084. struct wmi_phyerr_event {
  3085. __le32 num_phyerrs;
  3086. __le32 tsf_l32;
  3087. __le32 tsf_u32;
  3088. struct wmi_phyerr phyerrs[0];
  3089. } __packed;
  3090. struct wmi_10_4_phyerr_event {
  3091. __le32 tsf_l32;
  3092. __le32 tsf_u32;
  3093. __le16 freq1;
  3094. __le16 freq2;
  3095. u8 rssi_combined;
  3096. u8 chan_width_mhz;
  3097. u8 phy_err_code;
  3098. u8 rsvd0;
  3099. __le32 rssi_chains[4];
  3100. __le16 nf_chains[4];
  3101. __le32 phy_err_mask[2];
  3102. __le32 tsf_timestamp;
  3103. __le32 buf_len;
  3104. u8 buf[0];
  3105. } __packed;
  3106. struct wmi_radar_found_info {
  3107. __le32 pri_min;
  3108. __le32 pri_max;
  3109. __le32 width_min;
  3110. __le32 width_max;
  3111. __le32 sidx_min;
  3112. __le32 sidx_max;
  3113. } __packed;
  3114. enum wmi_radar_confirmation_status {
  3115. /* Detected radar was due to SW pulses */
  3116. WMI_SW_RADAR_DETECTED = 0,
  3117. WMI_RADAR_DETECTION_FAIL = 1,
  3118. /* Real radar detected */
  3119. WMI_HW_RADAR_DETECTED = 2,
  3120. };
  3121. #define PHYERR_TLV_SIG 0xBB
  3122. #define PHYERR_TLV_TAG_SEARCH_FFT_REPORT 0xFB
  3123. #define PHYERR_TLV_TAG_RADAR_PULSE_SUMMARY 0xF8
  3124. #define PHYERR_TLV_TAG_SPECTRAL_SUMMARY_REPORT 0xF9
  3125. struct phyerr_radar_report {
  3126. __le32 reg0; /* RADAR_REPORT_REG0_* */
  3127. __le32 reg1; /* RADAR_REPORT_REG1_* */
  3128. } __packed;
  3129. #define RADAR_REPORT_REG0_PULSE_IS_CHIRP_MASK 0x80000000
  3130. #define RADAR_REPORT_REG0_PULSE_IS_CHIRP_LSB 31
  3131. #define RADAR_REPORT_REG0_PULSE_IS_MAX_WIDTH_MASK 0x40000000
  3132. #define RADAR_REPORT_REG0_PULSE_IS_MAX_WIDTH_LSB 30
  3133. #define RADAR_REPORT_REG0_AGC_TOTAL_GAIN_MASK 0x3FF00000
  3134. #define RADAR_REPORT_REG0_AGC_TOTAL_GAIN_LSB 20
  3135. #define RADAR_REPORT_REG0_PULSE_DELTA_DIFF_MASK 0x000F0000
  3136. #define RADAR_REPORT_REG0_PULSE_DELTA_DIFF_LSB 16
  3137. #define RADAR_REPORT_REG0_PULSE_DELTA_PEAK_MASK 0x0000FC00
  3138. #define RADAR_REPORT_REG0_PULSE_DELTA_PEAK_LSB 10
  3139. #define RADAR_REPORT_REG0_PULSE_SIDX_MASK 0x000003FF
  3140. #define RADAR_REPORT_REG0_PULSE_SIDX_LSB 0
  3141. #define RADAR_REPORT_REG1_PULSE_SRCH_FFT_VALID_MASK 0x80000000
  3142. #define RADAR_REPORT_REG1_PULSE_SRCH_FFT_VALID_LSB 31
  3143. #define RADAR_REPORT_REG1_PULSE_AGC_MB_GAIN_MASK 0x7F000000
  3144. #define RADAR_REPORT_REG1_PULSE_AGC_MB_GAIN_LSB 24
  3145. #define RADAR_REPORT_REG1_PULSE_SUBCHAN_MASK_MASK 0x00FF0000
  3146. #define RADAR_REPORT_REG1_PULSE_SUBCHAN_MASK_LSB 16
  3147. #define RADAR_REPORT_REG1_PULSE_TSF_OFFSET_MASK 0x0000FF00
  3148. #define RADAR_REPORT_REG1_PULSE_TSF_OFFSET_LSB 8
  3149. #define RADAR_REPORT_REG1_PULSE_DUR_MASK 0x000000FF
  3150. #define RADAR_REPORT_REG1_PULSE_DUR_LSB 0
  3151. struct phyerr_fft_report {
  3152. __le32 reg0; /* SEARCH_FFT_REPORT_REG0_ * */
  3153. __le32 reg1; /* SEARCH_FFT_REPORT_REG1_ * */
  3154. } __packed;
  3155. #define SEARCH_FFT_REPORT_REG0_TOTAL_GAIN_DB_MASK 0xFF800000
  3156. #define SEARCH_FFT_REPORT_REG0_TOTAL_GAIN_DB_LSB 23
  3157. #define SEARCH_FFT_REPORT_REG0_BASE_PWR_DB_MASK 0x007FC000
  3158. #define SEARCH_FFT_REPORT_REG0_BASE_PWR_DB_LSB 14
  3159. #define SEARCH_FFT_REPORT_REG0_FFT_CHN_IDX_MASK 0x00003000
  3160. #define SEARCH_FFT_REPORT_REG0_FFT_CHN_IDX_LSB 12
  3161. #define SEARCH_FFT_REPORT_REG0_PEAK_SIDX_MASK 0x00000FFF
  3162. #define SEARCH_FFT_REPORT_REG0_PEAK_SIDX_LSB 0
  3163. #define SEARCH_FFT_REPORT_REG1_RELPWR_DB_MASK 0xFC000000
  3164. #define SEARCH_FFT_REPORT_REG1_RELPWR_DB_LSB 26
  3165. #define SEARCH_FFT_REPORT_REG1_AVGPWR_DB_MASK 0x03FC0000
  3166. #define SEARCH_FFT_REPORT_REG1_AVGPWR_DB_LSB 18
  3167. #define SEARCH_FFT_REPORT_REG1_PEAK_MAG_MASK 0x0003FF00
  3168. #define SEARCH_FFT_REPORT_REG1_PEAK_MAG_LSB 8
  3169. #define SEARCH_FFT_REPORT_REG1_NUM_STR_BINS_IB_MASK 0x000000FF
  3170. #define SEARCH_FFT_REPORT_REG1_NUM_STR_BINS_IB_LSB 0
  3171. struct phyerr_tlv {
  3172. __le16 len;
  3173. u8 tag;
  3174. u8 sig;
  3175. } __packed;
  3176. #define DFS_RSSI_POSSIBLY_FALSE 50
  3177. #define DFS_PEAK_MAG_THOLD_POSSIBLY_FALSE 40
  3178. struct wmi_mgmt_tx_hdr {
  3179. __le32 vdev_id;
  3180. struct wmi_mac_addr peer_macaddr;
  3181. __le32 tx_rate;
  3182. __le32 tx_power;
  3183. __le32 buf_len;
  3184. } __packed;
  3185. struct wmi_mgmt_tx_cmd {
  3186. struct wmi_mgmt_tx_hdr hdr;
  3187. u8 buf[0];
  3188. } __packed;
  3189. struct wmi_echo_event {
  3190. __le32 value;
  3191. } __packed;
  3192. struct wmi_echo_cmd {
  3193. __le32 value;
  3194. } __packed;
  3195. struct wmi_pdev_set_regdomain_cmd {
  3196. __le32 reg_domain;
  3197. __le32 reg_domain_2G;
  3198. __le32 reg_domain_5G;
  3199. __le32 conformance_test_limit_2G;
  3200. __le32 conformance_test_limit_5G;
  3201. } __packed;
  3202. enum wmi_dfs_region {
  3203. /* Uninitialized dfs domain */
  3204. WMI_UNINIT_DFS_DOMAIN = 0,
  3205. /* FCC3 dfs domain */
  3206. WMI_FCC_DFS_DOMAIN = 1,
  3207. /* ETSI dfs domain */
  3208. WMI_ETSI_DFS_DOMAIN = 2,
  3209. /*Japan dfs domain */
  3210. WMI_MKK4_DFS_DOMAIN = 3,
  3211. };
  3212. struct wmi_pdev_set_regdomain_cmd_10x {
  3213. __le32 reg_domain;
  3214. __le32 reg_domain_2G;
  3215. __le32 reg_domain_5G;
  3216. __le32 conformance_test_limit_2G;
  3217. __le32 conformance_test_limit_5G;
  3218. /* dfs domain from wmi_dfs_region */
  3219. __le32 dfs_domain;
  3220. } __packed;
  3221. /* Command to set/unset chip in quiet mode */
  3222. struct wmi_pdev_set_quiet_cmd {
  3223. /* period in TUs */
  3224. __le32 period;
  3225. /* duration in TUs */
  3226. __le32 duration;
  3227. /* offset in TUs */
  3228. __le32 next_start;
  3229. /* enable/disable */
  3230. __le32 enabled;
  3231. } __packed;
  3232. /*
  3233. * 802.11g protection mode.
  3234. */
  3235. enum ath10k_protmode {
  3236. ATH10K_PROT_NONE = 0, /* no protection */
  3237. ATH10K_PROT_CTSONLY = 1, /* CTS to self */
  3238. ATH10K_PROT_RTSCTS = 2, /* RTS-CTS */
  3239. };
  3240. enum wmi_rtscts_profile {
  3241. WMI_RTSCTS_FOR_NO_RATESERIES = 0,
  3242. WMI_RTSCTS_FOR_SECOND_RATESERIES,
  3243. WMI_RTSCTS_ACROSS_SW_RETRIES
  3244. };
  3245. #define WMI_RTSCTS_ENABLED 1
  3246. #define WMI_RTSCTS_SET_MASK 0x0f
  3247. #define WMI_RTSCTS_SET_LSB 0
  3248. #define WMI_RTSCTS_PROFILE_MASK 0xf0
  3249. #define WMI_RTSCTS_PROFILE_LSB 4
  3250. enum wmi_beacon_gen_mode {
  3251. WMI_BEACON_STAGGERED_MODE = 0,
  3252. WMI_BEACON_BURST_MODE = 1
  3253. };
  3254. enum wmi_csa_event_ies_present_flag {
  3255. WMI_CSA_IE_PRESENT = 0x00000001,
  3256. WMI_XCSA_IE_PRESENT = 0x00000002,
  3257. WMI_WBW_IE_PRESENT = 0x00000004,
  3258. WMI_CSWARP_IE_PRESENT = 0x00000008,
  3259. };
  3260. /* wmi CSA receive event from beacon frame */
  3261. struct wmi_csa_event {
  3262. __le32 i_fc_dur;
  3263. /* Bit 0-15: FC */
  3264. /* Bit 16-31: DUR */
  3265. struct wmi_mac_addr i_addr1;
  3266. struct wmi_mac_addr i_addr2;
  3267. __le32 csa_ie[2];
  3268. __le32 xcsa_ie[2];
  3269. __le32 wb_ie[2];
  3270. __le32 cswarp_ie;
  3271. __le32 ies_present_flag; /* wmi_csa_event_ies_present_flag */
  3272. } __packed;
  3273. /* the definition of different PDEV parameters */
  3274. #define PDEV_DEFAULT_STATS_UPDATE_PERIOD 500
  3275. #define VDEV_DEFAULT_STATS_UPDATE_PERIOD 500
  3276. #define PEER_DEFAULT_STATS_UPDATE_PERIOD 500
  3277. struct wmi_pdev_param_map {
  3278. u32 tx_chain_mask;
  3279. u32 rx_chain_mask;
  3280. u32 txpower_limit2g;
  3281. u32 txpower_limit5g;
  3282. u32 txpower_scale;
  3283. u32 beacon_gen_mode;
  3284. u32 beacon_tx_mode;
  3285. u32 resmgr_offchan_mode;
  3286. u32 protection_mode;
  3287. u32 dynamic_bw;
  3288. u32 non_agg_sw_retry_th;
  3289. u32 agg_sw_retry_th;
  3290. u32 sta_kickout_th;
  3291. u32 ac_aggrsize_scaling;
  3292. u32 ltr_enable;
  3293. u32 ltr_ac_latency_be;
  3294. u32 ltr_ac_latency_bk;
  3295. u32 ltr_ac_latency_vi;
  3296. u32 ltr_ac_latency_vo;
  3297. u32 ltr_ac_latency_timeout;
  3298. u32 ltr_sleep_override;
  3299. u32 ltr_rx_override;
  3300. u32 ltr_tx_activity_timeout;
  3301. u32 l1ss_enable;
  3302. u32 dsleep_enable;
  3303. u32 pcielp_txbuf_flush;
  3304. u32 pcielp_txbuf_watermark;
  3305. u32 pcielp_txbuf_tmo_en;
  3306. u32 pcielp_txbuf_tmo_value;
  3307. u32 pdev_stats_update_period;
  3308. u32 vdev_stats_update_period;
  3309. u32 peer_stats_update_period;
  3310. u32 bcnflt_stats_update_period;
  3311. u32 pmf_qos;
  3312. u32 arp_ac_override;
  3313. u32 dcs;
  3314. u32 ani_enable;
  3315. u32 ani_poll_period;
  3316. u32 ani_listen_period;
  3317. u32 ani_ofdm_level;
  3318. u32 ani_cck_level;
  3319. u32 dyntxchain;
  3320. u32 proxy_sta;
  3321. u32 idle_ps_config;
  3322. u32 power_gating_sleep;
  3323. u32 fast_channel_reset;
  3324. u32 burst_dur;
  3325. u32 burst_enable;
  3326. u32 cal_period;
  3327. u32 aggr_burst;
  3328. u32 rx_decap_mode;
  3329. u32 smart_antenna_default_antenna;
  3330. u32 igmpmld_override;
  3331. u32 igmpmld_tid;
  3332. u32 antenna_gain;
  3333. u32 rx_filter;
  3334. u32 set_mcast_to_ucast_tid;
  3335. u32 proxy_sta_mode;
  3336. u32 set_mcast2ucast_mode;
  3337. u32 set_mcast2ucast_buffer;
  3338. u32 remove_mcast2ucast_buffer;
  3339. u32 peer_sta_ps_statechg_enable;
  3340. u32 igmpmld_ac_override;
  3341. u32 block_interbss;
  3342. u32 set_disable_reset_cmdid;
  3343. u32 set_msdu_ttl_cmdid;
  3344. u32 set_ppdu_duration_cmdid;
  3345. u32 txbf_sound_period_cmdid;
  3346. u32 set_promisc_mode_cmdid;
  3347. u32 set_burst_mode_cmdid;
  3348. u32 en_stats;
  3349. u32 mu_group_policy;
  3350. u32 noise_detection;
  3351. u32 noise_threshold;
  3352. u32 dpd_enable;
  3353. u32 set_mcast_bcast_echo;
  3354. u32 atf_strict_sch;
  3355. u32 atf_sched_duration;
  3356. u32 ant_plzn;
  3357. u32 mgmt_retry_limit;
  3358. u32 sensitivity_level;
  3359. u32 signed_txpower_2g;
  3360. u32 signed_txpower_5g;
  3361. u32 enable_per_tid_amsdu;
  3362. u32 enable_per_tid_ampdu;
  3363. u32 cca_threshold;
  3364. u32 rts_fixed_rate;
  3365. u32 pdev_reset;
  3366. u32 wapi_mbssid_offset;
  3367. u32 arp_srcaddr;
  3368. u32 arp_dstaddr;
  3369. u32 enable_btcoex;
  3370. };
  3371. #define WMI_PDEV_PARAM_UNSUPPORTED 0
  3372. enum wmi_pdev_param {
  3373. /* TX chain mask */
  3374. WMI_PDEV_PARAM_TX_CHAIN_MASK = 0x1,
  3375. /* RX chain mask */
  3376. WMI_PDEV_PARAM_RX_CHAIN_MASK,
  3377. /* TX power limit for 2G Radio */
  3378. WMI_PDEV_PARAM_TXPOWER_LIMIT2G,
  3379. /* TX power limit for 5G Radio */
  3380. WMI_PDEV_PARAM_TXPOWER_LIMIT5G,
  3381. /* TX power scale */
  3382. WMI_PDEV_PARAM_TXPOWER_SCALE,
  3383. /* Beacon generation mode . 0: host, 1: target */
  3384. WMI_PDEV_PARAM_BEACON_GEN_MODE,
  3385. /* Beacon generation mode . 0: staggered 1: bursted */
  3386. WMI_PDEV_PARAM_BEACON_TX_MODE,
  3387. /*
  3388. * Resource manager off chan mode .
  3389. * 0: turn off off chan mode. 1: turn on offchan mode
  3390. */
  3391. WMI_PDEV_PARAM_RESMGR_OFFCHAN_MODE,
  3392. /*
  3393. * Protection mode:
  3394. * 0: no protection 1:use CTS-to-self 2: use RTS/CTS
  3395. */
  3396. WMI_PDEV_PARAM_PROTECTION_MODE,
  3397. /*
  3398. * Dynamic bandwidth - 0: disable, 1: enable
  3399. *
  3400. * When enabled HW rate control tries different bandwidths when
  3401. * retransmitting frames.
  3402. */
  3403. WMI_PDEV_PARAM_DYNAMIC_BW,
  3404. /* Non aggregrate/ 11g sw retry threshold.0-disable */
  3405. WMI_PDEV_PARAM_NON_AGG_SW_RETRY_TH,
  3406. /* aggregrate sw retry threshold. 0-disable*/
  3407. WMI_PDEV_PARAM_AGG_SW_RETRY_TH,
  3408. /* Station kickout threshold (non of consecutive failures).0-disable */
  3409. WMI_PDEV_PARAM_STA_KICKOUT_TH,
  3410. /* Aggerate size scaling configuration per AC */
  3411. WMI_PDEV_PARAM_AC_AGGRSIZE_SCALING,
  3412. /* LTR enable */
  3413. WMI_PDEV_PARAM_LTR_ENABLE,
  3414. /* LTR latency for BE, in us */
  3415. WMI_PDEV_PARAM_LTR_AC_LATENCY_BE,
  3416. /* LTR latency for BK, in us */
  3417. WMI_PDEV_PARAM_LTR_AC_LATENCY_BK,
  3418. /* LTR latency for VI, in us */
  3419. WMI_PDEV_PARAM_LTR_AC_LATENCY_VI,
  3420. /* LTR latency for VO, in us */
  3421. WMI_PDEV_PARAM_LTR_AC_LATENCY_VO,
  3422. /* LTR AC latency timeout, in ms */
  3423. WMI_PDEV_PARAM_LTR_AC_LATENCY_TIMEOUT,
  3424. /* LTR platform latency override, in us */
  3425. WMI_PDEV_PARAM_LTR_SLEEP_OVERRIDE,
  3426. /* LTR-RX override, in us */
  3427. WMI_PDEV_PARAM_LTR_RX_OVERRIDE,
  3428. /* Tx activity timeout for LTR, in us */
  3429. WMI_PDEV_PARAM_LTR_TX_ACTIVITY_TIMEOUT,
  3430. /* L1SS state machine enable */
  3431. WMI_PDEV_PARAM_L1SS_ENABLE,
  3432. /* Deep sleep state machine enable */
  3433. WMI_PDEV_PARAM_DSLEEP_ENABLE,
  3434. /* RX buffering flush enable */
  3435. WMI_PDEV_PARAM_PCIELP_TXBUF_FLUSH,
  3436. /* RX buffering matermark */
  3437. WMI_PDEV_PARAM_PCIELP_TXBUF_WATERMARK,
  3438. /* RX buffering timeout enable */
  3439. WMI_PDEV_PARAM_PCIELP_TXBUF_TMO_EN,
  3440. /* RX buffering timeout value */
  3441. WMI_PDEV_PARAM_PCIELP_TXBUF_TMO_VALUE,
  3442. /* pdev level stats update period in ms */
  3443. WMI_PDEV_PARAM_PDEV_STATS_UPDATE_PERIOD,
  3444. /* vdev level stats update period in ms */
  3445. WMI_PDEV_PARAM_VDEV_STATS_UPDATE_PERIOD,
  3446. /* peer level stats update period in ms */
  3447. WMI_PDEV_PARAM_PEER_STATS_UPDATE_PERIOD,
  3448. /* beacon filter status update period */
  3449. WMI_PDEV_PARAM_BCNFLT_STATS_UPDATE_PERIOD,
  3450. /* QOS Mgmt frame protection MFP/PMF 0: disable, 1: enable */
  3451. WMI_PDEV_PARAM_PMF_QOS,
  3452. /* Access category on which ARP frames are sent */
  3453. WMI_PDEV_PARAM_ARP_AC_OVERRIDE,
  3454. /* DCS configuration */
  3455. WMI_PDEV_PARAM_DCS,
  3456. /* Enable/Disable ANI on target */
  3457. WMI_PDEV_PARAM_ANI_ENABLE,
  3458. /* configure the ANI polling period */
  3459. WMI_PDEV_PARAM_ANI_POLL_PERIOD,
  3460. /* configure the ANI listening period */
  3461. WMI_PDEV_PARAM_ANI_LISTEN_PERIOD,
  3462. /* configure OFDM immunity level */
  3463. WMI_PDEV_PARAM_ANI_OFDM_LEVEL,
  3464. /* configure CCK immunity level */
  3465. WMI_PDEV_PARAM_ANI_CCK_LEVEL,
  3466. /* Enable/Disable CDD for 1x1 STAs in rate control module */
  3467. WMI_PDEV_PARAM_DYNTXCHAIN,
  3468. /* Enable/Disable proxy STA */
  3469. WMI_PDEV_PARAM_PROXY_STA,
  3470. /* Enable/Disable low power state when all VDEVs are inactive/idle. */
  3471. WMI_PDEV_PARAM_IDLE_PS_CONFIG,
  3472. /* Enable/Disable power gating sleep */
  3473. WMI_PDEV_PARAM_POWER_GATING_SLEEP,
  3474. };
  3475. enum wmi_10x_pdev_param {
  3476. /* TX chian mask */
  3477. WMI_10X_PDEV_PARAM_TX_CHAIN_MASK = 0x1,
  3478. /* RX chian mask */
  3479. WMI_10X_PDEV_PARAM_RX_CHAIN_MASK,
  3480. /* TX power limit for 2G Radio */
  3481. WMI_10X_PDEV_PARAM_TXPOWER_LIMIT2G,
  3482. /* TX power limit for 5G Radio */
  3483. WMI_10X_PDEV_PARAM_TXPOWER_LIMIT5G,
  3484. /* TX power scale */
  3485. WMI_10X_PDEV_PARAM_TXPOWER_SCALE,
  3486. /* Beacon generation mode . 0: host, 1: target */
  3487. WMI_10X_PDEV_PARAM_BEACON_GEN_MODE,
  3488. /* Beacon generation mode . 0: staggered 1: bursted */
  3489. WMI_10X_PDEV_PARAM_BEACON_TX_MODE,
  3490. /*
  3491. * Resource manager off chan mode .
  3492. * 0: turn off off chan mode. 1: turn on offchan mode
  3493. */
  3494. WMI_10X_PDEV_PARAM_RESMGR_OFFCHAN_MODE,
  3495. /*
  3496. * Protection mode:
  3497. * 0: no protection 1:use CTS-to-self 2: use RTS/CTS
  3498. */
  3499. WMI_10X_PDEV_PARAM_PROTECTION_MODE,
  3500. /* Dynamic bandwidth 0: disable 1: enable */
  3501. WMI_10X_PDEV_PARAM_DYNAMIC_BW,
  3502. /* Non aggregrate/ 11g sw retry threshold.0-disable */
  3503. WMI_10X_PDEV_PARAM_NON_AGG_SW_RETRY_TH,
  3504. /* aggregrate sw retry threshold. 0-disable*/
  3505. WMI_10X_PDEV_PARAM_AGG_SW_RETRY_TH,
  3506. /* Station kickout threshold (non of consecutive failures).0-disable */
  3507. WMI_10X_PDEV_PARAM_STA_KICKOUT_TH,
  3508. /* Aggerate size scaling configuration per AC */
  3509. WMI_10X_PDEV_PARAM_AC_AGGRSIZE_SCALING,
  3510. /* LTR enable */
  3511. WMI_10X_PDEV_PARAM_LTR_ENABLE,
  3512. /* LTR latency for BE, in us */
  3513. WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_BE,
  3514. /* LTR latency for BK, in us */
  3515. WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_BK,
  3516. /* LTR latency for VI, in us */
  3517. WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_VI,
  3518. /* LTR latency for VO, in us */
  3519. WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_VO,
  3520. /* LTR AC latency timeout, in ms */
  3521. WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_TIMEOUT,
  3522. /* LTR platform latency override, in us */
  3523. WMI_10X_PDEV_PARAM_LTR_SLEEP_OVERRIDE,
  3524. /* LTR-RX override, in us */
  3525. WMI_10X_PDEV_PARAM_LTR_RX_OVERRIDE,
  3526. /* Tx activity timeout for LTR, in us */
  3527. WMI_10X_PDEV_PARAM_LTR_TX_ACTIVITY_TIMEOUT,
  3528. /* L1SS state machine enable */
  3529. WMI_10X_PDEV_PARAM_L1SS_ENABLE,
  3530. /* Deep sleep state machine enable */
  3531. WMI_10X_PDEV_PARAM_DSLEEP_ENABLE,
  3532. /* pdev level stats update period in ms */
  3533. WMI_10X_PDEV_PARAM_PDEV_STATS_UPDATE_PERIOD,
  3534. /* vdev level stats update period in ms */
  3535. WMI_10X_PDEV_PARAM_VDEV_STATS_UPDATE_PERIOD,
  3536. /* peer level stats update period in ms */
  3537. WMI_10X_PDEV_PARAM_PEER_STATS_UPDATE_PERIOD,
  3538. /* beacon filter status update period */
  3539. WMI_10X_PDEV_PARAM_BCNFLT_STATS_UPDATE_PERIOD,
  3540. /* QOS Mgmt frame protection MFP/PMF 0: disable, 1: enable */
  3541. WMI_10X_PDEV_PARAM_PMF_QOS,
  3542. /* Access category on which ARP and DHCP frames are sent */
  3543. WMI_10X_PDEV_PARAM_ARPDHCP_AC_OVERRIDE,
  3544. /* DCS configuration */
  3545. WMI_10X_PDEV_PARAM_DCS,
  3546. /* Enable/Disable ANI on target */
  3547. WMI_10X_PDEV_PARAM_ANI_ENABLE,
  3548. /* configure the ANI polling period */
  3549. WMI_10X_PDEV_PARAM_ANI_POLL_PERIOD,
  3550. /* configure the ANI listening period */
  3551. WMI_10X_PDEV_PARAM_ANI_LISTEN_PERIOD,
  3552. /* configure OFDM immunity level */
  3553. WMI_10X_PDEV_PARAM_ANI_OFDM_LEVEL,
  3554. /* configure CCK immunity level */
  3555. WMI_10X_PDEV_PARAM_ANI_CCK_LEVEL,
  3556. /* Enable/Disable CDD for 1x1 STAs in rate control module */
  3557. WMI_10X_PDEV_PARAM_DYNTXCHAIN,
  3558. /* Enable/Disable Fast channel reset*/
  3559. WMI_10X_PDEV_PARAM_FAST_CHANNEL_RESET,
  3560. /* Set Bursting DUR */
  3561. WMI_10X_PDEV_PARAM_BURST_DUR,
  3562. /* Set Bursting Enable*/
  3563. WMI_10X_PDEV_PARAM_BURST_ENABLE,
  3564. /* following are available as of firmware 10.2 */
  3565. WMI_10X_PDEV_PARAM_SMART_ANTENNA_DEFAULT_ANTENNA,
  3566. WMI_10X_PDEV_PARAM_IGMPMLD_OVERRIDE,
  3567. WMI_10X_PDEV_PARAM_IGMPMLD_TID,
  3568. WMI_10X_PDEV_PARAM_ANTENNA_GAIN,
  3569. WMI_10X_PDEV_PARAM_RX_DECAP_MODE,
  3570. WMI_10X_PDEV_PARAM_RX_FILTER,
  3571. WMI_10X_PDEV_PARAM_SET_MCAST_TO_UCAST_TID,
  3572. WMI_10X_PDEV_PARAM_PROXY_STA_MODE,
  3573. WMI_10X_PDEV_PARAM_SET_MCAST2UCAST_MODE,
  3574. WMI_10X_PDEV_PARAM_SET_MCAST2UCAST_BUFFER,
  3575. WMI_10X_PDEV_PARAM_REMOVE_MCAST2UCAST_BUFFER,
  3576. WMI_10X_PDEV_PARAM_PEER_STA_PS_STATECHG_ENABLE,
  3577. WMI_10X_PDEV_PARAM_RTS_FIXED_RATE,
  3578. WMI_10X_PDEV_PARAM_CAL_PERIOD,
  3579. WMI_10X_PDEV_PARAM_ATF_STRICT_SCH,
  3580. WMI_10X_PDEV_PARAM_ATF_SCHED_DURATION,
  3581. WMI_10X_PDEV_PARAM_SET_PROMISC_MODE_CMDID,
  3582. WMI_10X_PDEV_PARAM_PDEV_RESET
  3583. };
  3584. enum wmi_10_4_pdev_param {
  3585. WMI_10_4_PDEV_PARAM_TX_CHAIN_MASK = 0x1,
  3586. WMI_10_4_PDEV_PARAM_RX_CHAIN_MASK,
  3587. WMI_10_4_PDEV_PARAM_TXPOWER_LIMIT2G,
  3588. WMI_10_4_PDEV_PARAM_TXPOWER_LIMIT5G,
  3589. WMI_10_4_PDEV_PARAM_TXPOWER_SCALE,
  3590. WMI_10_4_PDEV_PARAM_BEACON_GEN_MODE,
  3591. WMI_10_4_PDEV_PARAM_BEACON_TX_MODE,
  3592. WMI_10_4_PDEV_PARAM_RESMGR_OFFCHAN_MODE,
  3593. WMI_10_4_PDEV_PARAM_PROTECTION_MODE,
  3594. WMI_10_4_PDEV_PARAM_DYNAMIC_BW,
  3595. WMI_10_4_PDEV_PARAM_NON_AGG_SW_RETRY_TH,
  3596. WMI_10_4_PDEV_PARAM_AGG_SW_RETRY_TH,
  3597. WMI_10_4_PDEV_PARAM_STA_KICKOUT_TH,
  3598. WMI_10_4_PDEV_PARAM_AC_AGGRSIZE_SCALING,
  3599. WMI_10_4_PDEV_PARAM_LTR_ENABLE,
  3600. WMI_10_4_PDEV_PARAM_LTR_AC_LATENCY_BE,
  3601. WMI_10_4_PDEV_PARAM_LTR_AC_LATENCY_BK,
  3602. WMI_10_4_PDEV_PARAM_LTR_AC_LATENCY_VI,
  3603. WMI_10_4_PDEV_PARAM_LTR_AC_LATENCY_VO,
  3604. WMI_10_4_PDEV_PARAM_LTR_AC_LATENCY_TIMEOUT,
  3605. WMI_10_4_PDEV_PARAM_LTR_SLEEP_OVERRIDE,
  3606. WMI_10_4_PDEV_PARAM_LTR_RX_OVERRIDE,
  3607. WMI_10_4_PDEV_PARAM_LTR_TX_ACTIVITY_TIMEOUT,
  3608. WMI_10_4_PDEV_PARAM_L1SS_ENABLE,
  3609. WMI_10_4_PDEV_PARAM_DSLEEP_ENABLE,
  3610. WMI_10_4_PDEV_PARAM_PCIELP_TXBUF_FLUSH,
  3611. WMI_10_4_PDEV_PARAM_PCIELP_TXBUF_WATERMARK,
  3612. WMI_10_4_PDEV_PARAM_PCIELP_TXBUF_TMO_EN,
  3613. WMI_10_4_PDEV_PARAM_PCIELP_TXBUF_TMO_VALUE,
  3614. WMI_10_4_PDEV_PARAM_PDEV_STATS_UPDATE_PERIOD,
  3615. WMI_10_4_PDEV_PARAM_VDEV_STATS_UPDATE_PERIOD,
  3616. WMI_10_4_PDEV_PARAM_PEER_STATS_UPDATE_PERIOD,
  3617. WMI_10_4_PDEV_PARAM_BCNFLT_STATS_UPDATE_PERIOD,
  3618. WMI_10_4_PDEV_PARAM_PMF_QOS,
  3619. WMI_10_4_PDEV_PARAM_ARP_AC_OVERRIDE,
  3620. WMI_10_4_PDEV_PARAM_DCS,
  3621. WMI_10_4_PDEV_PARAM_ANI_ENABLE,
  3622. WMI_10_4_PDEV_PARAM_ANI_POLL_PERIOD,
  3623. WMI_10_4_PDEV_PARAM_ANI_LISTEN_PERIOD,
  3624. WMI_10_4_PDEV_PARAM_ANI_OFDM_LEVEL,
  3625. WMI_10_4_PDEV_PARAM_ANI_CCK_LEVEL,
  3626. WMI_10_4_PDEV_PARAM_DYNTXCHAIN,
  3627. WMI_10_4_PDEV_PARAM_PROXY_STA,
  3628. WMI_10_4_PDEV_PARAM_IDLE_PS_CONFIG,
  3629. WMI_10_4_PDEV_PARAM_POWER_GATING_SLEEP,
  3630. WMI_10_4_PDEV_PARAM_AGGR_BURST,
  3631. WMI_10_4_PDEV_PARAM_RX_DECAP_MODE,
  3632. WMI_10_4_PDEV_PARAM_FAST_CHANNEL_RESET,
  3633. WMI_10_4_PDEV_PARAM_BURST_DUR,
  3634. WMI_10_4_PDEV_PARAM_BURST_ENABLE,
  3635. WMI_10_4_PDEV_PARAM_SMART_ANTENNA_DEFAULT_ANTENNA,
  3636. WMI_10_4_PDEV_PARAM_IGMPMLD_OVERRIDE,
  3637. WMI_10_4_PDEV_PARAM_IGMPMLD_TID,
  3638. WMI_10_4_PDEV_PARAM_ANTENNA_GAIN,
  3639. WMI_10_4_PDEV_PARAM_RX_FILTER,
  3640. WMI_10_4_PDEV_SET_MCAST_TO_UCAST_TID,
  3641. WMI_10_4_PDEV_PARAM_PROXY_STA_MODE,
  3642. WMI_10_4_PDEV_PARAM_SET_MCAST2UCAST_MODE,
  3643. WMI_10_4_PDEV_PARAM_SET_MCAST2UCAST_BUFFER,
  3644. WMI_10_4_PDEV_PARAM_REMOVE_MCAST2UCAST_BUFFER,
  3645. WMI_10_4_PDEV_PEER_STA_PS_STATECHG_ENABLE,
  3646. WMI_10_4_PDEV_PARAM_IGMPMLD_AC_OVERRIDE,
  3647. WMI_10_4_PDEV_PARAM_BLOCK_INTERBSS,
  3648. WMI_10_4_PDEV_PARAM_SET_DISABLE_RESET_CMDID,
  3649. WMI_10_4_PDEV_PARAM_SET_MSDU_TTL_CMDID,
  3650. WMI_10_4_PDEV_PARAM_SET_PPDU_DURATION_CMDID,
  3651. WMI_10_4_PDEV_PARAM_TXBF_SOUND_PERIOD_CMDID,
  3652. WMI_10_4_PDEV_PARAM_SET_PROMISC_MODE_CMDID,
  3653. WMI_10_4_PDEV_PARAM_SET_BURST_MODE_CMDID,
  3654. WMI_10_4_PDEV_PARAM_EN_STATS,
  3655. WMI_10_4_PDEV_PARAM_MU_GROUP_POLICY,
  3656. WMI_10_4_PDEV_PARAM_NOISE_DETECTION,
  3657. WMI_10_4_PDEV_PARAM_NOISE_THRESHOLD,
  3658. WMI_10_4_PDEV_PARAM_DPD_ENABLE,
  3659. WMI_10_4_PDEV_PARAM_SET_MCAST_BCAST_ECHO,
  3660. WMI_10_4_PDEV_PARAM_ATF_STRICT_SCH,
  3661. WMI_10_4_PDEV_PARAM_ATF_SCHED_DURATION,
  3662. WMI_10_4_PDEV_PARAM_ANT_PLZN,
  3663. WMI_10_4_PDEV_PARAM_MGMT_RETRY_LIMIT,
  3664. WMI_10_4_PDEV_PARAM_SENSITIVITY_LEVEL,
  3665. WMI_10_4_PDEV_PARAM_SIGNED_TXPOWER_2G,
  3666. WMI_10_4_PDEV_PARAM_SIGNED_TXPOWER_5G,
  3667. WMI_10_4_PDEV_PARAM_ENABLE_PER_TID_AMSDU,
  3668. WMI_10_4_PDEV_PARAM_ENABLE_PER_TID_AMPDU,
  3669. WMI_10_4_PDEV_PARAM_CCA_THRESHOLD,
  3670. WMI_10_4_PDEV_PARAM_RTS_FIXED_RATE,
  3671. WMI_10_4_PDEV_PARAM_CAL_PERIOD,
  3672. WMI_10_4_PDEV_PARAM_PDEV_RESET,
  3673. WMI_10_4_PDEV_PARAM_WAPI_MBSSID_OFFSET,
  3674. WMI_10_4_PDEV_PARAM_ARP_SRCADDR,
  3675. WMI_10_4_PDEV_PARAM_ARP_DSTADDR,
  3676. WMI_10_4_PDEV_PARAM_TXPOWER_DECR_DB,
  3677. WMI_10_4_PDEV_PARAM_RX_BATCHMODE,
  3678. WMI_10_4_PDEV_PARAM_PACKET_AGGR_DELAY,
  3679. WMI_10_4_PDEV_PARAM_ATF_OBSS_NOISE_SCH,
  3680. WMI_10_4_PDEV_PARAM_ATF_OBSS_NOISE_SCALING_FACTOR,
  3681. WMI_10_4_PDEV_PARAM_CUST_TXPOWER_SCALE,
  3682. WMI_10_4_PDEV_PARAM_ATF_DYNAMIC_ENABLE,
  3683. WMI_10_4_PDEV_PARAM_ATF_SSID_GROUP_POLICY,
  3684. WMI_10_4_PDEV_PARAM_ENABLE_BTCOEX,
  3685. };
  3686. struct wmi_pdev_set_param_cmd {
  3687. __le32 param_id;
  3688. __le32 param_value;
  3689. } __packed;
  3690. /* valid period is 1 ~ 60000ms, unit in millisecond */
  3691. #define WMI_PDEV_PARAM_CAL_PERIOD_MAX 60000
  3692. struct wmi_pdev_get_tpc_config_cmd {
  3693. /* parameter */
  3694. __le32 param;
  3695. } __packed;
  3696. #define WMI_TPC_CONFIG_PARAM 1
  3697. #define WMI_TPC_FINAL_RATE_MAX 240
  3698. #define WMI_TPC_TX_N_CHAIN 4
  3699. #define WMI_TPC_RATE_MAX (WMI_TPC_TX_N_CHAIN * 65)
  3700. #define WMI_TPC_PREAM_TABLE_MAX 10
  3701. #define WMI_TPC_FLAG 3
  3702. #define WMI_TPC_BUF_SIZE 10
  3703. #define WMI_TPC_BEAMFORMING 2
  3704. enum wmi_tpc_table_type {
  3705. WMI_TPC_TABLE_TYPE_CDD = 0,
  3706. WMI_TPC_TABLE_TYPE_STBC = 1,
  3707. WMI_TPC_TABLE_TYPE_TXBF = 2,
  3708. };
  3709. enum wmi_tpc_config_event_flag {
  3710. WMI_TPC_CONFIG_EVENT_FLAG_TABLE_CDD = 0x1,
  3711. WMI_TPC_CONFIG_EVENT_FLAG_TABLE_STBC = 0x2,
  3712. WMI_TPC_CONFIG_EVENT_FLAG_TABLE_TXBF = 0x4,
  3713. };
  3714. struct wmi_pdev_tpc_config_event {
  3715. __le32 reg_domain;
  3716. __le32 chan_freq;
  3717. __le32 phy_mode;
  3718. __le32 twice_antenna_reduction;
  3719. __le32 twice_max_rd_power;
  3720. a_sle32 twice_antenna_gain;
  3721. __le32 power_limit;
  3722. __le32 rate_max;
  3723. __le32 num_tx_chain;
  3724. __le32 ctl;
  3725. __le32 flags;
  3726. s8 max_reg_allow_pow[WMI_TPC_TX_N_CHAIN];
  3727. s8 max_reg_allow_pow_agcdd[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
  3728. s8 max_reg_allow_pow_agstbc[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
  3729. s8 max_reg_allow_pow_agtxbf[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
  3730. u8 rates_array[WMI_TPC_RATE_MAX];
  3731. } __packed;
  3732. /* Transmit power scale factor. */
  3733. enum wmi_tp_scale {
  3734. WMI_TP_SCALE_MAX = 0, /* no scaling (default) */
  3735. WMI_TP_SCALE_50 = 1, /* 50% of max (-3 dBm) */
  3736. WMI_TP_SCALE_25 = 2, /* 25% of max (-6 dBm) */
  3737. WMI_TP_SCALE_12 = 3, /* 12% of max (-9 dBm) */
  3738. WMI_TP_SCALE_MIN = 4, /* min, but still on */
  3739. WMI_TP_SCALE_SIZE = 5, /* max num of enum */
  3740. };
  3741. struct wmi_pdev_tpc_final_table_event {
  3742. __le32 reg_domain;
  3743. __le32 chan_freq;
  3744. __le32 phy_mode;
  3745. __le32 twice_antenna_reduction;
  3746. __le32 twice_max_rd_power;
  3747. a_sle32 twice_antenna_gain;
  3748. __le32 power_limit;
  3749. __le32 rate_max;
  3750. __le32 num_tx_chain;
  3751. __le32 ctl;
  3752. __le32 flags;
  3753. s8 max_reg_allow_pow[WMI_TPC_TX_N_CHAIN];
  3754. s8 max_reg_allow_pow_agcdd[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
  3755. s8 max_reg_allow_pow_agstbc[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
  3756. s8 max_reg_allow_pow_agtxbf[WMI_TPC_TX_N_CHAIN][WMI_TPC_TX_N_CHAIN];
  3757. u8 rates_array[WMI_TPC_FINAL_RATE_MAX];
  3758. u8 ctl_power_table[WMI_TPC_BEAMFORMING][WMI_TPC_TX_N_CHAIN]
  3759. [WMI_TPC_TX_N_CHAIN];
  3760. } __packed;
  3761. struct wmi_pdev_get_tpc_table_cmd {
  3762. __le32 param;
  3763. } __packed;
  3764. enum wmi_tpc_pream_2ghz {
  3765. WMI_TPC_PREAM_2GHZ_CCK = 0,
  3766. WMI_TPC_PREAM_2GHZ_OFDM,
  3767. WMI_TPC_PREAM_2GHZ_HT20,
  3768. WMI_TPC_PREAM_2GHZ_HT40,
  3769. WMI_TPC_PREAM_2GHZ_VHT20,
  3770. WMI_TPC_PREAM_2GHZ_VHT40,
  3771. WMI_TPC_PREAM_2GHZ_VHT80,
  3772. };
  3773. enum wmi_tpc_pream_5ghz {
  3774. WMI_TPC_PREAM_5GHZ_OFDM = 1,
  3775. WMI_TPC_PREAM_5GHZ_HT20,
  3776. WMI_TPC_PREAM_5GHZ_HT40,
  3777. WMI_TPC_PREAM_5GHZ_VHT20,
  3778. WMI_TPC_PREAM_5GHZ_VHT40,
  3779. WMI_TPC_PREAM_5GHZ_VHT80,
  3780. WMI_TPC_PREAM_5GHZ_HTCUP,
  3781. };
  3782. struct wmi_pdev_chanlist_update_event {
  3783. /* number of channels */
  3784. __le32 num_chan;
  3785. /* array of channels */
  3786. struct wmi_channel channel_list[1];
  3787. } __packed;
  3788. #define WMI_MAX_DEBUG_MESG (sizeof(u32) * 32)
  3789. struct wmi_debug_mesg_event {
  3790. /* message buffer, NULL terminated */
  3791. char bufp[WMI_MAX_DEBUG_MESG];
  3792. } __packed;
  3793. enum {
  3794. /* P2P device */
  3795. VDEV_SUBTYPE_P2PDEV = 0,
  3796. /* P2P client */
  3797. VDEV_SUBTYPE_P2PCLI,
  3798. /* P2P GO */
  3799. VDEV_SUBTYPE_P2PGO,
  3800. /* BT3.0 HS */
  3801. VDEV_SUBTYPE_BT,
  3802. };
  3803. struct wmi_pdev_set_channel_cmd {
  3804. /* idnore power , only use flags , mode and freq */
  3805. struct wmi_channel chan;
  3806. } __packed;
  3807. struct wmi_pdev_pktlog_enable_cmd {
  3808. __le32 ev_bitmap;
  3809. } __packed;
  3810. /* Customize the DSCP (bit) to TID (0-7) mapping for QOS */
  3811. #define WMI_DSCP_MAP_MAX (64)
  3812. struct wmi_pdev_set_dscp_tid_map_cmd {
  3813. /* map indicating DSCP to TID conversion */
  3814. __le32 dscp_to_tid_map[WMI_DSCP_MAP_MAX];
  3815. } __packed;
  3816. enum mcast_bcast_rate_id {
  3817. WMI_SET_MCAST_RATE,
  3818. WMI_SET_BCAST_RATE
  3819. };
  3820. struct mcast_bcast_rate {
  3821. enum mcast_bcast_rate_id rate_id;
  3822. __le32 rate;
  3823. } __packed;
  3824. struct wmi_wmm_params {
  3825. __le32 cwmin;
  3826. __le32 cwmax;
  3827. __le32 aifs;
  3828. __le32 txop;
  3829. __le32 acm;
  3830. __le32 no_ack;
  3831. } __packed;
  3832. struct wmi_pdev_set_wmm_params {
  3833. struct wmi_wmm_params ac_be;
  3834. struct wmi_wmm_params ac_bk;
  3835. struct wmi_wmm_params ac_vi;
  3836. struct wmi_wmm_params ac_vo;
  3837. } __packed;
  3838. struct wmi_wmm_params_arg {
  3839. u32 cwmin;
  3840. u32 cwmax;
  3841. u32 aifs;
  3842. u32 txop;
  3843. u32 acm;
  3844. u32 no_ack;
  3845. };
  3846. struct wmi_wmm_params_all_arg {
  3847. struct wmi_wmm_params_arg ac_be;
  3848. struct wmi_wmm_params_arg ac_bk;
  3849. struct wmi_wmm_params_arg ac_vi;
  3850. struct wmi_wmm_params_arg ac_vo;
  3851. };
  3852. struct wmi_pdev_stats_tx {
  3853. /* Num HTT cookies queued to dispatch list */
  3854. __le32 comp_queued;
  3855. /* Num HTT cookies dispatched */
  3856. __le32 comp_delivered;
  3857. /* Num MSDU queued to WAL */
  3858. __le32 msdu_enqued;
  3859. /* Num MPDU queue to WAL */
  3860. __le32 mpdu_enqued;
  3861. /* Num MSDUs dropped by WMM limit */
  3862. __le32 wmm_drop;
  3863. /* Num Local frames queued */
  3864. __le32 local_enqued;
  3865. /* Num Local frames done */
  3866. __le32 local_freed;
  3867. /* Num queued to HW */
  3868. __le32 hw_queued;
  3869. /* Num PPDU reaped from HW */
  3870. __le32 hw_reaped;
  3871. /* Num underruns */
  3872. __le32 underrun;
  3873. /* Num PPDUs cleaned up in TX abort */
  3874. __le32 tx_abort;
  3875. /* Num MPDUs requed by SW */
  3876. __le32 mpdus_requed;
  3877. /* excessive retries */
  3878. __le32 tx_ko;
  3879. /* data hw rate code */
  3880. __le32 data_rc;
  3881. /* Scheduler self triggers */
  3882. __le32 self_triggers;
  3883. /* frames dropped due to excessive sw retries */
  3884. __le32 sw_retry_failure;
  3885. /* illegal rate phy errors */
  3886. __le32 illgl_rate_phy_err;
  3887. /* wal pdev continuous xretry */
  3888. __le32 pdev_cont_xretry;
  3889. /* wal pdev continous xretry */
  3890. __le32 pdev_tx_timeout;
  3891. /* wal pdev resets */
  3892. __le32 pdev_resets;
  3893. /* frames dropped due to non-availability of stateless TIDs */
  3894. __le32 stateless_tid_alloc_failure;
  3895. __le32 phy_underrun;
  3896. /* MPDU is more than txop limit */
  3897. __le32 txop_ovf;
  3898. } __packed;
  3899. struct wmi_10_4_pdev_stats_tx {
  3900. /* Num HTT cookies queued to dispatch list */
  3901. __le32 comp_queued;
  3902. /* Num HTT cookies dispatched */
  3903. __le32 comp_delivered;
  3904. /* Num MSDU queued to WAL */
  3905. __le32 msdu_enqued;
  3906. /* Num MPDU queue to WAL */
  3907. __le32 mpdu_enqued;
  3908. /* Num MSDUs dropped by WMM limit */
  3909. __le32 wmm_drop;
  3910. /* Num Local frames queued */
  3911. __le32 local_enqued;
  3912. /* Num Local frames done */
  3913. __le32 local_freed;
  3914. /* Num queued to HW */
  3915. __le32 hw_queued;
  3916. /* Num PPDU reaped from HW */
  3917. __le32 hw_reaped;
  3918. /* Num underruns */
  3919. __le32 underrun;
  3920. /* HW Paused. */
  3921. __le32 hw_paused;
  3922. /* Num PPDUs cleaned up in TX abort */
  3923. __le32 tx_abort;
  3924. /* Num MPDUs requed by SW */
  3925. __le32 mpdus_requed;
  3926. /* excessive retries */
  3927. __le32 tx_ko;
  3928. /* data hw rate code */
  3929. __le32 data_rc;
  3930. /* Scheduler self triggers */
  3931. __le32 self_triggers;
  3932. /* frames dropped due to excessive sw retries */
  3933. __le32 sw_retry_failure;
  3934. /* illegal rate phy errors */
  3935. __le32 illgl_rate_phy_err;
  3936. /* wal pdev continuous xretry */
  3937. __le32 pdev_cont_xretry;
  3938. /* wal pdev tx timeouts */
  3939. __le32 pdev_tx_timeout;
  3940. /* wal pdev resets */
  3941. __le32 pdev_resets;
  3942. /* frames dropped due to non-availability of stateless TIDs */
  3943. __le32 stateless_tid_alloc_failure;
  3944. __le32 phy_underrun;
  3945. /* MPDU is more than txop limit */
  3946. __le32 txop_ovf;
  3947. /* Number of Sequences posted */
  3948. __le32 seq_posted;
  3949. /* Number of Sequences failed queueing */
  3950. __le32 seq_failed_queueing;
  3951. /* Number of Sequences completed */
  3952. __le32 seq_completed;
  3953. /* Number of Sequences restarted */
  3954. __le32 seq_restarted;
  3955. /* Number of MU Sequences posted */
  3956. __le32 mu_seq_posted;
  3957. /* Num MPDUs flushed by SW, HWPAUSED,SW TXABORT(Reset,channel change) */
  3958. __le32 mpdus_sw_flush;
  3959. /* Num MPDUs filtered by HW, all filter condition (TTL expired) */
  3960. __le32 mpdus_hw_filter;
  3961. /* Num MPDUs truncated by PDG
  3962. * (TXOP, TBTT, PPDU_duration based on rate, dyn_bw)
  3963. */
  3964. __le32 mpdus_truncated;
  3965. /* Num MPDUs that was tried but didn't receive ACK or BA */
  3966. __le32 mpdus_ack_failed;
  3967. /* Num MPDUs that was dropped due to expiry. */
  3968. __le32 mpdus_expired;
  3969. } __packed;
  3970. struct wmi_pdev_stats_rx {
  3971. /* Cnts any change in ring routing mid-ppdu */
  3972. __le32 mid_ppdu_route_change;
  3973. /* Total number of statuses processed */
  3974. __le32 status_rcvd;
  3975. /* Extra frags on rings 0-3 */
  3976. __le32 r0_frags;
  3977. __le32 r1_frags;
  3978. __le32 r2_frags;
  3979. __le32 r3_frags;
  3980. /* MSDUs / MPDUs delivered to HTT */
  3981. __le32 htt_msdus;
  3982. __le32 htt_mpdus;
  3983. /* MSDUs / MPDUs delivered to local stack */
  3984. __le32 loc_msdus;
  3985. __le32 loc_mpdus;
  3986. /* AMSDUs that have more MSDUs than the status ring size */
  3987. __le32 oversize_amsdu;
  3988. /* Number of PHY errors */
  3989. __le32 phy_errs;
  3990. /* Number of PHY errors drops */
  3991. __le32 phy_err_drop;
  3992. /* Number of mpdu errors - FCS, MIC, ENC etc. */
  3993. __le32 mpdu_errs;
  3994. } __packed;
  3995. struct wmi_pdev_stats_peer {
  3996. /* REMOVE THIS ONCE REAL PEER STAT COUNTERS ARE ADDED */
  3997. __le32 dummy;
  3998. } __packed;
  3999. enum wmi_stats_id {
  4000. WMI_STAT_PEER = BIT(0),
  4001. WMI_STAT_AP = BIT(1),
  4002. WMI_STAT_PDEV = BIT(2),
  4003. WMI_STAT_VDEV = BIT(3),
  4004. WMI_STAT_BCNFLT = BIT(4),
  4005. WMI_STAT_VDEV_RATE = BIT(5),
  4006. };
  4007. enum wmi_10_4_stats_id {
  4008. WMI_10_4_STAT_PEER = BIT(0),
  4009. WMI_10_4_STAT_AP = BIT(1),
  4010. WMI_10_4_STAT_INST = BIT(2),
  4011. WMI_10_4_STAT_PEER_EXTD = BIT(3),
  4012. WMI_10_4_STAT_VDEV_EXTD = BIT(4),
  4013. };
  4014. struct wlan_inst_rssi_args {
  4015. __le16 cfg_retry_count;
  4016. __le16 retry_count;
  4017. };
  4018. struct wmi_request_stats_cmd {
  4019. __le32 stats_id;
  4020. __le32 vdev_id;
  4021. /* peer MAC address */
  4022. struct wmi_mac_addr peer_macaddr;
  4023. /* Instantaneous RSSI arguments */
  4024. struct wlan_inst_rssi_args inst_rssi_args;
  4025. } __packed;
  4026. /* Suspend option */
  4027. enum {
  4028. /* suspend */
  4029. WMI_PDEV_SUSPEND,
  4030. /* suspend and disable all interrupts */
  4031. WMI_PDEV_SUSPEND_AND_DISABLE_INTR,
  4032. };
  4033. struct wmi_pdev_suspend_cmd {
  4034. /* suspend option sent to target */
  4035. __le32 suspend_opt;
  4036. } __packed;
  4037. struct wmi_stats_event {
  4038. __le32 stats_id; /* WMI_STAT_ */
  4039. /*
  4040. * number of pdev stats event structures
  4041. * (wmi_pdev_stats) 0 or 1
  4042. */
  4043. __le32 num_pdev_stats;
  4044. /*
  4045. * number of vdev stats event structures
  4046. * (wmi_vdev_stats) 0 or max vdevs
  4047. */
  4048. __le32 num_vdev_stats;
  4049. /*
  4050. * number of peer stats event structures
  4051. * (wmi_peer_stats) 0 or max peers
  4052. */
  4053. __le32 num_peer_stats;
  4054. __le32 num_bcnflt_stats;
  4055. /*
  4056. * followed by
  4057. * num_pdev_stats * size of(struct wmi_pdev_stats)
  4058. * num_vdev_stats * size of(struct wmi_vdev_stats)
  4059. * num_peer_stats * size of(struct wmi_peer_stats)
  4060. *
  4061. * By having a zero sized array, the pointer to data area
  4062. * becomes available without increasing the struct size
  4063. */
  4064. u8 data[0];
  4065. } __packed;
  4066. struct wmi_10_2_stats_event {
  4067. __le32 stats_id; /* %WMI_REQUEST_ */
  4068. __le32 num_pdev_stats;
  4069. __le32 num_pdev_ext_stats;
  4070. __le32 num_vdev_stats;
  4071. __le32 num_peer_stats;
  4072. __le32 num_bcnflt_stats;
  4073. u8 data[0];
  4074. } __packed;
  4075. /*
  4076. * PDEV statistics
  4077. * TODO: add all PDEV stats here
  4078. */
  4079. struct wmi_pdev_stats_base {
  4080. __le32 chan_nf;
  4081. __le32 tx_frame_count; /* Cycles spent transmitting frames */
  4082. __le32 rx_frame_count; /* Cycles spent receiving frames */
  4083. __le32 rx_clear_count; /* Total channel busy time, evidently */
  4084. __le32 cycle_count; /* Total on-channel time */
  4085. __le32 phy_err_count;
  4086. __le32 chan_tx_pwr;
  4087. } __packed;
  4088. struct wmi_pdev_stats {
  4089. struct wmi_pdev_stats_base base;
  4090. struct wmi_pdev_stats_tx tx;
  4091. struct wmi_pdev_stats_rx rx;
  4092. struct wmi_pdev_stats_peer peer;
  4093. } __packed;
  4094. struct wmi_pdev_stats_extra {
  4095. __le32 ack_rx_bad;
  4096. __le32 rts_bad;
  4097. __le32 rts_good;
  4098. __le32 fcs_bad;
  4099. __le32 no_beacons;
  4100. __le32 mib_int_count;
  4101. } __packed;
  4102. struct wmi_10x_pdev_stats {
  4103. struct wmi_pdev_stats_base base;
  4104. struct wmi_pdev_stats_tx tx;
  4105. struct wmi_pdev_stats_rx rx;
  4106. struct wmi_pdev_stats_peer peer;
  4107. struct wmi_pdev_stats_extra extra;
  4108. } __packed;
  4109. struct wmi_pdev_stats_mem {
  4110. __le32 dram_free;
  4111. __le32 iram_free;
  4112. } __packed;
  4113. struct wmi_10_2_pdev_stats {
  4114. struct wmi_pdev_stats_base base;
  4115. struct wmi_pdev_stats_tx tx;
  4116. __le32 mc_drop;
  4117. struct wmi_pdev_stats_rx rx;
  4118. __le32 pdev_rx_timeout;
  4119. struct wmi_pdev_stats_mem mem;
  4120. struct wmi_pdev_stats_peer peer;
  4121. struct wmi_pdev_stats_extra extra;
  4122. } __packed;
  4123. struct wmi_10_4_pdev_stats {
  4124. struct wmi_pdev_stats_base base;
  4125. struct wmi_10_4_pdev_stats_tx tx;
  4126. struct wmi_pdev_stats_rx rx;
  4127. __le32 rx_ovfl_errs;
  4128. struct wmi_pdev_stats_mem mem;
  4129. __le32 sram_free_size;
  4130. struct wmi_pdev_stats_extra extra;
  4131. } __packed;
  4132. /*
  4133. * VDEV statistics
  4134. */
  4135. #define WMI_VDEV_STATS_FTM_COUNT_VALID BIT(31)
  4136. #define WMI_VDEV_STATS_FTM_COUNT_LSB 0
  4137. #define WMI_VDEV_STATS_FTM_COUNT_MASK 0x7fffffff
  4138. struct wmi_vdev_stats {
  4139. __le32 vdev_id;
  4140. } __packed;
  4141. struct wmi_vdev_stats_extd {
  4142. __le32 vdev_id;
  4143. __le32 ppdu_aggr_cnt;
  4144. __le32 ppdu_noack;
  4145. __le32 mpdu_queued;
  4146. __le32 ppdu_nonaggr_cnt;
  4147. __le32 mpdu_sw_requeued;
  4148. __le32 mpdu_suc_retry;
  4149. __le32 mpdu_suc_multitry;
  4150. __le32 mpdu_fail_retry;
  4151. __le32 tx_ftm_suc;
  4152. __le32 tx_ftm_suc_retry;
  4153. __le32 tx_ftm_fail;
  4154. __le32 rx_ftmr_cnt;
  4155. __le32 rx_ftmr_dup_cnt;
  4156. __le32 rx_iftmr_cnt;
  4157. __le32 rx_iftmr_dup_cnt;
  4158. __le32 reserved[6];
  4159. } __packed;
  4160. /*
  4161. * peer statistics.
  4162. * TODO: add more stats
  4163. */
  4164. struct wmi_peer_stats {
  4165. struct wmi_mac_addr peer_macaddr;
  4166. __le32 peer_rssi;
  4167. __le32 peer_tx_rate;
  4168. } __packed;
  4169. struct wmi_10x_peer_stats {
  4170. struct wmi_peer_stats old;
  4171. __le32 peer_rx_rate;
  4172. } __packed;
  4173. struct wmi_10_2_peer_stats {
  4174. struct wmi_peer_stats old;
  4175. __le32 peer_rx_rate;
  4176. __le32 current_per;
  4177. __le32 retries;
  4178. __le32 tx_rate_count;
  4179. __le32 max_4ms_frame_len;
  4180. __le32 total_sub_frames;
  4181. __le32 tx_bytes;
  4182. __le32 num_pkt_loss_overflow[4];
  4183. __le32 num_pkt_loss_excess_retry[4];
  4184. } __packed;
  4185. struct wmi_10_2_4_peer_stats {
  4186. struct wmi_10_2_peer_stats common;
  4187. __le32 peer_rssi_changed;
  4188. } __packed;
  4189. struct wmi_10_2_4_ext_peer_stats {
  4190. struct wmi_10_2_peer_stats common;
  4191. __le32 peer_rssi_changed;
  4192. __le32 rx_duration;
  4193. } __packed;
  4194. struct wmi_10_4_peer_stats {
  4195. struct wmi_mac_addr peer_macaddr;
  4196. __le32 peer_rssi;
  4197. __le32 peer_rssi_seq_num;
  4198. __le32 peer_tx_rate;
  4199. __le32 peer_rx_rate;
  4200. __le32 current_per;
  4201. __le32 retries;
  4202. __le32 tx_rate_count;
  4203. __le32 max_4ms_frame_len;
  4204. __le32 total_sub_frames;
  4205. __le32 tx_bytes;
  4206. __le32 num_pkt_loss_overflow[4];
  4207. __le32 num_pkt_loss_excess_retry[4];
  4208. __le32 peer_rssi_changed;
  4209. } __packed;
  4210. struct wmi_10_4_peer_extd_stats {
  4211. struct wmi_mac_addr peer_macaddr;
  4212. __le32 inactive_time;
  4213. __le32 peer_chain_rssi;
  4214. __le32 rx_duration;
  4215. __le32 reserved[10];
  4216. } __packed;
  4217. struct wmi_10_4_bss_bcn_stats {
  4218. __le32 vdev_id;
  4219. __le32 bss_bcns_dropped;
  4220. __le32 bss_bcn_delivered;
  4221. } __packed;
  4222. struct wmi_10_4_bss_bcn_filter_stats {
  4223. __le32 bcns_dropped;
  4224. __le32 bcns_delivered;
  4225. __le32 active_filters;
  4226. struct wmi_10_4_bss_bcn_stats bss_stats;
  4227. } __packed;
  4228. struct wmi_10_2_pdev_ext_stats {
  4229. __le32 rx_rssi_comb;
  4230. __le32 rx_rssi[4];
  4231. __le32 rx_mcs[10];
  4232. __le32 tx_mcs[10];
  4233. __le32 ack_rssi;
  4234. } __packed;
  4235. struct wmi_vdev_create_cmd {
  4236. __le32 vdev_id;
  4237. __le32 vdev_type;
  4238. __le32 vdev_subtype;
  4239. struct wmi_mac_addr vdev_macaddr;
  4240. } __packed;
  4241. enum wmi_vdev_type {
  4242. WMI_VDEV_TYPE_AP = 1,
  4243. WMI_VDEV_TYPE_STA = 2,
  4244. WMI_VDEV_TYPE_IBSS = 3,
  4245. WMI_VDEV_TYPE_MONITOR = 4,
  4246. };
  4247. enum wmi_vdev_subtype {
  4248. WMI_VDEV_SUBTYPE_NONE,
  4249. WMI_VDEV_SUBTYPE_P2P_DEVICE,
  4250. WMI_VDEV_SUBTYPE_P2P_CLIENT,
  4251. WMI_VDEV_SUBTYPE_P2P_GO,
  4252. WMI_VDEV_SUBTYPE_PROXY_STA,
  4253. WMI_VDEV_SUBTYPE_MESH_11S,
  4254. WMI_VDEV_SUBTYPE_MESH_NON_11S,
  4255. };
  4256. enum wmi_vdev_subtype_legacy {
  4257. WMI_VDEV_SUBTYPE_LEGACY_NONE = 0,
  4258. WMI_VDEV_SUBTYPE_LEGACY_P2P_DEV = 1,
  4259. WMI_VDEV_SUBTYPE_LEGACY_P2P_CLI = 2,
  4260. WMI_VDEV_SUBTYPE_LEGACY_P2P_GO = 3,
  4261. WMI_VDEV_SUBTYPE_LEGACY_PROXY_STA = 4,
  4262. };
  4263. enum wmi_vdev_subtype_10_2_4 {
  4264. WMI_VDEV_SUBTYPE_10_2_4_NONE = 0,
  4265. WMI_VDEV_SUBTYPE_10_2_4_P2P_DEV = 1,
  4266. WMI_VDEV_SUBTYPE_10_2_4_P2P_CLI = 2,
  4267. WMI_VDEV_SUBTYPE_10_2_4_P2P_GO = 3,
  4268. WMI_VDEV_SUBTYPE_10_2_4_PROXY_STA = 4,
  4269. WMI_VDEV_SUBTYPE_10_2_4_MESH_11S = 5,
  4270. };
  4271. enum wmi_vdev_subtype_10_4 {
  4272. WMI_VDEV_SUBTYPE_10_4_NONE = 0,
  4273. WMI_VDEV_SUBTYPE_10_4_P2P_DEV = 1,
  4274. WMI_VDEV_SUBTYPE_10_4_P2P_CLI = 2,
  4275. WMI_VDEV_SUBTYPE_10_4_P2P_GO = 3,
  4276. WMI_VDEV_SUBTYPE_10_4_PROXY_STA = 4,
  4277. WMI_VDEV_SUBTYPE_10_4_MESH_NON_11S = 5,
  4278. WMI_VDEV_SUBTYPE_10_4_MESH_11S = 6,
  4279. };
  4280. /* values for vdev_subtype */
  4281. /* values for vdev_start_request flags */
  4282. /*
  4283. * Indicates that AP VDEV uses hidden ssid. only valid for
  4284. * AP/GO
  4285. */
  4286. #define WMI_VDEV_START_HIDDEN_SSID (1 << 0)
  4287. /*
  4288. * Indicates if robust management frame/management frame
  4289. * protection is enabled. For GO/AP vdevs, it indicates that
  4290. * it may support station/client associations with RMF enabled.
  4291. * For STA/client vdevs, it indicates that sta will
  4292. * associate with AP with RMF enabled.
  4293. */
  4294. #define WMI_VDEV_START_PMF_ENABLED (1 << 1)
  4295. struct wmi_p2p_noa_descriptor {
  4296. __le32 type_count; /* 255: continuous schedule, 0: reserved */
  4297. __le32 duration; /* Absent period duration in micro seconds */
  4298. __le32 interval; /* Absent period interval in micro seconds */
  4299. __le32 start_time; /* 32 bit tsf time when in starts */
  4300. } __packed;
  4301. struct wmi_vdev_start_request_cmd {
  4302. /* WMI channel */
  4303. struct wmi_channel chan;
  4304. /* unique id identifying the VDEV, generated by the caller */
  4305. __le32 vdev_id;
  4306. /* requestor id identifying the caller module */
  4307. __le32 requestor_id;
  4308. /* beacon interval from received beacon */
  4309. __le32 beacon_interval;
  4310. /* DTIM Period from the received beacon */
  4311. __le32 dtim_period;
  4312. /* Flags */
  4313. __le32 flags;
  4314. /* ssid field. Only valid for AP/GO/IBSS/BTAmp VDEV type. */
  4315. struct wmi_ssid ssid;
  4316. /* beacon/probe response xmit rate. Applicable for SoftAP. */
  4317. __le32 bcn_tx_rate;
  4318. /* beacon/probe response xmit power. Applicable for SoftAP. */
  4319. __le32 bcn_tx_power;
  4320. /* number of p2p NOA descriptor(s) from scan entry */
  4321. __le32 num_noa_descriptors;
  4322. /*
  4323. * Disable H/W ack. This used by WMI_VDEV_RESTART_REQUEST_CMDID.
  4324. * During CAC, Our HW shouldn't ack ditected frames
  4325. */
  4326. __le32 disable_hw_ack;
  4327. /* actual p2p NOA descriptor from scan entry */
  4328. struct wmi_p2p_noa_descriptor noa_descriptors[2];
  4329. } __packed;
  4330. struct wmi_vdev_restart_request_cmd {
  4331. struct wmi_vdev_start_request_cmd vdev_start_request_cmd;
  4332. } __packed;
  4333. struct wmi_vdev_start_request_arg {
  4334. u32 vdev_id;
  4335. struct wmi_channel_arg channel;
  4336. u32 bcn_intval;
  4337. u32 dtim_period;
  4338. u8 *ssid;
  4339. u32 ssid_len;
  4340. u32 bcn_tx_rate;
  4341. u32 bcn_tx_power;
  4342. bool disable_hw_ack;
  4343. bool hidden_ssid;
  4344. bool pmf_enabled;
  4345. };
  4346. struct wmi_vdev_delete_cmd {
  4347. /* unique id identifying the VDEV, generated by the caller */
  4348. __le32 vdev_id;
  4349. } __packed;
  4350. struct wmi_vdev_up_cmd {
  4351. __le32 vdev_id;
  4352. __le32 vdev_assoc_id;
  4353. struct wmi_mac_addr vdev_bssid;
  4354. } __packed;
  4355. struct wmi_vdev_stop_cmd {
  4356. __le32 vdev_id;
  4357. } __packed;
  4358. struct wmi_vdev_down_cmd {
  4359. __le32 vdev_id;
  4360. } __packed;
  4361. struct wmi_vdev_standby_response_cmd {
  4362. /* unique id identifying the VDEV, generated by the caller */
  4363. __le32 vdev_id;
  4364. } __packed;
  4365. struct wmi_vdev_resume_response_cmd {
  4366. /* unique id identifying the VDEV, generated by the caller */
  4367. __le32 vdev_id;
  4368. } __packed;
  4369. struct wmi_vdev_set_param_cmd {
  4370. __le32 vdev_id;
  4371. __le32 param_id;
  4372. __le32 param_value;
  4373. } __packed;
  4374. #define WMI_MAX_KEY_INDEX 3
  4375. #define WMI_MAX_KEY_LEN 32
  4376. #define WMI_KEY_PAIRWISE 0x00
  4377. #define WMI_KEY_GROUP 0x01
  4378. #define WMI_KEY_TX_USAGE 0x02 /* default tx key - static wep */
  4379. struct wmi_key_seq_counter {
  4380. __le32 key_seq_counter_l;
  4381. __le32 key_seq_counter_h;
  4382. } __packed;
  4383. #define WMI_CIPHER_NONE 0x0 /* clear key */
  4384. #define WMI_CIPHER_WEP 0x1
  4385. #define WMI_CIPHER_TKIP 0x2
  4386. #define WMI_CIPHER_AES_OCB 0x3
  4387. #define WMI_CIPHER_AES_CCM 0x4
  4388. #define WMI_CIPHER_WAPI 0x5
  4389. #define WMI_CIPHER_CKIP 0x6
  4390. #define WMI_CIPHER_AES_CMAC 0x7
  4391. #define WMI_CIPHER_AES_GCM 0x8
  4392. struct wmi_vdev_install_key_cmd {
  4393. __le32 vdev_id;
  4394. struct wmi_mac_addr peer_macaddr;
  4395. __le32 key_idx;
  4396. __le32 key_flags;
  4397. __le32 key_cipher; /* %WMI_CIPHER_ */
  4398. struct wmi_key_seq_counter key_rsc_counter;
  4399. struct wmi_key_seq_counter key_global_rsc_counter;
  4400. struct wmi_key_seq_counter key_tsc_counter;
  4401. u8 wpi_key_rsc_counter[16];
  4402. u8 wpi_key_tsc_counter[16];
  4403. __le32 key_len;
  4404. __le32 key_txmic_len;
  4405. __le32 key_rxmic_len;
  4406. /* contains key followed by tx mic followed by rx mic */
  4407. u8 key_data[0];
  4408. } __packed;
  4409. struct wmi_vdev_install_key_arg {
  4410. u32 vdev_id;
  4411. const u8 *macaddr;
  4412. u32 key_idx;
  4413. u32 key_flags;
  4414. u32 key_cipher;
  4415. u32 key_len;
  4416. u32 key_txmic_len;
  4417. u32 key_rxmic_len;
  4418. const void *key_data;
  4419. };
  4420. /*
  4421. * vdev fixed rate format:
  4422. * - preamble - b7:b6 - see WMI_RATE_PREMABLE_
  4423. * - nss - b5:b4 - ss number (0 mean 1ss)
  4424. * - rate_mcs - b3:b0 - as below
  4425. * CCK: 0 - 11Mbps, 1 - 5,5Mbps, 2 - 2Mbps, 3 - 1Mbps,
  4426. * 4 - 11Mbps (s), 5 - 5,5Mbps (s), 6 - 2Mbps (s)
  4427. * OFDM: 0 - 48Mbps, 1 - 24Mbps, 2 - 12Mbps, 3 - 6Mbps,
  4428. * 4 - 54Mbps, 5 - 36Mbps, 6 - 18Mbps, 7 - 9Mbps
  4429. * HT/VHT: MCS index
  4430. */
  4431. /* Preamble types to be used with VDEV fixed rate configuration */
  4432. enum wmi_rate_preamble {
  4433. WMI_RATE_PREAMBLE_OFDM,
  4434. WMI_RATE_PREAMBLE_CCK,
  4435. WMI_RATE_PREAMBLE_HT,
  4436. WMI_RATE_PREAMBLE_VHT,
  4437. };
  4438. #define ATH10K_HW_NSS(rate) (1 + (((rate) >> 4) & 0x3))
  4439. #define ATH10K_HW_PREAMBLE(rate) (((rate) >> 6) & 0x3)
  4440. #define ATH10K_HW_MCS_RATE(rate) ((rate) & 0xf)
  4441. #define ATH10K_HW_LEGACY_RATE(rate) ((rate) & 0x3f)
  4442. #define ATH10K_HW_BW(flags) (((flags) >> 3) & 0x3)
  4443. #define ATH10K_HW_GI(flags) (((flags) >> 5) & 0x1)
  4444. #define ATH10K_HW_RATECODE(rate, nss, preamble) \
  4445. (((preamble) << 6) | ((nss) << 4) | (rate))
  4446. #define VHT_MCS_NUM 10
  4447. #define VHT_BW_NUM 4
  4448. #define VHT_NSS_NUM 4
  4449. /* Value to disable fixed rate setting */
  4450. #define WMI_FIXED_RATE_NONE (0xff)
  4451. struct wmi_vdev_param_map {
  4452. u32 rts_threshold;
  4453. u32 fragmentation_threshold;
  4454. u32 beacon_interval;
  4455. u32 listen_interval;
  4456. u32 multicast_rate;
  4457. u32 mgmt_tx_rate;
  4458. u32 slot_time;
  4459. u32 preamble;
  4460. u32 swba_time;
  4461. u32 wmi_vdev_stats_update_period;
  4462. u32 wmi_vdev_pwrsave_ageout_time;
  4463. u32 wmi_vdev_host_swba_interval;
  4464. u32 dtim_period;
  4465. u32 wmi_vdev_oc_scheduler_air_time_limit;
  4466. u32 wds;
  4467. u32 atim_window;
  4468. u32 bmiss_count_max;
  4469. u32 bmiss_first_bcnt;
  4470. u32 bmiss_final_bcnt;
  4471. u32 feature_wmm;
  4472. u32 chwidth;
  4473. u32 chextoffset;
  4474. u32 disable_htprotection;
  4475. u32 sta_quickkickout;
  4476. u32 mgmt_rate;
  4477. u32 protection_mode;
  4478. u32 fixed_rate;
  4479. u32 sgi;
  4480. u32 ldpc;
  4481. u32 tx_stbc;
  4482. u32 rx_stbc;
  4483. u32 intra_bss_fwd;
  4484. u32 def_keyid;
  4485. u32 nss;
  4486. u32 bcast_data_rate;
  4487. u32 mcast_data_rate;
  4488. u32 mcast_indicate;
  4489. u32 dhcp_indicate;
  4490. u32 unknown_dest_indicate;
  4491. u32 ap_keepalive_min_idle_inactive_time_secs;
  4492. u32 ap_keepalive_max_idle_inactive_time_secs;
  4493. u32 ap_keepalive_max_unresponsive_time_secs;
  4494. u32 ap_enable_nawds;
  4495. u32 mcast2ucast_set;
  4496. u32 enable_rtscts;
  4497. u32 txbf;
  4498. u32 packet_powersave;
  4499. u32 drop_unencry;
  4500. u32 tx_encap_type;
  4501. u32 ap_detect_out_of_sync_sleeping_sta_time_secs;
  4502. u32 rc_num_retries;
  4503. u32 cabq_maxdur;
  4504. u32 mfptest_set;
  4505. u32 rts_fixed_rate;
  4506. u32 vht_sgimask;
  4507. u32 vht80_ratemask;
  4508. u32 early_rx_adjust_enable;
  4509. u32 early_rx_tgt_bmiss_num;
  4510. u32 early_rx_bmiss_sample_cycle;
  4511. u32 early_rx_slop_step;
  4512. u32 early_rx_init_slop;
  4513. u32 early_rx_adjust_pause;
  4514. u32 proxy_sta;
  4515. u32 meru_vc;
  4516. u32 rx_decap_type;
  4517. u32 bw_nss_ratemask;
  4518. u32 inc_tsf;
  4519. u32 dec_tsf;
  4520. };
  4521. #define WMI_VDEV_PARAM_UNSUPPORTED 0
  4522. /* the definition of different VDEV parameters */
  4523. enum wmi_vdev_param {
  4524. /* RTS Threshold */
  4525. WMI_VDEV_PARAM_RTS_THRESHOLD = 0x1,
  4526. /* Fragmentation threshold */
  4527. WMI_VDEV_PARAM_FRAGMENTATION_THRESHOLD,
  4528. /* beacon interval in TUs */
  4529. WMI_VDEV_PARAM_BEACON_INTERVAL,
  4530. /* Listen interval in TUs */
  4531. WMI_VDEV_PARAM_LISTEN_INTERVAL,
  4532. /* multicast rate in Mbps */
  4533. WMI_VDEV_PARAM_MULTICAST_RATE,
  4534. /* management frame rate in Mbps */
  4535. WMI_VDEV_PARAM_MGMT_TX_RATE,
  4536. /* slot time (long vs short) */
  4537. WMI_VDEV_PARAM_SLOT_TIME,
  4538. /* preamble (long vs short) */
  4539. WMI_VDEV_PARAM_PREAMBLE,
  4540. /* SWBA time (time before tbtt in msec) */
  4541. WMI_VDEV_PARAM_SWBA_TIME,
  4542. /* time period for updating VDEV stats */
  4543. WMI_VDEV_STATS_UPDATE_PERIOD,
  4544. /* age out time in msec for frames queued for station in power save */
  4545. WMI_VDEV_PWRSAVE_AGEOUT_TIME,
  4546. /*
  4547. * Host SWBA interval (time in msec before tbtt for SWBA event
  4548. * generation).
  4549. */
  4550. WMI_VDEV_HOST_SWBA_INTERVAL,
  4551. /* DTIM period (specified in units of num beacon intervals) */
  4552. WMI_VDEV_PARAM_DTIM_PERIOD,
  4553. /*
  4554. * scheduler air time limit for this VDEV. used by off chan
  4555. * scheduler.
  4556. */
  4557. WMI_VDEV_OC_SCHEDULER_AIR_TIME_LIMIT,
  4558. /* enable/dsiable WDS for this VDEV */
  4559. WMI_VDEV_PARAM_WDS,
  4560. /* ATIM Window */
  4561. WMI_VDEV_PARAM_ATIM_WINDOW,
  4562. /* BMISS max */
  4563. WMI_VDEV_PARAM_BMISS_COUNT_MAX,
  4564. /* BMISS first time */
  4565. WMI_VDEV_PARAM_BMISS_FIRST_BCNT,
  4566. /* BMISS final time */
  4567. WMI_VDEV_PARAM_BMISS_FINAL_BCNT,
  4568. /* WMM enables/disabled */
  4569. WMI_VDEV_PARAM_FEATURE_WMM,
  4570. /* Channel width */
  4571. WMI_VDEV_PARAM_CHWIDTH,
  4572. /* Channel Offset */
  4573. WMI_VDEV_PARAM_CHEXTOFFSET,
  4574. /* Disable HT Protection */
  4575. WMI_VDEV_PARAM_DISABLE_HTPROTECTION,
  4576. /* Quick STA Kickout */
  4577. WMI_VDEV_PARAM_STA_QUICKKICKOUT,
  4578. /* Rate to be used with Management frames */
  4579. WMI_VDEV_PARAM_MGMT_RATE,
  4580. /* Protection Mode */
  4581. WMI_VDEV_PARAM_PROTECTION_MODE,
  4582. /* Fixed rate setting */
  4583. WMI_VDEV_PARAM_FIXED_RATE,
  4584. /* Short GI Enable/Disable */
  4585. WMI_VDEV_PARAM_SGI,
  4586. /* Enable LDPC */
  4587. WMI_VDEV_PARAM_LDPC,
  4588. /* Enable Tx STBC */
  4589. WMI_VDEV_PARAM_TX_STBC,
  4590. /* Enable Rx STBC */
  4591. WMI_VDEV_PARAM_RX_STBC,
  4592. /* Intra BSS forwarding */
  4593. WMI_VDEV_PARAM_INTRA_BSS_FWD,
  4594. /* Setting Default xmit key for Vdev */
  4595. WMI_VDEV_PARAM_DEF_KEYID,
  4596. /* NSS width */
  4597. WMI_VDEV_PARAM_NSS,
  4598. /* Set the custom rate for the broadcast data frames */
  4599. WMI_VDEV_PARAM_BCAST_DATA_RATE,
  4600. /* Set the custom rate (rate-code) for multicast data frames */
  4601. WMI_VDEV_PARAM_MCAST_DATA_RATE,
  4602. /* Tx multicast packet indicate Enable/Disable */
  4603. WMI_VDEV_PARAM_MCAST_INDICATE,
  4604. /* Tx DHCP packet indicate Enable/Disable */
  4605. WMI_VDEV_PARAM_DHCP_INDICATE,
  4606. /* Enable host inspection of Tx unicast packet to unknown destination */
  4607. WMI_VDEV_PARAM_UNKNOWN_DEST_INDICATE,
  4608. /* The minimum amount of time AP begins to consider STA inactive */
  4609. WMI_VDEV_PARAM_AP_KEEPALIVE_MIN_IDLE_INACTIVE_TIME_SECS,
  4610. /*
  4611. * An associated STA is considered inactive when there is no recent
  4612. * TX/RX activity and no downlink frames are buffered for it. Once a
  4613. * STA exceeds the maximum idle inactive time, the AP will send an
  4614. * 802.11 data-null as a keep alive to verify the STA is still
  4615. * associated. If the STA does ACK the data-null, or if the data-null
  4616. * is buffered and the STA does not retrieve it, the STA will be
  4617. * considered unresponsive
  4618. * (see WMI_VDEV_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS).
  4619. */
  4620. WMI_VDEV_PARAM_AP_KEEPALIVE_MAX_IDLE_INACTIVE_TIME_SECS,
  4621. /*
  4622. * An associated STA is considered unresponsive if there is no recent
  4623. * TX/RX activity and downlink frames are buffered for it. Once a STA
  4624. * exceeds the maximum unresponsive time, the AP will send a
  4625. * WMI_STA_KICKOUT event to the host so the STA can be deleted.
  4626. */
  4627. WMI_VDEV_PARAM_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS,
  4628. /* Enable NAWDS : MCAST INSPECT Enable, NAWDS Flag set */
  4629. WMI_VDEV_PARAM_AP_ENABLE_NAWDS,
  4630. /* Enable/Disable RTS-CTS */
  4631. WMI_VDEV_PARAM_ENABLE_RTSCTS,
  4632. /* Enable TXBFee/er */
  4633. WMI_VDEV_PARAM_TXBF,
  4634. /* Set packet power save */
  4635. WMI_VDEV_PARAM_PACKET_POWERSAVE,
  4636. /*
  4637. * Drops un-encrypted packets if eceived in an encrypted connection
  4638. * otherwise forwards to host.
  4639. */
  4640. WMI_VDEV_PARAM_DROP_UNENCRY,
  4641. /*
  4642. * Set the encapsulation type for frames.
  4643. */
  4644. WMI_VDEV_PARAM_TX_ENCAP_TYPE,
  4645. };
  4646. /* the definition of different VDEV parameters */
  4647. enum wmi_10x_vdev_param {
  4648. /* RTS Threshold */
  4649. WMI_10X_VDEV_PARAM_RTS_THRESHOLD = 0x1,
  4650. /* Fragmentation threshold */
  4651. WMI_10X_VDEV_PARAM_FRAGMENTATION_THRESHOLD,
  4652. /* beacon interval in TUs */
  4653. WMI_10X_VDEV_PARAM_BEACON_INTERVAL,
  4654. /* Listen interval in TUs */
  4655. WMI_10X_VDEV_PARAM_LISTEN_INTERVAL,
  4656. /* multicast rate in Mbps */
  4657. WMI_10X_VDEV_PARAM_MULTICAST_RATE,
  4658. /* management frame rate in Mbps */
  4659. WMI_10X_VDEV_PARAM_MGMT_TX_RATE,
  4660. /* slot time (long vs short) */
  4661. WMI_10X_VDEV_PARAM_SLOT_TIME,
  4662. /* preamble (long vs short) */
  4663. WMI_10X_VDEV_PARAM_PREAMBLE,
  4664. /* SWBA time (time before tbtt in msec) */
  4665. WMI_10X_VDEV_PARAM_SWBA_TIME,
  4666. /* time period for updating VDEV stats */
  4667. WMI_10X_VDEV_STATS_UPDATE_PERIOD,
  4668. /* age out time in msec for frames queued for station in power save */
  4669. WMI_10X_VDEV_PWRSAVE_AGEOUT_TIME,
  4670. /*
  4671. * Host SWBA interval (time in msec before tbtt for SWBA event
  4672. * generation).
  4673. */
  4674. WMI_10X_VDEV_HOST_SWBA_INTERVAL,
  4675. /* DTIM period (specified in units of num beacon intervals) */
  4676. WMI_10X_VDEV_PARAM_DTIM_PERIOD,
  4677. /*
  4678. * scheduler air time limit for this VDEV. used by off chan
  4679. * scheduler.
  4680. */
  4681. WMI_10X_VDEV_OC_SCHEDULER_AIR_TIME_LIMIT,
  4682. /* enable/dsiable WDS for this VDEV */
  4683. WMI_10X_VDEV_PARAM_WDS,
  4684. /* ATIM Window */
  4685. WMI_10X_VDEV_PARAM_ATIM_WINDOW,
  4686. /* BMISS max */
  4687. WMI_10X_VDEV_PARAM_BMISS_COUNT_MAX,
  4688. /* WMM enables/disabled */
  4689. WMI_10X_VDEV_PARAM_FEATURE_WMM,
  4690. /* Channel width */
  4691. WMI_10X_VDEV_PARAM_CHWIDTH,
  4692. /* Channel Offset */
  4693. WMI_10X_VDEV_PARAM_CHEXTOFFSET,
  4694. /* Disable HT Protection */
  4695. WMI_10X_VDEV_PARAM_DISABLE_HTPROTECTION,
  4696. /* Quick STA Kickout */
  4697. WMI_10X_VDEV_PARAM_STA_QUICKKICKOUT,
  4698. /* Rate to be used with Management frames */
  4699. WMI_10X_VDEV_PARAM_MGMT_RATE,
  4700. /* Protection Mode */
  4701. WMI_10X_VDEV_PARAM_PROTECTION_MODE,
  4702. /* Fixed rate setting */
  4703. WMI_10X_VDEV_PARAM_FIXED_RATE,
  4704. /* Short GI Enable/Disable */
  4705. WMI_10X_VDEV_PARAM_SGI,
  4706. /* Enable LDPC */
  4707. WMI_10X_VDEV_PARAM_LDPC,
  4708. /* Enable Tx STBC */
  4709. WMI_10X_VDEV_PARAM_TX_STBC,
  4710. /* Enable Rx STBC */
  4711. WMI_10X_VDEV_PARAM_RX_STBC,
  4712. /* Intra BSS forwarding */
  4713. WMI_10X_VDEV_PARAM_INTRA_BSS_FWD,
  4714. /* Setting Default xmit key for Vdev */
  4715. WMI_10X_VDEV_PARAM_DEF_KEYID,
  4716. /* NSS width */
  4717. WMI_10X_VDEV_PARAM_NSS,
  4718. /* Set the custom rate for the broadcast data frames */
  4719. WMI_10X_VDEV_PARAM_BCAST_DATA_RATE,
  4720. /* Set the custom rate (rate-code) for multicast data frames */
  4721. WMI_10X_VDEV_PARAM_MCAST_DATA_RATE,
  4722. /* Tx multicast packet indicate Enable/Disable */
  4723. WMI_10X_VDEV_PARAM_MCAST_INDICATE,
  4724. /* Tx DHCP packet indicate Enable/Disable */
  4725. WMI_10X_VDEV_PARAM_DHCP_INDICATE,
  4726. /* Enable host inspection of Tx unicast packet to unknown destination */
  4727. WMI_10X_VDEV_PARAM_UNKNOWN_DEST_INDICATE,
  4728. /* The minimum amount of time AP begins to consider STA inactive */
  4729. WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MIN_IDLE_INACTIVE_TIME_SECS,
  4730. /*
  4731. * An associated STA is considered inactive when there is no recent
  4732. * TX/RX activity and no downlink frames are buffered for it. Once a
  4733. * STA exceeds the maximum idle inactive time, the AP will send an
  4734. * 802.11 data-null as a keep alive to verify the STA is still
  4735. * associated. If the STA does ACK the data-null, or if the data-null
  4736. * is buffered and the STA does not retrieve it, the STA will be
  4737. * considered unresponsive
  4738. * (see WMI_10X_VDEV_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS).
  4739. */
  4740. WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MAX_IDLE_INACTIVE_TIME_SECS,
  4741. /*
  4742. * An associated STA is considered unresponsive if there is no recent
  4743. * TX/RX activity and downlink frames are buffered for it. Once a STA
  4744. * exceeds the maximum unresponsive time, the AP will send a
  4745. * WMI_10X_STA_KICKOUT event to the host so the STA can be deleted.
  4746. */
  4747. WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS,
  4748. /* Enable NAWDS : MCAST INSPECT Enable, NAWDS Flag set */
  4749. WMI_10X_VDEV_PARAM_AP_ENABLE_NAWDS,
  4750. WMI_10X_VDEV_PARAM_MCAST2UCAST_SET,
  4751. /* Enable/Disable RTS-CTS */
  4752. WMI_10X_VDEV_PARAM_ENABLE_RTSCTS,
  4753. WMI_10X_VDEV_PARAM_AP_DETECT_OUT_OF_SYNC_SLEEPING_STA_TIME_SECS,
  4754. /* following are available as of firmware 10.2 */
  4755. WMI_10X_VDEV_PARAM_TX_ENCAP_TYPE,
  4756. WMI_10X_VDEV_PARAM_CABQ_MAXDUR,
  4757. WMI_10X_VDEV_PARAM_MFPTEST_SET,
  4758. WMI_10X_VDEV_PARAM_RTS_FIXED_RATE,
  4759. WMI_10X_VDEV_PARAM_VHT_SGIMASK,
  4760. WMI_10X_VDEV_PARAM_VHT80_RATEMASK,
  4761. WMI_10X_VDEV_PARAM_TSF_INCREMENT,
  4762. };
  4763. enum wmi_10_4_vdev_param {
  4764. WMI_10_4_VDEV_PARAM_RTS_THRESHOLD = 0x1,
  4765. WMI_10_4_VDEV_PARAM_FRAGMENTATION_THRESHOLD,
  4766. WMI_10_4_VDEV_PARAM_BEACON_INTERVAL,
  4767. WMI_10_4_VDEV_PARAM_LISTEN_INTERVAL,
  4768. WMI_10_4_VDEV_PARAM_MULTICAST_RATE,
  4769. WMI_10_4_VDEV_PARAM_MGMT_TX_RATE,
  4770. WMI_10_4_VDEV_PARAM_SLOT_TIME,
  4771. WMI_10_4_VDEV_PARAM_PREAMBLE,
  4772. WMI_10_4_VDEV_PARAM_SWBA_TIME,
  4773. WMI_10_4_VDEV_STATS_UPDATE_PERIOD,
  4774. WMI_10_4_VDEV_PWRSAVE_AGEOUT_TIME,
  4775. WMI_10_4_VDEV_HOST_SWBA_INTERVAL,
  4776. WMI_10_4_VDEV_PARAM_DTIM_PERIOD,
  4777. WMI_10_4_VDEV_OC_SCHEDULER_AIR_TIME_LIMIT,
  4778. WMI_10_4_VDEV_PARAM_WDS,
  4779. WMI_10_4_VDEV_PARAM_ATIM_WINDOW,
  4780. WMI_10_4_VDEV_PARAM_BMISS_COUNT_MAX,
  4781. WMI_10_4_VDEV_PARAM_BMISS_FIRST_BCNT,
  4782. WMI_10_4_VDEV_PARAM_BMISS_FINAL_BCNT,
  4783. WMI_10_4_VDEV_PARAM_FEATURE_WMM,
  4784. WMI_10_4_VDEV_PARAM_CHWIDTH,
  4785. WMI_10_4_VDEV_PARAM_CHEXTOFFSET,
  4786. WMI_10_4_VDEV_PARAM_DISABLE_HTPROTECTION,
  4787. WMI_10_4_VDEV_PARAM_STA_QUICKKICKOUT,
  4788. WMI_10_4_VDEV_PARAM_MGMT_RATE,
  4789. WMI_10_4_VDEV_PARAM_PROTECTION_MODE,
  4790. WMI_10_4_VDEV_PARAM_FIXED_RATE,
  4791. WMI_10_4_VDEV_PARAM_SGI,
  4792. WMI_10_4_VDEV_PARAM_LDPC,
  4793. WMI_10_4_VDEV_PARAM_TX_STBC,
  4794. WMI_10_4_VDEV_PARAM_RX_STBC,
  4795. WMI_10_4_VDEV_PARAM_INTRA_BSS_FWD,
  4796. WMI_10_4_VDEV_PARAM_DEF_KEYID,
  4797. WMI_10_4_VDEV_PARAM_NSS,
  4798. WMI_10_4_VDEV_PARAM_BCAST_DATA_RATE,
  4799. WMI_10_4_VDEV_PARAM_MCAST_DATA_RATE,
  4800. WMI_10_4_VDEV_PARAM_MCAST_INDICATE,
  4801. WMI_10_4_VDEV_PARAM_DHCP_INDICATE,
  4802. WMI_10_4_VDEV_PARAM_UNKNOWN_DEST_INDICATE,
  4803. WMI_10_4_VDEV_PARAM_AP_KEEPALIVE_MIN_IDLE_INACTIVE_TIME_SECS,
  4804. WMI_10_4_VDEV_PARAM_AP_KEEPALIVE_MAX_IDLE_INACTIVE_TIME_SECS,
  4805. WMI_10_4_VDEV_PARAM_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS,
  4806. WMI_10_4_VDEV_PARAM_AP_ENABLE_NAWDS,
  4807. WMI_10_4_VDEV_PARAM_MCAST2UCAST_SET,
  4808. WMI_10_4_VDEV_PARAM_ENABLE_RTSCTS,
  4809. WMI_10_4_VDEV_PARAM_RC_NUM_RETRIES,
  4810. WMI_10_4_VDEV_PARAM_TXBF,
  4811. WMI_10_4_VDEV_PARAM_PACKET_POWERSAVE,
  4812. WMI_10_4_VDEV_PARAM_DROP_UNENCRY,
  4813. WMI_10_4_VDEV_PARAM_TX_ENCAP_TYPE,
  4814. WMI_10_4_VDEV_PARAM_AP_DETECT_OUT_OF_SYNC_SLEEPING_STA_TIME_SECS,
  4815. WMI_10_4_VDEV_PARAM_CABQ_MAXDUR,
  4816. WMI_10_4_VDEV_PARAM_MFPTEST_SET,
  4817. WMI_10_4_VDEV_PARAM_RTS_FIXED_RATE,
  4818. WMI_10_4_VDEV_PARAM_VHT_SGIMASK,
  4819. WMI_10_4_VDEV_PARAM_VHT80_RATEMASK,
  4820. WMI_10_4_VDEV_PARAM_EARLY_RX_ADJUST_ENABLE,
  4821. WMI_10_4_VDEV_PARAM_EARLY_RX_TGT_BMISS_NUM,
  4822. WMI_10_4_VDEV_PARAM_EARLY_RX_BMISS_SAMPLE_CYCLE,
  4823. WMI_10_4_VDEV_PARAM_EARLY_RX_SLOP_STEP,
  4824. WMI_10_4_VDEV_PARAM_EARLY_RX_INIT_SLOP,
  4825. WMI_10_4_VDEV_PARAM_EARLY_RX_ADJUST_PAUSE,
  4826. WMI_10_4_VDEV_PARAM_PROXY_STA,
  4827. WMI_10_4_VDEV_PARAM_MERU_VC,
  4828. WMI_10_4_VDEV_PARAM_RX_DECAP_TYPE,
  4829. WMI_10_4_VDEV_PARAM_BW_NSS_RATEMASK,
  4830. WMI_10_4_VDEV_PARAM_SENSOR_AP,
  4831. WMI_10_4_VDEV_PARAM_BEACON_RATE,
  4832. WMI_10_4_VDEV_PARAM_DTIM_ENABLE_CTS,
  4833. WMI_10_4_VDEV_PARAM_STA_KICKOUT,
  4834. WMI_10_4_VDEV_PARAM_CAPABILITIES,
  4835. WMI_10_4_VDEV_PARAM_TSF_INCREMENT,
  4836. WMI_10_4_VDEV_PARAM_RX_FILTER,
  4837. WMI_10_4_VDEV_PARAM_MGMT_TX_POWER,
  4838. WMI_10_4_VDEV_PARAM_ATF_SSID_SCHED_POLICY,
  4839. WMI_10_4_VDEV_PARAM_DISABLE_DYN_BW_RTS,
  4840. WMI_10_4_VDEV_PARAM_TSF_DECREMENT,
  4841. };
  4842. #define WMI_VDEV_PARAM_TXBF_SU_TX_BFEE BIT(0)
  4843. #define WMI_VDEV_PARAM_TXBF_MU_TX_BFEE BIT(1)
  4844. #define WMI_VDEV_PARAM_TXBF_SU_TX_BFER BIT(2)
  4845. #define WMI_VDEV_PARAM_TXBF_MU_TX_BFER BIT(3)
  4846. #define WMI_TXBF_STS_CAP_OFFSET_LSB 4
  4847. #define WMI_TXBF_STS_CAP_OFFSET_MASK 0x70
  4848. #define WMI_TXBF_CONF_IMPLICIT_BF BIT(7)
  4849. #define WMI_BF_SOUND_DIM_OFFSET_LSB 8
  4850. #define WMI_BF_SOUND_DIM_OFFSET_MASK 0xf00
  4851. /* slot time long */
  4852. #define WMI_VDEV_SLOT_TIME_LONG 0x1
  4853. /* slot time short */
  4854. #define WMI_VDEV_SLOT_TIME_SHORT 0x2
  4855. /* preablbe long */
  4856. #define WMI_VDEV_PREAMBLE_LONG 0x1
  4857. /* preablbe short */
  4858. #define WMI_VDEV_PREAMBLE_SHORT 0x2
  4859. enum wmi_start_event_param {
  4860. WMI_VDEV_RESP_START_EVENT = 0,
  4861. WMI_VDEV_RESP_RESTART_EVENT,
  4862. };
  4863. struct wmi_vdev_start_response_event {
  4864. __le32 vdev_id;
  4865. __le32 req_id;
  4866. __le32 resp_type; /* %WMI_VDEV_RESP_ */
  4867. __le32 status;
  4868. } __packed;
  4869. struct wmi_vdev_standby_req_event {
  4870. /* unique id identifying the VDEV, generated by the caller */
  4871. __le32 vdev_id;
  4872. } __packed;
  4873. struct wmi_vdev_resume_req_event {
  4874. /* unique id identifying the VDEV, generated by the caller */
  4875. __le32 vdev_id;
  4876. } __packed;
  4877. struct wmi_vdev_stopped_event {
  4878. /* unique id identifying the VDEV, generated by the caller */
  4879. __le32 vdev_id;
  4880. } __packed;
  4881. /*
  4882. * common structure used for simple events
  4883. * (stopped, resume_req, standby response)
  4884. */
  4885. struct wmi_vdev_simple_event {
  4886. /* unique id identifying the VDEV, generated by the caller */
  4887. __le32 vdev_id;
  4888. } __packed;
  4889. /* VDEV start response status codes */
  4890. /* VDEV successfully started */
  4891. #define WMI_INIFIED_VDEV_START_RESPONSE_STATUS_SUCCESS 0x0
  4892. /* requested VDEV not found */
  4893. #define WMI_INIFIED_VDEV_START_RESPONSE_INVALID_VDEVID 0x1
  4894. /* unsupported VDEV combination */
  4895. #define WMI_INIFIED_VDEV_START_RESPONSE_NOT_SUPPORTED 0x2
  4896. /* TODO: please add more comments if you have in-depth information */
  4897. struct wmi_vdev_spectral_conf_cmd {
  4898. __le32 vdev_id;
  4899. /* number of fft samples to send (0 for infinite) */
  4900. __le32 scan_count;
  4901. __le32 scan_period;
  4902. __le32 scan_priority;
  4903. /* number of bins in the FFT: 2^(fft_size - bin_scale) */
  4904. __le32 scan_fft_size;
  4905. __le32 scan_gc_ena;
  4906. __le32 scan_restart_ena;
  4907. __le32 scan_noise_floor_ref;
  4908. __le32 scan_init_delay;
  4909. __le32 scan_nb_tone_thr;
  4910. __le32 scan_str_bin_thr;
  4911. __le32 scan_wb_rpt_mode;
  4912. __le32 scan_rssi_rpt_mode;
  4913. __le32 scan_rssi_thr;
  4914. __le32 scan_pwr_format;
  4915. /* rpt_mode: Format of FFT report to software for spectral scan
  4916. * triggered FFTs:
  4917. * 0: No FFT report (only spectral scan summary report)
  4918. * 1: 2-dword summary of metrics for each completed FFT + spectral
  4919. * scan summary report
  4920. * 2: 2-dword summary of metrics for each completed FFT +
  4921. * 1x- oversampled bins(in-band) per FFT + spectral scan summary
  4922. * report
  4923. * 3: 2-dword summary of metrics for each completed FFT +
  4924. * 2x- oversampled bins (all) per FFT + spectral scan summary
  4925. */
  4926. __le32 scan_rpt_mode;
  4927. __le32 scan_bin_scale;
  4928. __le32 scan_dbm_adj;
  4929. __le32 scan_chn_mask;
  4930. } __packed;
  4931. struct wmi_vdev_spectral_conf_arg {
  4932. u32 vdev_id;
  4933. u32 scan_count;
  4934. u32 scan_period;
  4935. u32 scan_priority;
  4936. u32 scan_fft_size;
  4937. u32 scan_gc_ena;
  4938. u32 scan_restart_ena;
  4939. u32 scan_noise_floor_ref;
  4940. u32 scan_init_delay;
  4941. u32 scan_nb_tone_thr;
  4942. u32 scan_str_bin_thr;
  4943. u32 scan_wb_rpt_mode;
  4944. u32 scan_rssi_rpt_mode;
  4945. u32 scan_rssi_thr;
  4946. u32 scan_pwr_format;
  4947. u32 scan_rpt_mode;
  4948. u32 scan_bin_scale;
  4949. u32 scan_dbm_adj;
  4950. u32 scan_chn_mask;
  4951. };
  4952. #define WMI_SPECTRAL_ENABLE_DEFAULT 0
  4953. #define WMI_SPECTRAL_COUNT_DEFAULT 0
  4954. #define WMI_SPECTRAL_PERIOD_DEFAULT 35
  4955. #define WMI_SPECTRAL_PRIORITY_DEFAULT 1
  4956. #define WMI_SPECTRAL_FFT_SIZE_DEFAULT 7
  4957. #define WMI_SPECTRAL_GC_ENA_DEFAULT 1
  4958. #define WMI_SPECTRAL_RESTART_ENA_DEFAULT 0
  4959. #define WMI_SPECTRAL_NOISE_FLOOR_REF_DEFAULT -96
  4960. #define WMI_SPECTRAL_INIT_DELAY_DEFAULT 80
  4961. #define WMI_SPECTRAL_NB_TONE_THR_DEFAULT 12
  4962. #define WMI_SPECTRAL_STR_BIN_THR_DEFAULT 8
  4963. #define WMI_SPECTRAL_WB_RPT_MODE_DEFAULT 0
  4964. #define WMI_SPECTRAL_RSSI_RPT_MODE_DEFAULT 0
  4965. #define WMI_SPECTRAL_RSSI_THR_DEFAULT 0xf0
  4966. #define WMI_SPECTRAL_PWR_FORMAT_DEFAULT 0
  4967. #define WMI_SPECTRAL_RPT_MODE_DEFAULT 2
  4968. #define WMI_SPECTRAL_BIN_SCALE_DEFAULT 1
  4969. #define WMI_SPECTRAL_DBM_ADJ_DEFAULT 1
  4970. #define WMI_SPECTRAL_CHN_MASK_DEFAULT 1
  4971. struct wmi_vdev_spectral_enable_cmd {
  4972. __le32 vdev_id;
  4973. __le32 trigger_cmd;
  4974. __le32 enable_cmd;
  4975. } __packed;
  4976. #define WMI_SPECTRAL_TRIGGER_CMD_TRIGGER 1
  4977. #define WMI_SPECTRAL_TRIGGER_CMD_CLEAR 2
  4978. #define WMI_SPECTRAL_ENABLE_CMD_ENABLE 1
  4979. #define WMI_SPECTRAL_ENABLE_CMD_DISABLE 2
  4980. /* Beacon processing related command and event structures */
  4981. struct wmi_bcn_tx_hdr {
  4982. __le32 vdev_id;
  4983. __le32 tx_rate;
  4984. __le32 tx_power;
  4985. __le32 bcn_len;
  4986. } __packed;
  4987. struct wmi_bcn_tx_cmd {
  4988. struct wmi_bcn_tx_hdr hdr;
  4989. u8 *bcn[0];
  4990. } __packed;
  4991. struct wmi_bcn_tx_arg {
  4992. u32 vdev_id;
  4993. u32 tx_rate;
  4994. u32 tx_power;
  4995. u32 bcn_len;
  4996. const void *bcn;
  4997. };
  4998. enum wmi_bcn_tx_ref_flags {
  4999. WMI_BCN_TX_REF_FLAG_DTIM_ZERO = 0x1,
  5000. WMI_BCN_TX_REF_FLAG_DELIVER_CAB = 0x2,
  5001. };
  5002. /* TODO: It is unclear why "no antenna" works while any other seemingly valid
  5003. * chainmask yields no beacons on the air at all.
  5004. */
  5005. #define WMI_BCN_TX_REF_DEF_ANTENNA 0
  5006. struct wmi_bcn_tx_ref_cmd {
  5007. __le32 vdev_id;
  5008. __le32 data_len;
  5009. /* physical address of the frame - dma pointer */
  5010. __le32 data_ptr;
  5011. /* id for host to track */
  5012. __le32 msdu_id;
  5013. /* frame ctrl to setup PPDU desc */
  5014. __le32 frame_control;
  5015. /* to control CABQ traffic: WMI_BCN_TX_REF_FLAG_ */
  5016. __le32 flags;
  5017. /* introduced in 10.2 */
  5018. __le32 antenna_mask;
  5019. } __packed;
  5020. /* Beacon filter */
  5021. #define WMI_BCN_FILTER_ALL 0 /* Filter all beacons */
  5022. #define WMI_BCN_FILTER_NONE 1 /* Pass all beacons */
  5023. #define WMI_BCN_FILTER_RSSI 2 /* Pass Beacons RSSI >= RSSI threshold */
  5024. #define WMI_BCN_FILTER_BSSID 3 /* Pass Beacons with matching BSSID */
  5025. #define WMI_BCN_FILTER_SSID 4 /* Pass Beacons with matching SSID */
  5026. struct wmi_bcn_filter_rx_cmd {
  5027. /* Filter ID */
  5028. __le32 bcn_filter_id;
  5029. /* Filter type - wmi_bcn_filter */
  5030. __le32 bcn_filter;
  5031. /* Buffer len */
  5032. __le32 bcn_filter_len;
  5033. /* Filter info (threshold, BSSID, RSSI) */
  5034. u8 *bcn_filter_buf;
  5035. } __packed;
  5036. /* Capabilities and IEs to be passed to firmware */
  5037. struct wmi_bcn_prb_info {
  5038. /* Capabilities */
  5039. __le32 caps;
  5040. /* ERP info */
  5041. __le32 erp;
  5042. /* Advanced capabilities */
  5043. /* HT capabilities */
  5044. /* HT Info */
  5045. /* ibss_dfs */
  5046. /* wpa Info */
  5047. /* rsn Info */
  5048. /* rrm info */
  5049. /* ath_ext */
  5050. /* app IE */
  5051. } __packed;
  5052. struct wmi_bcn_tmpl_cmd {
  5053. /* unique id identifying the VDEV, generated by the caller */
  5054. __le32 vdev_id;
  5055. /* TIM IE offset from the beginning of the template. */
  5056. __le32 tim_ie_offset;
  5057. /* beacon probe capabilities and IEs */
  5058. struct wmi_bcn_prb_info bcn_prb_info;
  5059. /* beacon buffer length */
  5060. __le32 buf_len;
  5061. /* variable length data */
  5062. u8 data[1];
  5063. } __packed;
  5064. struct wmi_prb_tmpl_cmd {
  5065. /* unique id identifying the VDEV, generated by the caller */
  5066. __le32 vdev_id;
  5067. /* beacon probe capabilities and IEs */
  5068. struct wmi_bcn_prb_info bcn_prb_info;
  5069. /* beacon buffer length */
  5070. __le32 buf_len;
  5071. /* Variable length data */
  5072. u8 data[1];
  5073. } __packed;
  5074. enum wmi_sta_ps_mode {
  5075. /* enable power save for the given STA VDEV */
  5076. WMI_STA_PS_MODE_DISABLED = 0,
  5077. /* disable power save for a given STA VDEV */
  5078. WMI_STA_PS_MODE_ENABLED = 1,
  5079. };
  5080. struct wmi_sta_powersave_mode_cmd {
  5081. /* unique id identifying the VDEV, generated by the caller */
  5082. __le32 vdev_id;
  5083. /*
  5084. * Power save mode
  5085. * (see enum wmi_sta_ps_mode)
  5086. */
  5087. __le32 sta_ps_mode;
  5088. } __packed;
  5089. enum wmi_csa_offload_en {
  5090. WMI_CSA_OFFLOAD_DISABLE = 0,
  5091. WMI_CSA_OFFLOAD_ENABLE = 1,
  5092. };
  5093. struct wmi_csa_offload_enable_cmd {
  5094. __le32 vdev_id;
  5095. __le32 csa_offload_enable;
  5096. } __packed;
  5097. struct wmi_csa_offload_chanswitch_cmd {
  5098. __le32 vdev_id;
  5099. struct wmi_channel chan;
  5100. } __packed;
  5101. /*
  5102. * This parameter controls the policy for retrieving frames from AP while the
  5103. * STA is in sleep state.
  5104. *
  5105. * Only takes affect if the sta_ps_mode is enabled
  5106. */
  5107. enum wmi_sta_ps_param_rx_wake_policy {
  5108. /*
  5109. * Wake up when ever there is an RX activity on the VDEV. In this mode
  5110. * the Power save SM(state machine) will come out of sleep by either
  5111. * sending null frame (or) a data frame (with PS==0) in response to TIM
  5112. * bit set in the received beacon frame from AP.
  5113. */
  5114. WMI_STA_PS_RX_WAKE_POLICY_WAKE = 0,
  5115. /*
  5116. * Here the power save state machine will not wakeup in response to TIM
  5117. * bit, instead it will send a PSPOLL (or) UASPD trigger based on UAPSD
  5118. * configuration setup by WMISET_PS_SET_UAPSD WMI command. When all
  5119. * access categories are delivery-enabled, the station will send a
  5120. * UAPSD trigger frame, otherwise it will send a PS-Poll.
  5121. */
  5122. WMI_STA_PS_RX_WAKE_POLICY_POLL_UAPSD = 1,
  5123. };
  5124. /*
  5125. * Number of tx frames/beacon that cause the power save SM to wake up.
  5126. *
  5127. * Value 1 causes the SM to wake up for every TX. Value 0 has a special
  5128. * meaning, It will cause the SM to never wake up. This is useful if you want
  5129. * to keep the system to sleep all the time for some kind of test mode . host
  5130. * can change this parameter any time. It will affect at the next tx frame.
  5131. */
  5132. enum wmi_sta_ps_param_tx_wake_threshold {
  5133. WMI_STA_PS_TX_WAKE_THRESHOLD_NEVER = 0,
  5134. WMI_STA_PS_TX_WAKE_THRESHOLD_ALWAYS = 1,
  5135. /*
  5136. * Values greater than one indicate that many TX attempts per beacon
  5137. * interval before the STA will wake up
  5138. */
  5139. };
  5140. /*
  5141. * The maximum number of PS-Poll frames the FW will send in response to
  5142. * traffic advertised in TIM before waking up (by sending a null frame with PS
  5143. * = 0). Value 0 has a special meaning: there is no maximum count and the FW
  5144. * will send as many PS-Poll as are necessary to retrieve buffered BU. This
  5145. * parameter is used when the RX wake policy is
  5146. * WMI_STA_PS_RX_WAKE_POLICY_POLL_UAPSD and ignored when the RX wake
  5147. * policy is WMI_STA_PS_RX_WAKE_POLICY_WAKE.
  5148. */
  5149. enum wmi_sta_ps_param_pspoll_count {
  5150. WMI_STA_PS_PSPOLL_COUNT_NO_MAX = 0,
  5151. /*
  5152. * Values greater than 0 indicate the maximum numer of PS-Poll frames
  5153. * FW will send before waking up.
  5154. */
  5155. /* When u-APSD is enabled the firmware will be very reluctant to exit
  5156. * STA PS. This could result in very poor Rx performance with STA doing
  5157. * PS-Poll for each and every buffered frame. This value is a bit
  5158. * arbitrary.
  5159. */
  5160. WMI_STA_PS_PSPOLL_COUNT_UAPSD = 3,
  5161. };
  5162. /*
  5163. * This will include the delivery and trigger enabled state for every AC.
  5164. * This is the negotiated state with AP. The host MLME needs to set this based
  5165. * on AP capability and the state Set in the association request by the
  5166. * station MLME.Lower 8 bits of the value specify the UAPSD configuration.
  5167. */
  5168. #define WMI_UAPSD_AC_TYPE_DELI 0
  5169. #define WMI_UAPSD_AC_TYPE_TRIG 1
  5170. #define WMI_UAPSD_AC_BIT_MASK(ac, type) \
  5171. (type == WMI_UAPSD_AC_TYPE_DELI ? 1 << (ac << 1) : 1 << ((ac << 1) + 1))
  5172. enum wmi_sta_ps_param_uapsd {
  5173. WMI_STA_PS_UAPSD_AC0_DELIVERY_EN = (1 << 0),
  5174. WMI_STA_PS_UAPSD_AC0_TRIGGER_EN = (1 << 1),
  5175. WMI_STA_PS_UAPSD_AC1_DELIVERY_EN = (1 << 2),
  5176. WMI_STA_PS_UAPSD_AC1_TRIGGER_EN = (1 << 3),
  5177. WMI_STA_PS_UAPSD_AC2_DELIVERY_EN = (1 << 4),
  5178. WMI_STA_PS_UAPSD_AC2_TRIGGER_EN = (1 << 5),
  5179. WMI_STA_PS_UAPSD_AC3_DELIVERY_EN = (1 << 6),
  5180. WMI_STA_PS_UAPSD_AC3_TRIGGER_EN = (1 << 7),
  5181. };
  5182. #define WMI_STA_UAPSD_MAX_INTERVAL_MSEC UINT_MAX
  5183. struct wmi_sta_uapsd_auto_trig_param {
  5184. __le32 wmm_ac;
  5185. __le32 user_priority;
  5186. __le32 service_interval;
  5187. __le32 suspend_interval;
  5188. __le32 delay_interval;
  5189. };
  5190. struct wmi_sta_uapsd_auto_trig_cmd_fixed_param {
  5191. __le32 vdev_id;
  5192. struct wmi_mac_addr peer_macaddr;
  5193. __le32 num_ac;
  5194. };
  5195. struct wmi_sta_uapsd_auto_trig_arg {
  5196. u32 wmm_ac;
  5197. u32 user_priority;
  5198. u32 service_interval;
  5199. u32 suspend_interval;
  5200. u32 delay_interval;
  5201. };
  5202. enum wmi_sta_powersave_param {
  5203. /*
  5204. * Controls how frames are retrievd from AP while STA is sleeping
  5205. *
  5206. * (see enum wmi_sta_ps_param_rx_wake_policy)
  5207. */
  5208. WMI_STA_PS_PARAM_RX_WAKE_POLICY = 0,
  5209. /*
  5210. * The STA will go active after this many TX
  5211. *
  5212. * (see enum wmi_sta_ps_param_tx_wake_threshold)
  5213. */
  5214. WMI_STA_PS_PARAM_TX_WAKE_THRESHOLD = 1,
  5215. /*
  5216. * Number of PS-Poll to send before STA wakes up
  5217. *
  5218. * (see enum wmi_sta_ps_param_pspoll_count)
  5219. *
  5220. */
  5221. WMI_STA_PS_PARAM_PSPOLL_COUNT = 2,
  5222. /*
  5223. * TX/RX inactivity time in msec before going to sleep.
  5224. *
  5225. * The power save SM will monitor tx/rx activity on the VDEV, if no
  5226. * activity for the specified msec of the parameter the Power save
  5227. * SM will go to sleep.
  5228. */
  5229. WMI_STA_PS_PARAM_INACTIVITY_TIME = 3,
  5230. /*
  5231. * Set uapsd configuration.
  5232. *
  5233. * (see enum wmi_sta_ps_param_uapsd)
  5234. */
  5235. WMI_STA_PS_PARAM_UAPSD = 4,
  5236. };
  5237. struct wmi_sta_powersave_param_cmd {
  5238. __le32 vdev_id;
  5239. __le32 param_id; /* %WMI_STA_PS_PARAM_ */
  5240. __le32 param_value;
  5241. } __packed;
  5242. /* No MIMO power save */
  5243. #define WMI_STA_MIMO_PS_MODE_DISABLE
  5244. /* mimo powersave mode static*/
  5245. #define WMI_STA_MIMO_PS_MODE_STATIC
  5246. /* mimo powersave mode dynamic */
  5247. #define WMI_STA_MIMO_PS_MODE_DYNAMIC
  5248. struct wmi_sta_mimo_ps_mode_cmd {
  5249. /* unique id identifying the VDEV, generated by the caller */
  5250. __le32 vdev_id;
  5251. /* mimo powersave mode as defined above */
  5252. __le32 mimo_pwrsave_mode;
  5253. } __packed;
  5254. /* U-APSD configuration of peer station from (re)assoc request and TSPECs */
  5255. enum wmi_ap_ps_param_uapsd {
  5256. WMI_AP_PS_UAPSD_AC0_DELIVERY_EN = (1 << 0),
  5257. WMI_AP_PS_UAPSD_AC0_TRIGGER_EN = (1 << 1),
  5258. WMI_AP_PS_UAPSD_AC1_DELIVERY_EN = (1 << 2),
  5259. WMI_AP_PS_UAPSD_AC1_TRIGGER_EN = (1 << 3),
  5260. WMI_AP_PS_UAPSD_AC2_DELIVERY_EN = (1 << 4),
  5261. WMI_AP_PS_UAPSD_AC2_TRIGGER_EN = (1 << 5),
  5262. WMI_AP_PS_UAPSD_AC3_DELIVERY_EN = (1 << 6),
  5263. WMI_AP_PS_UAPSD_AC3_TRIGGER_EN = (1 << 7),
  5264. };
  5265. /* U-APSD maximum service period of peer station */
  5266. enum wmi_ap_ps_peer_param_max_sp {
  5267. WMI_AP_PS_PEER_PARAM_MAX_SP_UNLIMITED = 0,
  5268. WMI_AP_PS_PEER_PARAM_MAX_SP_2 = 1,
  5269. WMI_AP_PS_PEER_PARAM_MAX_SP_4 = 2,
  5270. WMI_AP_PS_PEER_PARAM_MAX_SP_6 = 3,
  5271. MAX_WMI_AP_PS_PEER_PARAM_MAX_SP,
  5272. };
  5273. /*
  5274. * AP power save parameter
  5275. * Set a power save specific parameter for a peer station
  5276. */
  5277. enum wmi_ap_ps_peer_param {
  5278. /* Set uapsd configuration for a given peer.
  5279. *
  5280. * Include the delivery and trigger enabled state for every AC.
  5281. * The host MLME needs to set this based on AP capability and stations
  5282. * request Set in the association request received from the station.
  5283. *
  5284. * Lower 8 bits of the value specify the UAPSD configuration.
  5285. *
  5286. * (see enum wmi_ap_ps_param_uapsd)
  5287. * The default value is 0.
  5288. */
  5289. WMI_AP_PS_PEER_PARAM_UAPSD = 0,
  5290. /*
  5291. * Set the service period for a UAPSD capable station
  5292. *
  5293. * The service period from wme ie in the (re)assoc request frame.
  5294. *
  5295. * (see enum wmi_ap_ps_peer_param_max_sp)
  5296. */
  5297. WMI_AP_PS_PEER_PARAM_MAX_SP = 1,
  5298. /* Time in seconds for aging out buffered frames for STA in PS */
  5299. WMI_AP_PS_PEER_PARAM_AGEOUT_TIME = 2,
  5300. };
  5301. struct wmi_ap_ps_peer_cmd {
  5302. /* unique id identifying the VDEV, generated by the caller */
  5303. __le32 vdev_id;
  5304. /* peer MAC address */
  5305. struct wmi_mac_addr peer_macaddr;
  5306. /* AP powersave param (see enum wmi_ap_ps_peer_param) */
  5307. __le32 param_id;
  5308. /* AP powersave param value */
  5309. __le32 param_value;
  5310. } __packed;
  5311. /* 128 clients = 4 words */
  5312. #define WMI_TIM_BITMAP_ARRAY_SIZE 4
  5313. struct wmi_tim_info {
  5314. __le32 tim_len;
  5315. __le32 tim_mcast;
  5316. __le32 tim_bitmap[WMI_TIM_BITMAP_ARRAY_SIZE];
  5317. __le32 tim_changed;
  5318. __le32 tim_num_ps_pending;
  5319. } __packed;
  5320. struct wmi_tim_info_arg {
  5321. __le32 tim_len;
  5322. __le32 tim_mcast;
  5323. const __le32 *tim_bitmap;
  5324. __le32 tim_changed;
  5325. __le32 tim_num_ps_pending;
  5326. } __packed;
  5327. /* Maximum number of NOA Descriptors supported */
  5328. #define WMI_P2P_MAX_NOA_DESCRIPTORS 4
  5329. #define WMI_P2P_OPPPS_ENABLE_BIT BIT(0)
  5330. #define WMI_P2P_OPPPS_CTWINDOW_OFFSET 1
  5331. #define WMI_P2P_NOA_CHANGED_BIT BIT(0)
  5332. struct wmi_p2p_noa_info {
  5333. /* Bit 0 - Flag to indicate an update in NOA schedule
  5334. * Bits 7-1 - Reserved
  5335. */
  5336. u8 changed;
  5337. /* NOA index */
  5338. u8 index;
  5339. /* Bit 0 - Opp PS state of the AP
  5340. * Bits 1-7 - Ctwindow in TUs
  5341. */
  5342. u8 ctwindow_oppps;
  5343. /* Number of NOA descriptors */
  5344. u8 num_descriptors;
  5345. struct wmi_p2p_noa_descriptor descriptors[WMI_P2P_MAX_NOA_DESCRIPTORS];
  5346. } __packed;
  5347. struct wmi_bcn_info {
  5348. struct wmi_tim_info tim_info;
  5349. struct wmi_p2p_noa_info p2p_noa_info;
  5350. } __packed;
  5351. struct wmi_host_swba_event {
  5352. __le32 vdev_map;
  5353. struct wmi_bcn_info bcn_info[0];
  5354. } __packed;
  5355. struct wmi_10_2_4_bcn_info {
  5356. struct wmi_tim_info tim_info;
  5357. /* The 10.2.4 FW doesn't have p2p NOA info */
  5358. } __packed;
  5359. struct wmi_10_2_4_host_swba_event {
  5360. __le32 vdev_map;
  5361. struct wmi_10_2_4_bcn_info bcn_info[0];
  5362. } __packed;
  5363. /* 16 words = 512 client + 1 word = for guard */
  5364. #define WMI_10_4_TIM_BITMAP_ARRAY_SIZE 17
  5365. struct wmi_10_4_tim_info {
  5366. __le32 tim_len;
  5367. __le32 tim_mcast;
  5368. __le32 tim_bitmap[WMI_10_4_TIM_BITMAP_ARRAY_SIZE];
  5369. __le32 tim_changed;
  5370. __le32 tim_num_ps_pending;
  5371. } __packed;
  5372. #define WMI_10_4_P2P_MAX_NOA_DESCRIPTORS 1
  5373. struct wmi_10_4_p2p_noa_info {
  5374. /* Bit 0 - Flag to indicate an update in NOA schedule
  5375. * Bits 7-1 - Reserved
  5376. */
  5377. u8 changed;
  5378. /* NOA index */
  5379. u8 index;
  5380. /* Bit 0 - Opp PS state of the AP
  5381. * Bits 1-7 - Ctwindow in TUs
  5382. */
  5383. u8 ctwindow_oppps;
  5384. /* Number of NOA descriptors */
  5385. u8 num_descriptors;
  5386. struct wmi_p2p_noa_descriptor
  5387. noa_descriptors[WMI_10_4_P2P_MAX_NOA_DESCRIPTORS];
  5388. } __packed;
  5389. struct wmi_10_4_bcn_info {
  5390. struct wmi_10_4_tim_info tim_info;
  5391. struct wmi_10_4_p2p_noa_info p2p_noa_info;
  5392. } __packed;
  5393. struct wmi_10_4_host_swba_event {
  5394. __le32 vdev_map;
  5395. struct wmi_10_4_bcn_info bcn_info[0];
  5396. } __packed;
  5397. #define WMI_MAX_AP_VDEV 16
  5398. struct wmi_tbtt_offset_event {
  5399. __le32 vdev_map;
  5400. __le32 tbttoffset_list[WMI_MAX_AP_VDEV];
  5401. } __packed;
  5402. struct wmi_peer_create_cmd {
  5403. __le32 vdev_id;
  5404. struct wmi_mac_addr peer_macaddr;
  5405. __le32 peer_type;
  5406. } __packed;
  5407. enum wmi_peer_type {
  5408. WMI_PEER_TYPE_DEFAULT = 0,
  5409. WMI_PEER_TYPE_BSS = 1,
  5410. WMI_PEER_TYPE_TDLS = 2,
  5411. };
  5412. struct wmi_peer_delete_cmd {
  5413. __le32 vdev_id;
  5414. struct wmi_mac_addr peer_macaddr;
  5415. } __packed;
  5416. struct wmi_peer_flush_tids_cmd {
  5417. __le32 vdev_id;
  5418. struct wmi_mac_addr peer_macaddr;
  5419. __le32 peer_tid_bitmap;
  5420. } __packed;
  5421. struct wmi_fixed_rate {
  5422. /*
  5423. * rate mode . 0: disable fixed rate (auto rate)
  5424. * 1: legacy (non 11n) rate specified as ieee rate 2*Mbps
  5425. * 2: ht20 11n rate specified as mcs index
  5426. * 3: ht40 11n rate specified as mcs index
  5427. */
  5428. __le32 rate_mode;
  5429. /*
  5430. * 4 rate values for 4 rate series. series 0 is stored in byte 0 (LSB)
  5431. * and series 3 is stored at byte 3 (MSB)
  5432. */
  5433. __le32 rate_series;
  5434. /*
  5435. * 4 retry counts for 4 rate series. retry count for rate 0 is stored
  5436. * in byte 0 (LSB) and retry count for rate 3 is stored at byte 3
  5437. * (MSB)
  5438. */
  5439. __le32 rate_retries;
  5440. } __packed;
  5441. struct wmi_peer_fixed_rate_cmd {
  5442. /* unique id identifying the VDEV, generated by the caller */
  5443. __le32 vdev_id;
  5444. /* peer MAC address */
  5445. struct wmi_mac_addr peer_macaddr;
  5446. /* fixed rate */
  5447. struct wmi_fixed_rate peer_fixed_rate;
  5448. } __packed;
  5449. #define WMI_MGMT_TID 17
  5450. struct wmi_addba_clear_resp_cmd {
  5451. /* unique id identifying the VDEV, generated by the caller */
  5452. __le32 vdev_id;
  5453. /* peer MAC address */
  5454. struct wmi_mac_addr peer_macaddr;
  5455. } __packed;
  5456. struct wmi_addba_send_cmd {
  5457. /* unique id identifying the VDEV, generated by the caller */
  5458. __le32 vdev_id;
  5459. /* peer MAC address */
  5460. struct wmi_mac_addr peer_macaddr;
  5461. /* Tid number */
  5462. __le32 tid;
  5463. /* Buffer/Window size*/
  5464. __le32 buffersize;
  5465. } __packed;
  5466. struct wmi_delba_send_cmd {
  5467. /* unique id identifying the VDEV, generated by the caller */
  5468. __le32 vdev_id;
  5469. /* peer MAC address */
  5470. struct wmi_mac_addr peer_macaddr;
  5471. /* Tid number */
  5472. __le32 tid;
  5473. /* Is Initiator */
  5474. __le32 initiator;
  5475. /* Reason code */
  5476. __le32 reasoncode;
  5477. } __packed;
  5478. struct wmi_addba_setresponse_cmd {
  5479. /* unique id identifying the vdev, generated by the caller */
  5480. __le32 vdev_id;
  5481. /* peer mac address */
  5482. struct wmi_mac_addr peer_macaddr;
  5483. /* Tid number */
  5484. __le32 tid;
  5485. /* status code */
  5486. __le32 statuscode;
  5487. } __packed;
  5488. struct wmi_send_singleamsdu_cmd {
  5489. /* unique id identifying the vdev, generated by the caller */
  5490. __le32 vdev_id;
  5491. /* peer mac address */
  5492. struct wmi_mac_addr peer_macaddr;
  5493. /* Tid number */
  5494. __le32 tid;
  5495. } __packed;
  5496. enum wmi_peer_smps_state {
  5497. WMI_PEER_SMPS_PS_NONE = 0x0,
  5498. WMI_PEER_SMPS_STATIC = 0x1,
  5499. WMI_PEER_SMPS_DYNAMIC = 0x2
  5500. };
  5501. enum wmi_peer_chwidth {
  5502. WMI_PEER_CHWIDTH_20MHZ = 0,
  5503. WMI_PEER_CHWIDTH_40MHZ = 1,
  5504. WMI_PEER_CHWIDTH_80MHZ = 2,
  5505. WMI_PEER_CHWIDTH_160MHZ = 3,
  5506. };
  5507. enum wmi_peer_param {
  5508. WMI_PEER_SMPS_STATE = 0x1, /* see %wmi_peer_smps_state */
  5509. WMI_PEER_AMPDU = 0x2,
  5510. WMI_PEER_AUTHORIZE = 0x3,
  5511. WMI_PEER_CHAN_WIDTH = 0x4,
  5512. WMI_PEER_NSS = 0x5,
  5513. WMI_PEER_USE_4ADDR = 0x6,
  5514. WMI_PEER_DEBUG = 0xa,
  5515. WMI_PEER_PHYMODE = 0xd,
  5516. WMI_PEER_DUMMY_VAR = 0xff, /* dummy parameter for STA PS workaround */
  5517. };
  5518. struct wmi_peer_set_param_cmd {
  5519. __le32 vdev_id;
  5520. struct wmi_mac_addr peer_macaddr;
  5521. __le32 param_id;
  5522. __le32 param_value;
  5523. } __packed;
  5524. #define MAX_SUPPORTED_RATES 128
  5525. struct wmi_rate_set {
  5526. /* total number of rates */
  5527. __le32 num_rates;
  5528. /*
  5529. * rates (each 8bit value) packed into a 32 bit word.
  5530. * the rates are filled from least significant byte to most
  5531. * significant byte.
  5532. */
  5533. __le32 rates[(MAX_SUPPORTED_RATES / 4) + 1];
  5534. } __packed;
  5535. struct wmi_rate_set_arg {
  5536. unsigned int num_rates;
  5537. u8 rates[MAX_SUPPORTED_RATES];
  5538. };
  5539. /*
  5540. * NOTE: It would bea good idea to represent the Tx MCS
  5541. * info in one word and Rx in another word. This is split
  5542. * into multiple words for convenience
  5543. */
  5544. struct wmi_vht_rate_set {
  5545. __le32 rx_max_rate; /* Max Rx data rate */
  5546. __le32 rx_mcs_set; /* Negotiated RX VHT rates */
  5547. __le32 tx_max_rate; /* Max Tx data rate */
  5548. __le32 tx_mcs_set; /* Negotiated TX VHT rates */
  5549. } __packed;
  5550. struct wmi_vht_rate_set_arg {
  5551. u32 rx_max_rate;
  5552. u32 rx_mcs_set;
  5553. u32 tx_max_rate;
  5554. u32 tx_mcs_set;
  5555. };
  5556. struct wmi_peer_set_rates_cmd {
  5557. /* peer MAC address */
  5558. struct wmi_mac_addr peer_macaddr;
  5559. /* legacy rate set */
  5560. struct wmi_rate_set peer_legacy_rates;
  5561. /* ht rate set */
  5562. struct wmi_rate_set peer_ht_rates;
  5563. } __packed;
  5564. struct wmi_peer_set_q_empty_callback_cmd {
  5565. /* unique id identifying the VDEV, generated by the caller */
  5566. __le32 vdev_id;
  5567. /* peer MAC address */
  5568. struct wmi_mac_addr peer_macaddr;
  5569. __le32 callback_enable;
  5570. } __packed;
  5571. struct wmi_peer_flags_map {
  5572. u32 auth;
  5573. u32 qos;
  5574. u32 need_ptk_4_way;
  5575. u32 need_gtk_2_way;
  5576. u32 apsd;
  5577. u32 ht;
  5578. u32 bw40;
  5579. u32 stbc;
  5580. u32 ldbc;
  5581. u32 dyn_mimops;
  5582. u32 static_mimops;
  5583. u32 spatial_mux;
  5584. u32 vht;
  5585. u32 bw80;
  5586. u32 vht_2g;
  5587. u32 pmf;
  5588. u32 bw160;
  5589. };
  5590. enum wmi_peer_flags {
  5591. WMI_PEER_AUTH = 0x00000001,
  5592. WMI_PEER_QOS = 0x00000002,
  5593. WMI_PEER_NEED_PTK_4_WAY = 0x00000004,
  5594. WMI_PEER_NEED_GTK_2_WAY = 0x00000010,
  5595. WMI_PEER_APSD = 0x00000800,
  5596. WMI_PEER_HT = 0x00001000,
  5597. WMI_PEER_40MHZ = 0x00002000,
  5598. WMI_PEER_STBC = 0x00008000,
  5599. WMI_PEER_LDPC = 0x00010000,
  5600. WMI_PEER_DYN_MIMOPS = 0x00020000,
  5601. WMI_PEER_STATIC_MIMOPS = 0x00040000,
  5602. WMI_PEER_SPATIAL_MUX = 0x00200000,
  5603. WMI_PEER_VHT = 0x02000000,
  5604. WMI_PEER_80MHZ = 0x04000000,
  5605. WMI_PEER_VHT_2G = 0x08000000,
  5606. WMI_PEER_PMF = 0x10000000,
  5607. WMI_PEER_160MHZ = 0x20000000
  5608. };
  5609. enum wmi_10x_peer_flags {
  5610. WMI_10X_PEER_AUTH = 0x00000001,
  5611. WMI_10X_PEER_QOS = 0x00000002,
  5612. WMI_10X_PEER_NEED_PTK_4_WAY = 0x00000004,
  5613. WMI_10X_PEER_NEED_GTK_2_WAY = 0x00000010,
  5614. WMI_10X_PEER_APSD = 0x00000800,
  5615. WMI_10X_PEER_HT = 0x00001000,
  5616. WMI_10X_PEER_40MHZ = 0x00002000,
  5617. WMI_10X_PEER_STBC = 0x00008000,
  5618. WMI_10X_PEER_LDPC = 0x00010000,
  5619. WMI_10X_PEER_DYN_MIMOPS = 0x00020000,
  5620. WMI_10X_PEER_STATIC_MIMOPS = 0x00040000,
  5621. WMI_10X_PEER_SPATIAL_MUX = 0x00200000,
  5622. WMI_10X_PEER_VHT = 0x02000000,
  5623. WMI_10X_PEER_80MHZ = 0x04000000,
  5624. WMI_10X_PEER_160MHZ = 0x20000000
  5625. };
  5626. enum wmi_10_2_peer_flags {
  5627. WMI_10_2_PEER_AUTH = 0x00000001,
  5628. WMI_10_2_PEER_QOS = 0x00000002,
  5629. WMI_10_2_PEER_NEED_PTK_4_WAY = 0x00000004,
  5630. WMI_10_2_PEER_NEED_GTK_2_WAY = 0x00000010,
  5631. WMI_10_2_PEER_APSD = 0x00000800,
  5632. WMI_10_2_PEER_HT = 0x00001000,
  5633. WMI_10_2_PEER_40MHZ = 0x00002000,
  5634. WMI_10_2_PEER_STBC = 0x00008000,
  5635. WMI_10_2_PEER_LDPC = 0x00010000,
  5636. WMI_10_2_PEER_DYN_MIMOPS = 0x00020000,
  5637. WMI_10_2_PEER_STATIC_MIMOPS = 0x00040000,
  5638. WMI_10_2_PEER_SPATIAL_MUX = 0x00200000,
  5639. WMI_10_2_PEER_VHT = 0x02000000,
  5640. WMI_10_2_PEER_80MHZ = 0x04000000,
  5641. WMI_10_2_PEER_VHT_2G = 0x08000000,
  5642. WMI_10_2_PEER_PMF = 0x10000000,
  5643. WMI_10_2_PEER_160MHZ = 0x20000000
  5644. };
  5645. /*
  5646. * Peer rate capabilities.
  5647. *
  5648. * This is of interest to the ratecontrol
  5649. * module which resides in the firmware. The bit definitions are
  5650. * consistent with that defined in if_athrate.c.
  5651. */
  5652. #define WMI_RC_DS_FLAG 0x01
  5653. #define WMI_RC_CW40_FLAG 0x02
  5654. #define WMI_RC_SGI_FLAG 0x04
  5655. #define WMI_RC_HT_FLAG 0x08
  5656. #define WMI_RC_RTSCTS_FLAG 0x10
  5657. #define WMI_RC_TX_STBC_FLAG 0x20
  5658. #define WMI_RC_RX_STBC_FLAG 0xC0
  5659. #define WMI_RC_RX_STBC_FLAG_S 6
  5660. #define WMI_RC_WEP_TKIP_FLAG 0x100
  5661. #define WMI_RC_TS_FLAG 0x200
  5662. #define WMI_RC_UAPSD_FLAG 0x400
  5663. /* Maximum listen interval supported by hw in units of beacon interval */
  5664. #define ATH10K_MAX_HW_LISTEN_INTERVAL 5
  5665. struct wmi_common_peer_assoc_complete_cmd {
  5666. struct wmi_mac_addr peer_macaddr;
  5667. __le32 vdev_id;
  5668. __le32 peer_new_assoc; /* 1=assoc, 0=reassoc */
  5669. __le32 peer_associd; /* 16 LSBs */
  5670. __le32 peer_flags;
  5671. __le32 peer_caps; /* 16 LSBs */
  5672. __le32 peer_listen_intval;
  5673. __le32 peer_ht_caps;
  5674. __le32 peer_max_mpdu;
  5675. __le32 peer_mpdu_density; /* 0..16 */
  5676. __le32 peer_rate_caps;
  5677. struct wmi_rate_set peer_legacy_rates;
  5678. struct wmi_rate_set peer_ht_rates;
  5679. __le32 peer_nss; /* num of spatial streams */
  5680. __le32 peer_vht_caps;
  5681. __le32 peer_phymode;
  5682. struct wmi_vht_rate_set peer_vht_rates;
  5683. };
  5684. struct wmi_main_peer_assoc_complete_cmd {
  5685. struct wmi_common_peer_assoc_complete_cmd cmd;
  5686. /* HT Operation Element of the peer. Five bytes packed in 2
  5687. * INT32 array and filled from lsb to msb.
  5688. */
  5689. __le32 peer_ht_info[2];
  5690. } __packed;
  5691. struct wmi_10_1_peer_assoc_complete_cmd {
  5692. struct wmi_common_peer_assoc_complete_cmd cmd;
  5693. } __packed;
  5694. #define WMI_PEER_ASSOC_INFO0_MAX_MCS_IDX_LSB 0
  5695. #define WMI_PEER_ASSOC_INFO0_MAX_MCS_IDX_MASK 0x0f
  5696. #define WMI_PEER_ASSOC_INFO0_MAX_NSS_LSB 4
  5697. #define WMI_PEER_ASSOC_INFO0_MAX_NSS_MASK 0xf0
  5698. struct wmi_10_2_peer_assoc_complete_cmd {
  5699. struct wmi_common_peer_assoc_complete_cmd cmd;
  5700. __le32 info0; /* WMI_PEER_ASSOC_INFO0_ */
  5701. } __packed;
  5702. #define PEER_BW_RXNSS_OVERRIDE_OFFSET 31
  5703. struct wmi_10_4_peer_assoc_complete_cmd {
  5704. struct wmi_10_2_peer_assoc_complete_cmd cmd;
  5705. __le32 peer_bw_rxnss_override;
  5706. } __packed;
  5707. struct wmi_peer_assoc_complete_arg {
  5708. u8 addr[ETH_ALEN];
  5709. u32 vdev_id;
  5710. bool peer_reassoc;
  5711. u16 peer_aid;
  5712. u32 peer_flags; /* see %WMI_PEER_ */
  5713. u16 peer_caps;
  5714. u32 peer_listen_intval;
  5715. u32 peer_ht_caps;
  5716. u32 peer_max_mpdu;
  5717. u32 peer_mpdu_density; /* 0..16 */
  5718. u32 peer_rate_caps; /* see %WMI_RC_ */
  5719. struct wmi_rate_set_arg peer_legacy_rates;
  5720. struct wmi_rate_set_arg peer_ht_rates;
  5721. u32 peer_num_spatial_streams;
  5722. u32 peer_vht_caps;
  5723. enum wmi_phy_mode peer_phymode;
  5724. struct wmi_vht_rate_set_arg peer_vht_rates;
  5725. u32 peer_bw_rxnss_override;
  5726. };
  5727. struct wmi_peer_add_wds_entry_cmd {
  5728. /* peer MAC address */
  5729. struct wmi_mac_addr peer_macaddr;
  5730. /* wds MAC addr */
  5731. struct wmi_mac_addr wds_macaddr;
  5732. } __packed;
  5733. struct wmi_peer_remove_wds_entry_cmd {
  5734. /* wds MAC addr */
  5735. struct wmi_mac_addr wds_macaddr;
  5736. } __packed;
  5737. struct wmi_peer_q_empty_callback_event {
  5738. /* peer MAC address */
  5739. struct wmi_mac_addr peer_macaddr;
  5740. } __packed;
  5741. /*
  5742. * Channel info WMI event
  5743. */
  5744. struct wmi_chan_info_event {
  5745. __le32 err_code;
  5746. __le32 freq;
  5747. __le32 cmd_flags;
  5748. __le32 noise_floor;
  5749. __le32 rx_clear_count;
  5750. __le32 cycle_count;
  5751. } __packed;
  5752. struct wmi_10_4_chan_info_event {
  5753. __le32 err_code;
  5754. __le32 freq;
  5755. __le32 cmd_flags;
  5756. __le32 noise_floor;
  5757. __le32 rx_clear_count;
  5758. __le32 cycle_count;
  5759. __le32 chan_tx_pwr_range;
  5760. __le32 chan_tx_pwr_tp;
  5761. __le32 rx_frame_count;
  5762. } __packed;
  5763. struct wmi_peer_sta_kickout_event {
  5764. struct wmi_mac_addr peer_macaddr;
  5765. } __packed;
  5766. #define WMI_CHAN_INFO_FLAG_COMPLETE BIT(0)
  5767. #define WMI_CHAN_INFO_FLAG_PRE_COMPLETE BIT(1)
  5768. /* Beacon filter wmi command info */
  5769. #define BCN_FLT_MAX_SUPPORTED_IES 256
  5770. #define BCN_FLT_MAX_ELEMS_IE_LIST (BCN_FLT_MAX_SUPPORTED_IES / 32)
  5771. struct bss_bcn_stats {
  5772. __le32 vdev_id;
  5773. __le32 bss_bcnsdropped;
  5774. __le32 bss_bcnsdelivered;
  5775. } __packed;
  5776. struct bcn_filter_stats {
  5777. __le32 bcns_dropped;
  5778. __le32 bcns_delivered;
  5779. __le32 activefilters;
  5780. struct bss_bcn_stats bss_stats;
  5781. } __packed;
  5782. struct wmi_add_bcn_filter_cmd {
  5783. u32 vdev_id;
  5784. u32 ie_map[BCN_FLT_MAX_ELEMS_IE_LIST];
  5785. } __packed;
  5786. enum wmi_sta_keepalive_method {
  5787. WMI_STA_KEEPALIVE_METHOD_NULL_FRAME = 1,
  5788. WMI_STA_KEEPALIVE_METHOD_UNSOLICITATED_ARP_RESPONSE = 2,
  5789. };
  5790. #define WMI_STA_KEEPALIVE_INTERVAL_DISABLE 0
  5791. /* Firmware crashes if keepalive interval exceeds this limit */
  5792. #define WMI_STA_KEEPALIVE_INTERVAL_MAX_SECONDS 0xffff
  5793. /* note: ip4 addresses are in network byte order, i.e. big endian */
  5794. struct wmi_sta_keepalive_arp_resp {
  5795. __be32 src_ip4_addr;
  5796. __be32 dest_ip4_addr;
  5797. struct wmi_mac_addr dest_mac_addr;
  5798. } __packed;
  5799. struct wmi_sta_keepalive_cmd {
  5800. __le32 vdev_id;
  5801. __le32 enabled;
  5802. __le32 method; /* WMI_STA_KEEPALIVE_METHOD_ */
  5803. __le32 interval; /* in seconds */
  5804. struct wmi_sta_keepalive_arp_resp arp_resp;
  5805. } __packed;
  5806. struct wmi_sta_keepalive_arg {
  5807. u32 vdev_id;
  5808. u32 enabled;
  5809. u32 method;
  5810. u32 interval;
  5811. __be32 src_ip4_addr;
  5812. __be32 dest_ip4_addr;
  5813. const u8 dest_mac_addr[ETH_ALEN];
  5814. };
  5815. enum wmi_force_fw_hang_type {
  5816. WMI_FORCE_FW_HANG_ASSERT = 1,
  5817. WMI_FORCE_FW_HANG_NO_DETECT,
  5818. WMI_FORCE_FW_HANG_CTRL_EP_FULL,
  5819. WMI_FORCE_FW_HANG_EMPTY_POINT,
  5820. WMI_FORCE_FW_HANG_STACK_OVERFLOW,
  5821. WMI_FORCE_FW_HANG_INFINITE_LOOP,
  5822. };
  5823. #define WMI_FORCE_FW_HANG_RANDOM_TIME 0xFFFFFFFF
  5824. struct wmi_force_fw_hang_cmd {
  5825. __le32 type;
  5826. __le32 delay_ms;
  5827. } __packed;
  5828. enum wmi_pdev_reset_mode_type {
  5829. WMI_RST_MODE_TX_FLUSH = 1,
  5830. WMI_RST_MODE_WARM_RESET,
  5831. WMI_RST_MODE_COLD_RESET,
  5832. WMI_RST_MODE_WARM_RESET_RESTORE_CAL,
  5833. WMI_RST_MODE_COLD_RESET_RESTORE_CAL,
  5834. WMI_RST_MODE_MAX,
  5835. };
  5836. enum ath10k_dbglog_level {
  5837. ATH10K_DBGLOG_LEVEL_VERBOSE = 0,
  5838. ATH10K_DBGLOG_LEVEL_INFO = 1,
  5839. ATH10K_DBGLOG_LEVEL_WARN = 2,
  5840. ATH10K_DBGLOG_LEVEL_ERR = 3,
  5841. };
  5842. /* VAP ids to enable dbglog */
  5843. #define ATH10K_DBGLOG_CFG_VAP_LOG_LSB 0
  5844. #define ATH10K_DBGLOG_CFG_VAP_LOG_MASK 0x0000ffff
  5845. /* to enable dbglog in the firmware */
  5846. #define ATH10K_DBGLOG_CFG_REPORTING_ENABLE_LSB 16
  5847. #define ATH10K_DBGLOG_CFG_REPORTING_ENABLE_MASK 0x00010000
  5848. /* timestamp resolution */
  5849. #define ATH10K_DBGLOG_CFG_RESOLUTION_LSB 17
  5850. #define ATH10K_DBGLOG_CFG_RESOLUTION_MASK 0x000E0000
  5851. /* number of queued messages before sending them to the host */
  5852. #define ATH10K_DBGLOG_CFG_REPORT_SIZE_LSB 20
  5853. #define ATH10K_DBGLOG_CFG_REPORT_SIZE_MASK 0x0ff00000
  5854. /*
  5855. * Log levels to enable. This defines the minimum level to enable, this is
  5856. * not a bitmask. See enum ath10k_dbglog_level for the values.
  5857. */
  5858. #define ATH10K_DBGLOG_CFG_LOG_LVL_LSB 28
  5859. #define ATH10K_DBGLOG_CFG_LOG_LVL_MASK 0x70000000
  5860. /*
  5861. * Note: this is a cleaned up version of a struct firmware uses. For
  5862. * example, config_valid was hidden inside an array.
  5863. */
  5864. struct wmi_dbglog_cfg_cmd {
  5865. /* bitmask to hold mod id config*/
  5866. __le32 module_enable;
  5867. /* see ATH10K_DBGLOG_CFG_ */
  5868. __le32 config_enable;
  5869. /* mask of module id bits to be changed */
  5870. __le32 module_valid;
  5871. /* mask of config bits to be changed, see ATH10K_DBGLOG_CFG_ */
  5872. __le32 config_valid;
  5873. } __packed;
  5874. struct wmi_10_4_dbglog_cfg_cmd {
  5875. /* bitmask to hold mod id config*/
  5876. __le64 module_enable;
  5877. /* see ATH10K_DBGLOG_CFG_ */
  5878. __le32 config_enable;
  5879. /* mask of module id bits to be changed */
  5880. __le64 module_valid;
  5881. /* mask of config bits to be changed, see ATH10K_DBGLOG_CFG_ */
  5882. __le32 config_valid;
  5883. } __packed;
  5884. enum wmi_roam_reason {
  5885. WMI_ROAM_REASON_BETTER_AP = 1,
  5886. WMI_ROAM_REASON_BEACON_MISS = 2,
  5887. WMI_ROAM_REASON_LOW_RSSI = 3,
  5888. WMI_ROAM_REASON_SUITABLE_AP_FOUND = 4,
  5889. WMI_ROAM_REASON_HO_FAILED = 5,
  5890. /* keep last */
  5891. WMI_ROAM_REASON_MAX,
  5892. };
  5893. struct wmi_roam_ev {
  5894. __le32 vdev_id;
  5895. __le32 reason;
  5896. } __packed;
  5897. #define ATH10K_FRAGMT_THRESHOLD_MIN 540
  5898. #define ATH10K_FRAGMT_THRESHOLD_MAX 2346
  5899. #define WMI_MAX_EVENT 0x1000
  5900. /* Maximum number of pending TXed WMI packets */
  5901. #define WMI_SKB_HEADROOM sizeof(struct wmi_cmd_hdr)
  5902. /* By default disable power save for IBSS */
  5903. #define ATH10K_DEFAULT_ATIM 0
  5904. #define WMI_MAX_MEM_REQS 16
  5905. struct wmi_scan_ev_arg {
  5906. __le32 event_type; /* %WMI_SCAN_EVENT_ */
  5907. __le32 reason; /* %WMI_SCAN_REASON_ */
  5908. __le32 channel_freq; /* only valid for WMI_SCAN_EVENT_FOREIGN_CHANNEL */
  5909. __le32 scan_req_id;
  5910. __le32 scan_id;
  5911. __le32 vdev_id;
  5912. };
  5913. struct wmi_tlv_mgmt_tx_compl_ev_arg {
  5914. __le32 desc_id;
  5915. __le32 status;
  5916. __le32 pdev_id;
  5917. };
  5918. struct wmi_mgmt_rx_ev_arg {
  5919. __le32 channel;
  5920. __le32 snr;
  5921. __le32 rate;
  5922. __le32 phy_mode;
  5923. __le32 buf_len;
  5924. __le32 status; /* %WMI_RX_STATUS_ */
  5925. struct wmi_mgmt_rx_ext_info ext_info;
  5926. };
  5927. struct wmi_ch_info_ev_arg {
  5928. __le32 err_code;
  5929. __le32 freq;
  5930. __le32 cmd_flags;
  5931. __le32 noise_floor;
  5932. __le32 rx_clear_count;
  5933. __le32 cycle_count;
  5934. __le32 chan_tx_pwr_range;
  5935. __le32 chan_tx_pwr_tp;
  5936. __le32 rx_frame_count;
  5937. };
  5938. struct wmi_vdev_start_ev_arg {
  5939. __le32 vdev_id;
  5940. __le32 req_id;
  5941. __le32 resp_type; /* %WMI_VDEV_RESP_ */
  5942. __le32 status;
  5943. };
  5944. struct wmi_peer_kick_ev_arg {
  5945. const u8 *mac_addr;
  5946. };
  5947. struct wmi_swba_ev_arg {
  5948. __le32 vdev_map;
  5949. struct wmi_tim_info_arg tim_info[WMI_MAX_AP_VDEV];
  5950. const struct wmi_p2p_noa_info *noa_info[WMI_MAX_AP_VDEV];
  5951. };
  5952. struct wmi_phyerr_ev_arg {
  5953. u32 tsf_timestamp;
  5954. u16 freq1;
  5955. u16 freq2;
  5956. u8 rssi_combined;
  5957. u8 chan_width_mhz;
  5958. u8 phy_err_code;
  5959. u16 nf_chains[4];
  5960. u32 buf_len;
  5961. const u8 *buf;
  5962. u8 hdr_len;
  5963. };
  5964. struct wmi_phyerr_hdr_arg {
  5965. u32 num_phyerrs;
  5966. u32 tsf_l32;
  5967. u32 tsf_u32;
  5968. u32 buf_len;
  5969. const void *phyerrs;
  5970. };
  5971. struct wmi_dfs_status_ev_arg {
  5972. u32 status;
  5973. };
  5974. struct wmi_svc_rdy_ev_arg {
  5975. __le32 min_tx_power;
  5976. __le32 max_tx_power;
  5977. __le32 ht_cap;
  5978. __le32 vht_cap;
  5979. __le32 sw_ver0;
  5980. __le32 sw_ver1;
  5981. __le32 fw_build;
  5982. __le32 phy_capab;
  5983. __le32 num_rf_chains;
  5984. __le32 eeprom_rd;
  5985. __le32 num_mem_reqs;
  5986. __le32 low_5ghz_chan;
  5987. __le32 high_5ghz_chan;
  5988. const __le32 *service_map;
  5989. size_t service_map_len;
  5990. const struct wlan_host_mem_req *mem_reqs[WMI_MAX_MEM_REQS];
  5991. };
  5992. struct wmi_svc_avail_ev_arg {
  5993. __le32 service_map_ext_len;
  5994. const __le32 *service_map_ext;
  5995. };
  5996. struct wmi_rdy_ev_arg {
  5997. __le32 sw_version;
  5998. __le32 abi_version;
  5999. __le32 status;
  6000. const u8 *mac_addr;
  6001. };
  6002. struct wmi_roam_ev_arg {
  6003. __le32 vdev_id;
  6004. __le32 reason;
  6005. __le32 rssi;
  6006. };
  6007. struct wmi_echo_ev_arg {
  6008. __le32 value;
  6009. };
  6010. struct wmi_pdev_temperature_event {
  6011. /* temperature value in Celcius degree */
  6012. __le32 temperature;
  6013. } __packed;
  6014. struct wmi_pdev_bss_chan_info_event {
  6015. __le32 freq;
  6016. __le32 noise_floor;
  6017. __le64 cycle_busy;
  6018. __le64 cycle_total;
  6019. __le64 cycle_tx;
  6020. __le64 cycle_rx;
  6021. __le64 cycle_rx_bss;
  6022. __le32 reserved;
  6023. } __packed;
  6024. /* WOW structures */
  6025. enum wmi_wow_wakeup_event {
  6026. WOW_BMISS_EVENT = 0,
  6027. WOW_BETTER_AP_EVENT,
  6028. WOW_DEAUTH_RECVD_EVENT,
  6029. WOW_MAGIC_PKT_RECVD_EVENT,
  6030. WOW_GTK_ERR_EVENT,
  6031. WOW_FOURWAY_HSHAKE_EVENT,
  6032. WOW_EAPOL_RECVD_EVENT,
  6033. WOW_NLO_DETECTED_EVENT,
  6034. WOW_DISASSOC_RECVD_EVENT,
  6035. WOW_PATTERN_MATCH_EVENT,
  6036. WOW_CSA_IE_EVENT,
  6037. WOW_PROBE_REQ_WPS_IE_EVENT,
  6038. WOW_AUTH_REQ_EVENT,
  6039. WOW_ASSOC_REQ_EVENT,
  6040. WOW_HTT_EVENT,
  6041. WOW_RA_MATCH_EVENT,
  6042. WOW_HOST_AUTO_SHUTDOWN_EVENT,
  6043. WOW_IOAC_MAGIC_EVENT,
  6044. WOW_IOAC_SHORT_EVENT,
  6045. WOW_IOAC_EXTEND_EVENT,
  6046. WOW_IOAC_TIMER_EVENT,
  6047. WOW_DFS_PHYERR_RADAR_EVENT,
  6048. WOW_BEACON_EVENT,
  6049. WOW_CLIENT_KICKOUT_EVENT,
  6050. WOW_EVENT_MAX,
  6051. };
  6052. #define C2S(x) case x: return #x
  6053. static inline const char *wow_wakeup_event(enum wmi_wow_wakeup_event ev)
  6054. {
  6055. switch (ev) {
  6056. C2S(WOW_BMISS_EVENT);
  6057. C2S(WOW_BETTER_AP_EVENT);
  6058. C2S(WOW_DEAUTH_RECVD_EVENT);
  6059. C2S(WOW_MAGIC_PKT_RECVD_EVENT);
  6060. C2S(WOW_GTK_ERR_EVENT);
  6061. C2S(WOW_FOURWAY_HSHAKE_EVENT);
  6062. C2S(WOW_EAPOL_RECVD_EVENT);
  6063. C2S(WOW_NLO_DETECTED_EVENT);
  6064. C2S(WOW_DISASSOC_RECVD_EVENT);
  6065. C2S(WOW_PATTERN_MATCH_EVENT);
  6066. C2S(WOW_CSA_IE_EVENT);
  6067. C2S(WOW_PROBE_REQ_WPS_IE_EVENT);
  6068. C2S(WOW_AUTH_REQ_EVENT);
  6069. C2S(WOW_ASSOC_REQ_EVENT);
  6070. C2S(WOW_HTT_EVENT);
  6071. C2S(WOW_RA_MATCH_EVENT);
  6072. C2S(WOW_HOST_AUTO_SHUTDOWN_EVENT);
  6073. C2S(WOW_IOAC_MAGIC_EVENT);
  6074. C2S(WOW_IOAC_SHORT_EVENT);
  6075. C2S(WOW_IOAC_EXTEND_EVENT);
  6076. C2S(WOW_IOAC_TIMER_EVENT);
  6077. C2S(WOW_DFS_PHYERR_RADAR_EVENT);
  6078. C2S(WOW_BEACON_EVENT);
  6079. C2S(WOW_CLIENT_KICKOUT_EVENT);
  6080. C2S(WOW_EVENT_MAX);
  6081. default:
  6082. return NULL;
  6083. }
  6084. }
  6085. enum wmi_wow_wake_reason {
  6086. WOW_REASON_UNSPECIFIED = -1,
  6087. WOW_REASON_NLOD = 0,
  6088. WOW_REASON_AP_ASSOC_LOST,
  6089. WOW_REASON_LOW_RSSI,
  6090. WOW_REASON_DEAUTH_RECVD,
  6091. WOW_REASON_DISASSOC_RECVD,
  6092. WOW_REASON_GTK_HS_ERR,
  6093. WOW_REASON_EAP_REQ,
  6094. WOW_REASON_FOURWAY_HS_RECV,
  6095. WOW_REASON_TIMER_INTR_RECV,
  6096. WOW_REASON_PATTERN_MATCH_FOUND,
  6097. WOW_REASON_RECV_MAGIC_PATTERN,
  6098. WOW_REASON_P2P_DISC,
  6099. WOW_REASON_WLAN_HB,
  6100. WOW_REASON_CSA_EVENT,
  6101. WOW_REASON_PROBE_REQ_WPS_IE_RECV,
  6102. WOW_REASON_AUTH_REQ_RECV,
  6103. WOW_REASON_ASSOC_REQ_RECV,
  6104. WOW_REASON_HTT_EVENT,
  6105. WOW_REASON_RA_MATCH,
  6106. WOW_REASON_HOST_AUTO_SHUTDOWN,
  6107. WOW_REASON_IOAC_MAGIC_EVENT,
  6108. WOW_REASON_IOAC_SHORT_EVENT,
  6109. WOW_REASON_IOAC_EXTEND_EVENT,
  6110. WOW_REASON_IOAC_TIMER_EVENT,
  6111. WOW_REASON_ROAM_HO,
  6112. WOW_REASON_DFS_PHYERR_RADADR_EVENT,
  6113. WOW_REASON_BEACON_RECV,
  6114. WOW_REASON_CLIENT_KICKOUT_EVENT,
  6115. WOW_REASON_DEBUG_TEST = 0xFF,
  6116. };
  6117. static inline const char *wow_reason(enum wmi_wow_wake_reason reason)
  6118. {
  6119. switch (reason) {
  6120. C2S(WOW_REASON_UNSPECIFIED);
  6121. C2S(WOW_REASON_NLOD);
  6122. C2S(WOW_REASON_AP_ASSOC_LOST);
  6123. C2S(WOW_REASON_LOW_RSSI);
  6124. C2S(WOW_REASON_DEAUTH_RECVD);
  6125. C2S(WOW_REASON_DISASSOC_RECVD);
  6126. C2S(WOW_REASON_GTK_HS_ERR);
  6127. C2S(WOW_REASON_EAP_REQ);
  6128. C2S(WOW_REASON_FOURWAY_HS_RECV);
  6129. C2S(WOW_REASON_TIMER_INTR_RECV);
  6130. C2S(WOW_REASON_PATTERN_MATCH_FOUND);
  6131. C2S(WOW_REASON_RECV_MAGIC_PATTERN);
  6132. C2S(WOW_REASON_P2P_DISC);
  6133. C2S(WOW_REASON_WLAN_HB);
  6134. C2S(WOW_REASON_CSA_EVENT);
  6135. C2S(WOW_REASON_PROBE_REQ_WPS_IE_RECV);
  6136. C2S(WOW_REASON_AUTH_REQ_RECV);
  6137. C2S(WOW_REASON_ASSOC_REQ_RECV);
  6138. C2S(WOW_REASON_HTT_EVENT);
  6139. C2S(WOW_REASON_RA_MATCH);
  6140. C2S(WOW_REASON_HOST_AUTO_SHUTDOWN);
  6141. C2S(WOW_REASON_IOAC_MAGIC_EVENT);
  6142. C2S(WOW_REASON_IOAC_SHORT_EVENT);
  6143. C2S(WOW_REASON_IOAC_EXTEND_EVENT);
  6144. C2S(WOW_REASON_IOAC_TIMER_EVENT);
  6145. C2S(WOW_REASON_ROAM_HO);
  6146. C2S(WOW_REASON_DFS_PHYERR_RADADR_EVENT);
  6147. C2S(WOW_REASON_BEACON_RECV);
  6148. C2S(WOW_REASON_CLIENT_KICKOUT_EVENT);
  6149. C2S(WOW_REASON_DEBUG_TEST);
  6150. default:
  6151. return NULL;
  6152. }
  6153. }
  6154. #undef C2S
  6155. struct wmi_wow_ev_arg {
  6156. u32 vdev_id;
  6157. u32 flag;
  6158. enum wmi_wow_wake_reason wake_reason;
  6159. u32 data_len;
  6160. };
  6161. #define WOW_MIN_PATTERN_SIZE 1
  6162. #define WOW_MAX_PATTERN_SIZE 148
  6163. #define WOW_MAX_PKT_OFFSET 128
  6164. #define WOW_HDR_LEN (sizeof(struct ieee80211_hdr_3addr) + \
  6165. sizeof(struct rfc1042_hdr))
  6166. #define WOW_MAX_REDUCE (WOW_HDR_LEN - sizeof(struct ethhdr) - \
  6167. offsetof(struct ieee80211_hdr_3addr, addr1))
  6168. enum wmi_tdls_state {
  6169. WMI_TDLS_DISABLE,
  6170. WMI_TDLS_ENABLE_PASSIVE,
  6171. WMI_TDLS_ENABLE_ACTIVE,
  6172. WMI_TDLS_ENABLE_ACTIVE_EXTERNAL_CONTROL,
  6173. };
  6174. enum wmi_tdls_peer_state {
  6175. WMI_TDLS_PEER_STATE_PEERING,
  6176. WMI_TDLS_PEER_STATE_CONNECTED,
  6177. WMI_TDLS_PEER_STATE_TEARDOWN,
  6178. };
  6179. struct wmi_tdls_peer_update_cmd_arg {
  6180. u32 vdev_id;
  6181. enum wmi_tdls_peer_state peer_state;
  6182. u8 addr[ETH_ALEN];
  6183. };
  6184. #define WMI_TDLS_MAX_SUPP_OPER_CLASSES 32
  6185. #define WMI_TDLS_PEER_SP_MASK 0x60
  6186. #define WMI_TDLS_PEER_SP_LSB 5
  6187. enum wmi_tdls_options {
  6188. WMI_TDLS_OFFCHAN_EN = BIT(0),
  6189. WMI_TDLS_BUFFER_STA_EN = BIT(1),
  6190. WMI_TDLS_SLEEP_STA_EN = BIT(2),
  6191. };
  6192. enum {
  6193. WMI_TDLS_PEER_QOS_AC_VO = BIT(0),
  6194. WMI_TDLS_PEER_QOS_AC_VI = BIT(1),
  6195. WMI_TDLS_PEER_QOS_AC_BK = BIT(2),
  6196. WMI_TDLS_PEER_QOS_AC_BE = BIT(3),
  6197. };
  6198. struct wmi_tdls_peer_capab_arg {
  6199. u8 peer_uapsd_queues;
  6200. u8 peer_max_sp;
  6201. u32 buff_sta_support;
  6202. u32 off_chan_support;
  6203. u32 peer_curr_operclass;
  6204. u32 self_curr_operclass;
  6205. u32 peer_chan_len;
  6206. u32 peer_operclass_len;
  6207. u8 peer_operclass[WMI_TDLS_MAX_SUPP_OPER_CLASSES];
  6208. u32 is_peer_responder;
  6209. u32 pref_offchan_num;
  6210. u32 pref_offchan_bw;
  6211. };
  6212. struct wmi_10_4_tdls_set_state_cmd {
  6213. __le32 vdev_id;
  6214. __le32 state;
  6215. __le32 notification_interval_ms;
  6216. __le32 tx_discovery_threshold;
  6217. __le32 tx_teardown_threshold;
  6218. __le32 rssi_teardown_threshold;
  6219. __le32 rssi_delta;
  6220. __le32 tdls_options;
  6221. __le32 tdls_peer_traffic_ind_window;
  6222. __le32 tdls_peer_traffic_response_timeout_ms;
  6223. __le32 tdls_puapsd_mask;
  6224. __le32 tdls_puapsd_inactivity_time_ms;
  6225. __le32 tdls_puapsd_rx_frame_threshold;
  6226. __le32 teardown_notification_ms;
  6227. __le32 tdls_peer_kickout_threshold;
  6228. } __packed;
  6229. struct wmi_tdls_peer_capabilities {
  6230. __le32 peer_qos;
  6231. __le32 buff_sta_support;
  6232. __le32 off_chan_support;
  6233. __le32 peer_curr_operclass;
  6234. __le32 self_curr_operclass;
  6235. __le32 peer_chan_len;
  6236. __le32 peer_operclass_len;
  6237. u8 peer_operclass[WMI_TDLS_MAX_SUPP_OPER_CLASSES];
  6238. __le32 is_peer_responder;
  6239. __le32 pref_offchan_num;
  6240. __le32 pref_offchan_bw;
  6241. struct wmi_channel peer_chan_list[1];
  6242. } __packed;
  6243. struct wmi_10_4_tdls_peer_update_cmd {
  6244. __le32 vdev_id;
  6245. struct wmi_mac_addr peer_macaddr;
  6246. __le32 peer_state;
  6247. __le32 reserved[4];
  6248. struct wmi_tdls_peer_capabilities peer_capab;
  6249. } __packed;
  6250. enum wmi_tdls_peer_reason {
  6251. WMI_TDLS_TEARDOWN_REASON_TX,
  6252. WMI_TDLS_TEARDOWN_REASON_RSSI,
  6253. WMI_TDLS_TEARDOWN_REASON_SCAN,
  6254. WMI_TDLS_DISCONNECTED_REASON_PEER_DELETE,
  6255. WMI_TDLS_TEARDOWN_REASON_PTR_TIMEOUT,
  6256. WMI_TDLS_TEARDOWN_REASON_BAD_PTR,
  6257. WMI_TDLS_TEARDOWN_REASON_NO_RESPONSE,
  6258. WMI_TDLS_ENTER_BUF_STA,
  6259. WMI_TDLS_EXIT_BUF_STA,
  6260. WMI_TDLS_ENTER_BT_BUSY_MODE,
  6261. WMI_TDLS_EXIT_BT_BUSY_MODE,
  6262. WMI_TDLS_SCAN_STARTED_EVENT,
  6263. WMI_TDLS_SCAN_COMPLETED_EVENT,
  6264. };
  6265. enum wmi_tdls_peer_notification {
  6266. WMI_TDLS_SHOULD_DISCOVER,
  6267. WMI_TDLS_SHOULD_TEARDOWN,
  6268. WMI_TDLS_PEER_DISCONNECTED,
  6269. WMI_TDLS_CONNECTION_TRACKER_NOTIFICATION,
  6270. };
  6271. struct wmi_tdls_peer_event {
  6272. struct wmi_mac_addr peer_macaddr;
  6273. /* see enum wmi_tdls_peer_notification*/
  6274. __le32 peer_status;
  6275. /* see enum wmi_tdls_peer_reason */
  6276. __le32 peer_reason;
  6277. __le32 vdev_id;
  6278. } __packed;
  6279. enum wmi_txbf_conf {
  6280. WMI_TXBF_CONF_UNSUPPORTED,
  6281. WMI_TXBF_CONF_BEFORE_ASSOC,
  6282. WMI_TXBF_CONF_AFTER_ASSOC,
  6283. };
  6284. #define WMI_CCA_DETECT_LEVEL_AUTO 0
  6285. #define WMI_CCA_DETECT_MARGIN_AUTO 0
  6286. struct wmi_pdev_set_adaptive_cca_params {
  6287. __le32 enable;
  6288. __le32 cca_detect_level;
  6289. __le32 cca_detect_margin;
  6290. } __packed;
  6291. enum wmi_host_platform_type {
  6292. WMI_HOST_PLATFORM_HIGH_PERF,
  6293. WMI_HOST_PLATFORM_LOW_PERF,
  6294. };
  6295. enum wmi_bss_survey_req_type {
  6296. WMI_BSS_SURVEY_REQ_TYPE_READ = 1,
  6297. WMI_BSS_SURVEY_REQ_TYPE_READ_CLEAR,
  6298. };
  6299. struct wmi_pdev_chan_info_req_cmd {
  6300. __le32 type;
  6301. __le32 reserved;
  6302. } __packed;
  6303. struct ath10k;
  6304. struct ath10k_vif;
  6305. struct ath10k_fw_stats_pdev;
  6306. struct ath10k_fw_stats_peer;
  6307. struct ath10k_fw_stats;
  6308. int ath10k_wmi_attach(struct ath10k *ar);
  6309. void ath10k_wmi_detach(struct ath10k *ar);
  6310. void ath10k_wmi_free_host_mem(struct ath10k *ar);
  6311. int ath10k_wmi_wait_for_service_ready(struct ath10k *ar);
  6312. int ath10k_wmi_wait_for_unified_ready(struct ath10k *ar);
  6313. struct sk_buff *ath10k_wmi_alloc_skb(struct ath10k *ar, u32 len);
  6314. int ath10k_wmi_connect(struct ath10k *ar);
  6315. struct sk_buff *ath10k_wmi_alloc_skb(struct ath10k *ar, u32 len);
  6316. int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id);
  6317. int ath10k_wmi_cmd_send_nowait(struct ath10k *ar, struct sk_buff *skb,
  6318. u32 cmd_id);
  6319. void ath10k_wmi_start_scan_init(struct ath10k *ar, struct wmi_start_scan_arg *arg);
  6320. void ath10k_wmi_pull_pdev_stats_base(const struct wmi_pdev_stats_base *src,
  6321. struct ath10k_fw_stats_pdev *dst);
  6322. void ath10k_wmi_pull_pdev_stats_tx(const struct wmi_pdev_stats_tx *src,
  6323. struct ath10k_fw_stats_pdev *dst);
  6324. void ath10k_wmi_pull_pdev_stats_rx(const struct wmi_pdev_stats_rx *src,
  6325. struct ath10k_fw_stats_pdev *dst);
  6326. void ath10k_wmi_pull_pdev_stats_extra(const struct wmi_pdev_stats_extra *src,
  6327. struct ath10k_fw_stats_pdev *dst);
  6328. void ath10k_wmi_pull_peer_stats(const struct wmi_peer_stats *src,
  6329. struct ath10k_fw_stats_peer *dst);
  6330. void ath10k_wmi_put_host_mem_chunks(struct ath10k *ar,
  6331. struct wmi_host_mem_chunks *chunks);
  6332. void ath10k_wmi_put_start_scan_common(struct wmi_start_scan_common *cmn,
  6333. const struct wmi_start_scan_arg *arg);
  6334. void ath10k_wmi_set_wmm_param(struct wmi_wmm_params *params,
  6335. const struct wmi_wmm_params_arg *arg);
  6336. void ath10k_wmi_put_wmi_channel(struct wmi_channel *ch,
  6337. const struct wmi_channel_arg *arg);
  6338. int ath10k_wmi_start_scan_verify(const struct wmi_start_scan_arg *arg);
  6339. int ath10k_wmi_event_scan(struct ath10k *ar, struct sk_buff *skb);
  6340. int ath10k_wmi_event_mgmt_rx(struct ath10k *ar, struct sk_buff *skb);
  6341. int ath10k_wmi_event_mgmt_tx_compl(struct ath10k *ar, struct sk_buff *skb);
  6342. void ath10k_wmi_event_chan_info(struct ath10k *ar, struct sk_buff *skb);
  6343. void ath10k_wmi_event_echo(struct ath10k *ar, struct sk_buff *skb);
  6344. int ath10k_wmi_event_debug_mesg(struct ath10k *ar, struct sk_buff *skb);
  6345. void ath10k_wmi_event_update_stats(struct ath10k *ar, struct sk_buff *skb);
  6346. void ath10k_wmi_event_vdev_start_resp(struct ath10k *ar, struct sk_buff *skb);
  6347. void ath10k_wmi_event_vdev_stopped(struct ath10k *ar, struct sk_buff *skb);
  6348. void ath10k_wmi_event_peer_sta_kickout(struct ath10k *ar, struct sk_buff *skb);
  6349. void ath10k_wmi_event_host_swba(struct ath10k *ar, struct sk_buff *skb);
  6350. void ath10k_wmi_event_tbttoffset_update(struct ath10k *ar, struct sk_buff *skb);
  6351. void ath10k_wmi_event_dfs(struct ath10k *ar,
  6352. struct wmi_phyerr_ev_arg *phyerr, u64 tsf);
  6353. void ath10k_wmi_event_spectral_scan(struct ath10k *ar,
  6354. struct wmi_phyerr_ev_arg *phyerr,
  6355. u64 tsf);
  6356. void ath10k_wmi_event_phyerr(struct ath10k *ar, struct sk_buff *skb);
  6357. void ath10k_wmi_event_roam(struct ath10k *ar, struct sk_buff *skb);
  6358. void ath10k_wmi_event_profile_match(struct ath10k *ar, struct sk_buff *skb);
  6359. void ath10k_wmi_event_debug_print(struct ath10k *ar, struct sk_buff *skb);
  6360. void ath10k_wmi_event_pdev_qvit(struct ath10k *ar, struct sk_buff *skb);
  6361. void ath10k_wmi_event_wlan_profile_data(struct ath10k *ar, struct sk_buff *skb);
  6362. void ath10k_wmi_event_rtt_measurement_report(struct ath10k *ar,
  6363. struct sk_buff *skb);
  6364. void ath10k_wmi_event_tsf_measurement_report(struct ath10k *ar,
  6365. struct sk_buff *skb);
  6366. void ath10k_wmi_event_rtt_error_report(struct ath10k *ar, struct sk_buff *skb);
  6367. void ath10k_wmi_event_wow_wakeup_host(struct ath10k *ar, struct sk_buff *skb);
  6368. void ath10k_wmi_event_dcs_interference(struct ath10k *ar, struct sk_buff *skb);
  6369. void ath10k_wmi_event_pdev_tpc_config(struct ath10k *ar, struct sk_buff *skb);
  6370. void ath10k_wmi_event_pdev_ftm_intg(struct ath10k *ar, struct sk_buff *skb);
  6371. void ath10k_wmi_event_gtk_offload_status(struct ath10k *ar,
  6372. struct sk_buff *skb);
  6373. void ath10k_wmi_event_gtk_rekey_fail(struct ath10k *ar, struct sk_buff *skb);
  6374. void ath10k_wmi_event_delba_complete(struct ath10k *ar, struct sk_buff *skb);
  6375. void ath10k_wmi_event_addba_complete(struct ath10k *ar, struct sk_buff *skb);
  6376. void ath10k_wmi_event_vdev_install_key_complete(struct ath10k *ar,
  6377. struct sk_buff *skb);
  6378. void ath10k_wmi_event_inst_rssi_stats(struct ath10k *ar, struct sk_buff *skb);
  6379. void ath10k_wmi_event_vdev_standby_req(struct ath10k *ar, struct sk_buff *skb);
  6380. void ath10k_wmi_event_vdev_resume_req(struct ath10k *ar, struct sk_buff *skb);
  6381. void ath10k_wmi_event_service_ready(struct ath10k *ar, struct sk_buff *skb);
  6382. int ath10k_wmi_event_ready(struct ath10k *ar, struct sk_buff *skb);
  6383. void ath10k_wmi_event_service_available(struct ath10k *ar, struct sk_buff *skb);
  6384. int ath10k_wmi_op_pull_phyerr_ev(struct ath10k *ar, const void *phyerr_buf,
  6385. int left_len, struct wmi_phyerr_ev_arg *arg);
  6386. void ath10k_wmi_main_op_fw_stats_fill(struct ath10k *ar,
  6387. struct ath10k_fw_stats *fw_stats,
  6388. char *buf);
  6389. void ath10k_wmi_10x_op_fw_stats_fill(struct ath10k *ar,
  6390. struct ath10k_fw_stats *fw_stats,
  6391. char *buf);
  6392. size_t ath10k_wmi_fw_stats_num_peers(struct list_head *head);
  6393. size_t ath10k_wmi_fw_stats_num_vdevs(struct list_head *head);
  6394. void ath10k_wmi_10_4_op_fw_stats_fill(struct ath10k *ar,
  6395. struct ath10k_fw_stats *fw_stats,
  6396. char *buf);
  6397. int ath10k_wmi_op_get_vdev_subtype(struct ath10k *ar,
  6398. enum wmi_vdev_subtype subtype);
  6399. int ath10k_wmi_barrier(struct ath10k *ar);
  6400. void ath10k_wmi_tpc_config_get_rate_code(u8 *rate_code, u16 *pream_table,
  6401. u32 num_tx_chain);
  6402. void ath10k_wmi_event_tpc_final_table(struct ath10k *ar, struct sk_buff *skb);
  6403. #endif /* _WMI_H_ */