wmi.h 200 KB

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