wmi.h 204 KB

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