wmi.h 215 KB

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