htt.h 530 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710
  1. /*
  2. * Copyright (c) 2011-2019 The Linux Foundation. All rights reserved.
  3. *
  4. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  5. *
  6. *
  7. * Permission to use, copy, modify, and/or distribute this software for
  8. * any purpose with or without fee is hereby granted, provided that the
  9. * above copyright notice and this permission notice appear in all
  10. * copies.
  11. *
  12. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  13. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  14. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  15. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  16. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  17. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  18. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  19. * PERFORMANCE OF THIS SOFTWARE.
  20. */
  21. /*
  22. * This file was originally distributed by Qualcomm Atheros, Inc.
  23. * under proprietary terms before Copyright ownership was assigned
  24. * to the Linux Foundation.
  25. */
  26. /**
  27. * @file htt.h
  28. *
  29. * @details the public header file of HTT layer
  30. */
  31. #ifndef _HTT_H_
  32. #define _HTT_H_
  33. #include <htt_deps.h>
  34. #include <htt_common.h>
  35. /*
  36. * Unless explicitly specified to use 64 bits to represent physical addresses
  37. * (or more precisely, bus addresses), default to 32 bits.
  38. */
  39. #ifndef HTT_PADDR64
  40. #define HTT_PADDR64 0
  41. #endif
  42. #ifndef offsetof
  43. #define offsetof(type, field) ((unsigned int)(&((type *)0)->field))
  44. #endif
  45. /*
  46. * HTT version history:
  47. * 1.0 initial numbered version
  48. * 1.1 modifications to STATS messages.
  49. * These modifications are not backwards compatible, but since the
  50. * STATS messages themselves are non-essential (they are for debugging),
  51. * the 1.1 version of the HTT message library as a whole is compatible
  52. * with the 1.0 version.
  53. * 1.2 reset mask IE added to STATS_REQ message
  54. * 1.3 stat config IE added to STATS_REQ message
  55. *----
  56. * 2.0 FW rx PPDU desc added to RX_IND message
  57. * 2.1 Enable msdu_ext/frag_desc banking change for WIFI2.0
  58. *----
  59. * 3.0 Remove HTT_H2T_MSG_TYPE_MGMT_TX message
  60. * 3.1 Added HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND message
  61. * 3.2 Added HTT_H2T_MSG_TYPE_WDI_IPA_CFG,
  62. * HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST messages
  63. * 3.3 Added HTT_H2T_MSG_TYPE_AGGR_CFG_EX message
  64. * 3.4 Added tx_compl_req flag in HTT tx descriptor
  65. * 3.5 Added flush and fail stats in rx_reorder stats structure
  66. * 3.6 Added frag flag in HTT RX INORDER PADDR IND header
  67. * 3.7 Made changes to support EOS Mac_core 3.0
  68. * 3.8 Added txq_group information element definition;
  69. * added optional txq_group suffix to TX_CREDIT_UPDATE_IND message
  70. * 3.9 Added HTT_T2H CHAN_CHANGE message;
  71. * Allow buffer addresses in bus-address format to be stored as
  72. * either 32 bits or 64 bits.
  73. * 3.10 Add optional TLV extensions to the VERSION_REQ and VERSION_CONF
  74. * messages to specify which HTT options to use.
  75. * Initial TLV options cover:
  76. * - whether to use 32 or 64 bits to represent LL bus addresses
  77. * - whether to use TX_COMPL_IND or TX_CREDIT_UPDATE_IND in HL systems
  78. * - how many tx queue groups to use
  79. * 3.11 Expand rx debug stats:
  80. * - Expand the rx_reorder_stats struct with stats about successful and
  81. * failed rx buffer allcoations.
  82. * - Add a new rx_remote_buffer_mgmt_stats struct with stats about
  83. * the supply, allocation, use, and recycling of rx buffers for the
  84. * "remote ring" of rx buffers in host member in LL systems.
  85. * Add RX_REMOTE_RING_BUFFER_INFO stats type for uploading these stats.
  86. * 3.12 Add "rx offload packet error" message with initial "MIC error" subtype
  87. * 3.13 Add constants + macros to support 64-bit address format for the
  88. * tx fragments descriptor, the rx ring buffer, and the rx ring
  89. * index shadow register.
  90. * 3.14 Add a method for the host to provide detailed per-frame tx specs:
  91. * - Add htt_tx_msdu_desc_ext_t struct def.
  92. * - Add TLV to specify whether the target supports the HTT tx MSDU
  93. * extension descriptor.
  94. * - Change a reserved bit in the HTT tx MSDU descriptor to an
  95. * "extension" bit, to specify whether a HTT tx MSDU extension
  96. * descriptor is present.
  97. * 3.15 Add HW rx desc info to per-MSDU info elems in RX_IN_ORD_PADDR_IND msg.
  98. * (This allows the host to obtain key information about the MSDU
  99. * from a memory location already in the cache, rather than taking a
  100. * cache miss for each MSDU by reading the HW rx descs.)
  101. * 3.16 Add htt_pkt_type_eth2 and define pkt_subtype flags to indicate
  102. * whether a copy-engine classification result is appended to TX_FRM.
  103. * 3.17 Add a version of the WDI_IPA_CFG message; add RX_RING2 to WDI_IPA_CFG
  104. * 3.18 Add a PEER_DEL tx completion indication status, for HL cleanup of
  105. * tx frames in the target after the peer has already been deleted.
  106. * 3.19 Add HTT_DBG_STATS_RX_RATE_INFO_V2 and HTT_DBG_STATS_TX_RATE_INFO_V2
  107. * 3.20 Expand rx_reorder_stats.
  108. * 3.21 Add optional rx channel spec to HL RX_IND.
  109. * 3.22 Expand rx_reorder_stats
  110. * (distinguish duplicates within vs. outside block ack window)
  111. * 3.23 Add HTT_T2H_MSG_TYPE_RATE_REPORT to report peer justified rate.
  112. * The justified rate is calculated by two steps. The first is to multiply
  113. * user-rate by (1 - PER) and the other is to smooth the step 1's result
  114. * by a low pass filter.
  115. * This change allows HL download scheduling to consider the WLAN rate
  116. * that will be used for transmitting the downloaded frames.
  117. * 3.24 Expand rx_reorder_stats
  118. * (add counter for decrypt / MIC errors)
  119. * 3.25 Expand rx_reorder_stats
  120. * (add counter of frames received into both local + remote rings)
  121. * 3.26 Add stats struct for counting rx of tx BF, MU, SU, and NDPA frames
  122. * (HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT, rx_txbf_musu_ndpa_pkts_stats)
  123. * 3.27 Add a new interface for flow-control. The following t2h messages have
  124. * been included: HTT_T2H_MSG_TYPE_FLOW_POOL_MAP and
  125. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  126. * 3.28 Add a new interface for ring interface change. The following two h2t
  127. * and one t2h messages have been included:
  128. * HTT_H2T_MSG_TYPE_SRING_SETUP, HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG,
  129. * and HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  130. * 3.29 Add definitions of htt_tx_msdu_desc_ext2_t descriptor and other
  131. * information elements passed from the host to a Lithium target,
  132. * Add definitions of the HTT_H2T ADD_WDS_ENTRY and DELETE_WDS_ENTRY
  133. * messages and the HTT_T2H MAP_FLOW_INFO message (for use with Lithium
  134. * targets).
  135. * 3.30 Add pktlog flag inside HTT_T2H RX_IN_ORD_PADDR_IND message
  136. * 3.31 Add HTT_H2T_MSG_TYPE_RFS_CONFIG
  137. * 3.32 Add HTT_WDI_IPA_OPCODE_SHARING_STATS, HTT_WDI_IPA_OPCODE_SET_QUOTA and
  138. * HTT_WDI_IPA_OPCODE_IND_QUOTA for getting quota and reporting WiFi
  139. * sharing stats
  140. * 3.33 Add HTT_TX_COMPL_IND_STAT_DROP and HTT_TX_COMPL_IND_STAT_HOST_INSPECT
  141. * 3.34 Add HW_PEER_ID field to PEER_MAP
  142. * 3.35 Revise bitfield defs of HTT_SRING_SETUP message
  143. * (changes are not backwards compatible, but HTT_SRING_SETUP message is
  144. * not yet in use)
  145. * 3.36 Add HTT_H2T_MSG_TYPE_EXT_STATS_REQ and HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  146. * 3.37 Add HTT_PEER_TYPE and htt_mac_addr defs
  147. * 3.38 Add holes_no_filled field to rx_reorder_stats
  148. * 3.39 Add host_inspected flag to htt_tx_tcl_vdev_metadata
  149. * 3.40 Add optional timestamps in the HTT tx completion
  150. * 3.41 Add optional tx power spec in the HTT tx completion (for DSRC use)
  151. * 3.42 Add PPDU_STATS_CFG + PPDU_STATS_IND
  152. * 3.43 Add HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR defs
  153. * 3.44 Add htt_tx_wbm_completion_v2
  154. * 3.45 Add host_tx_desc_pool flag in htt_tx_msdu_desc_ext2_t
  155. * 3.46 Add MAC ID and payload size fields to HTT_T2H_MSG_TYPE_PKTLOG header
  156. * 3.47 Add HTT_T2H PEER_MAP_V2 and PEER_UNMAP_V2
  157. * 3.48 Add pdev ID field to HTT_T2H_MSG_TYPE_PPDU_STATS_IND and
  158. * HTT_T2H_MSG_TYPE_PKTLOG
  159. * 3.49 Add HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND def
  160. * 3.50 Add learning_frame flag to htt_tx_msdu_desc_ext2_t
  161. * 3.51 Add SW peer ID and TID num to HTT TX WBM COMPLETION
  162. * 3.52 Add HTT_T2H FLOW_POOL_RESIZE msg def
  163. * 3.53 Update HTT_T2H FLOW_POOL_RESIZE msg def
  164. * 3.54 Define mcast and mcast_valid flags within htt_tx_wbm_transmit_status
  165. * 3.55 Add initiator / responder flags to RX_DELBA indication
  166. * 3.56 Fix HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE bit-mask defs
  167. * 3.57 Add support for in-band data within HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  168. * 3.58 Add optional MSDU ack RSSI array to end of HTT_T2H TX_COMPL_IND msg
  169. * 3.59 Add HTT_RXDMA_HOST_BUF_RING2 def
  170. * 3.60 Add HTT_T2H_MSG_TYPE_PEER_STATS_IND def
  171. * 3.61 Add rx offset fields to HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG msg
  172. * 3.62 Add antenna mask to reserved space in htt_rx_ppdu_desc_t
  173. * 3.63 Add HTT_HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND def
  174. * 3.64 Add struct htt_tx_compl_ind_append_tx_tsf64 and add tx_tsf64
  175. * array to the end of HTT_T2H TX_COMPL_IND msg
  176. * 3.65 Add fields in htt_tx_msdu_desc_ext2_t to allow the host to provide
  177. * a "cookie" to identify a MSDU, and to specify to not apply aggregation
  178. * for a MSDU.
  179. */
  180. #define HTT_CURRENT_VERSION_MAJOR 3
  181. #define HTT_CURRENT_VERSION_MINOR 65
  182. #define HTT_NUM_TX_FRAG_DESC 1024
  183. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  184. #define HTT_CHECK_SET_VAL(field, val) \
  185. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  186. /* macros to assist in sign-extending fields from HTT messages */
  187. #define HTT_SIGN_BIT_MASK(field) \
  188. ((field ## _M + (1 << field ## _S)) >> 1)
  189. #define HTT_SIGN_BIT(_val, field) \
  190. (_val & HTT_SIGN_BIT_MASK(field))
  191. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  192. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  193. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  194. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  195. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  196. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  197. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  198. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  199. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  200. /*
  201. * TEMPORARY:
  202. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  203. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  204. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  205. * updated.
  206. */
  207. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  208. /*
  209. * TEMPORARY:
  210. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  211. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  212. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  213. * updated.
  214. */
  215. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  216. /* HTT Access Category values */
  217. enum HTT_AC_WMM {
  218. /* WMM Access Categories */
  219. HTT_AC_WMM_BE = 0x0,
  220. HTT_AC_WMM_BK = 0x1,
  221. HTT_AC_WMM_VI = 0x2,
  222. HTT_AC_WMM_VO = 0x3,
  223. /* extension Access Categories */
  224. HTT_AC_EXT_NON_QOS = 0x4,
  225. HTT_AC_EXT_UCAST_MGMT = 0x5,
  226. HTT_AC_EXT_MCAST_DATA = 0x6,
  227. HTT_AC_EXT_MCAST_MGMT = 0x7,
  228. };
  229. enum HTT_AC_WMM_MASK {
  230. /* WMM Access Categories */
  231. HTT_AC_WMM_BE_MASK = (1 << HTT_AC_WMM_BE),
  232. HTT_AC_WMM_BK_MASK = (1 << HTT_AC_WMM_BK),
  233. HTT_AC_WMM_VI_MASK = (1 << HTT_AC_WMM_VI),
  234. HTT_AC_WMM_VO_MASK = (1 << HTT_AC_WMM_VO),
  235. /* extension Access Categories */
  236. HTT_AC_EXT_NON_QOS_MASK = (1 << HTT_AC_EXT_NON_QOS),
  237. HTT_AC_EXT_UCAST_MGMT_MASK = (1 << HTT_AC_EXT_UCAST_MGMT),
  238. HTT_AC_EXT_MCAST_DATA_MASK = (1 << HTT_AC_EXT_MCAST_DATA),
  239. HTT_AC_EXT_MCAST_MGMT_MASK = (1 << HTT_AC_EXT_MCAST_MGMT),
  240. };
  241. #define HTT_AC_MASK_WMM \
  242. (HTT_AC_WMM_BE_MASK | HTT_AC_WMM_BK_MASK | \
  243. HTT_AC_WMM_VI_MASK | HTT_AC_WMM_VO_MASK)
  244. #define HTT_AC_MASK_EXT \
  245. (HTT_AC_EXT_NON_QOS_MASK | HTT_AC_EXT_UCAST_MGMT_MASK | \
  246. HTT_AC_EXT_MCAST_DATA_MASK | HTT_AC_EXT_MCAST_MGMT_MASK)
  247. #define HTT_AC_MASK_ALL (HTT_AC_MASK_WMM | HTT_AC_MASK_EXT)
  248. /*
  249. * htt_dbg_stats_type -
  250. * bit positions for each stats type within a stats type bitmask
  251. * The bitmask contains 24 bits.
  252. */
  253. enum htt_dbg_stats_type {
  254. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  255. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  256. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  257. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  258. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  259. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  260. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  261. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  262. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  263. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  264. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  265. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  266. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  267. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  268. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  269. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  270. /* bits 16-23 currently reserved */
  271. /* keep this last */
  272. HTT_DBG_NUM_STATS
  273. };
  274. /*=== HTT option selection TLVs ===
  275. * Certain HTT messages have alternatives or options.
  276. * For such cases, the host and target need to agree on which option to use.
  277. * Option specification TLVs can be appended to the VERSION_REQ and
  278. * VERSION_CONF messages to select options other than the default.
  279. * These TLVs are entirely optional - if they are not provided, there is a
  280. * well-defined default for each option. If they are provided, they can be
  281. * provided in any order. Each TLV can be present or absent independent of
  282. * the presence / absence of other TLVs.
  283. *
  284. * The HTT option selection TLVs use the following format:
  285. * |31 16|15 8|7 0|
  286. * |---------------------------------+----------------+----------------|
  287. * | value (payload) | length | tag |
  288. * |-------------------------------------------------------------------|
  289. * The value portion need not be only 2 bytes; it can be extended by any
  290. * integer number of 4-byte units. The total length of the TLV, including
  291. * the tag and length fields, must be a multiple of 4 bytes. The length
  292. * field specifies the total TLV size in 4-byte units. Thus, the typical
  293. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  294. * field, would store 0x1 in its length field, to show that the TLV occupies
  295. * a single 4-byte unit.
  296. */
  297. /*--- TLV header format - applies to all HTT option TLVs ---*/
  298. enum HTT_OPTION_TLV_TAGS {
  299. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  300. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  301. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  302. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  303. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  304. };
  305. PREPACK struct htt_option_tlv_header_t {
  306. A_UINT8 tag;
  307. A_UINT8 length;
  308. } POSTPACK;
  309. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  310. #define HTT_OPTION_TLV_TAG_S 0
  311. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  312. #define HTT_OPTION_TLV_LENGTH_S 8
  313. /*
  314. * value0 - 16 bit value field stored in word0
  315. * The TLV's value field may be longer than 2 bytes, in which case
  316. * the remainder of the value is stored in word1, word2, etc.
  317. */
  318. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  319. #define HTT_OPTION_TLV_VALUE0_S 16
  320. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  321. do { \
  322. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  323. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  324. } while (0)
  325. #define HTT_OPTION_TLV_TAG_GET(word) \
  326. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  327. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  328. do { \
  329. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  330. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  331. } while (0)
  332. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  333. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  334. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  335. do { \
  336. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  337. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  338. } while (0)
  339. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  340. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  341. /*--- format of specific HTT option TLVs ---*/
  342. /*
  343. * HTT option TLV for specifying LL bus address size
  344. * Some chips require bus addresses used by the target to access buffers
  345. * within the host's memory to be 32 bits; others require bus addresses
  346. * used by the target to access buffers within the host's memory to be
  347. * 64 bits.
  348. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  349. * a suffix to the VERSION_CONF message to specify which bus address format
  350. * the target requires.
  351. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  352. * default to providing bus addresses to the target in 32-bit format.
  353. */
  354. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  355. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  356. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  357. };
  358. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  359. struct htt_option_tlv_header_t hdr;
  360. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  361. } POSTPACK;
  362. /*
  363. * HTT option TLV for specifying whether HL systems should indicate
  364. * over-the-air tx completion for individual frames, or should instead
  365. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  366. * requests an OTA tx completion for a particular tx frame.
  367. * This option does not apply to LL systems, where the TX_COMPL_IND
  368. * is mandatory.
  369. * This option is primarily intended for HL systems in which the tx frame
  370. * downloads over the host --> target bus are as slow as or slower than
  371. * the transmissions over the WLAN PHY. For cases where the bus is faster
  372. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  373. * and consquently will send one TX_COMPL_IND message that covers several
  374. * tx frames. For cases where the WLAN PHY is faster than the bus,
  375. * the target will end up transmitting very short A-MPDUs, and consequently
  376. * sending many TX_COMPL_IND messages, which each cover a very small number
  377. * of tx frames.
  378. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  379. * a suffix to the VERSION_REQ message to request whether the host desires to
  380. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  381. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  382. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  383. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  384. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  385. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  386. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  387. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  388. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  389. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  390. * TLV.
  391. */
  392. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  393. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  394. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  395. };
  396. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  397. struct htt_option_tlv_header_t hdr;
  398. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  399. } POSTPACK;
  400. /*
  401. * HTT option TLV for specifying how many tx queue groups the target
  402. * may establish.
  403. * This TLV specifies the maximum value the target may send in the
  404. * txq_group_id field of any TXQ_GROUP information elements sent by
  405. * the target to the host. This allows the host to pre-allocate an
  406. * appropriate number of tx queue group structs.
  407. *
  408. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  409. * a suffix to the VERSION_REQ message to specify whether the host supports
  410. * tx queue groups at all, and if so if there is any limit on the number of
  411. * tx queue groups that the host supports.
  412. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  413. * a suffix to the VERSION_CONF message. If the host has specified in the
  414. * VER_REQ message a limit on the number of tx queue groups the host can
  415. * supprt, the target shall limit its specification of the maximum tx groups
  416. * to be no larger than this host-specified limit.
  417. *
  418. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  419. * shall preallocate 4 tx queue group structs, and the target shall not
  420. * specify a txq_group_id larger than 3.
  421. */
  422. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  423. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  424. /*
  425. * values 1 through N specify the max number of tx queue groups
  426. * the sender supports
  427. */
  428. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  429. };
  430. /* TEMPORARY backwards-compatibility alias for a typo fix -
  431. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  432. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  433. * to support the old name (with the typo) until all references to the
  434. * old name are replaced with the new name.
  435. */
  436. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  437. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  438. struct htt_option_tlv_header_t hdr;
  439. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  440. } POSTPACK;
  441. /*
  442. * HTT option TLV for specifying whether the target supports an extended
  443. * version of the HTT tx descriptor. If the target provides this TLV
  444. * and specifies in the TLV that the target supports an extended version
  445. * of the HTT tx descriptor, the target must check the "extension" bit in
  446. * the HTT tx descriptor, and if the extension bit is set, to expect a
  447. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  448. * descriptor. Furthermore, the target must provide room for the HTT
  449. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  450. * This option is intended for systems where the host needs to explicitly
  451. * control the transmission parameters such as tx power for individual
  452. * tx frames.
  453. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  454. * as a suffix to the VERSION_CONF message to explicitly specify whether
  455. * the target supports the HTT tx MSDU extension descriptor.
  456. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  457. * by the host as lack of target support for the HTT tx MSDU extension
  458. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  459. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  460. * the HTT tx MSDU extension descriptor.
  461. * The host is not required to provide the HTT tx MSDU extension descriptor
  462. * just because the target supports it; the target must check the
  463. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  464. * extension descriptor is present.
  465. */
  466. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  467. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  468. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  469. };
  470. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  471. struct htt_option_tlv_header_t hdr;
  472. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  473. } POSTPACK;
  474. /*=== host -> target messages ===============================================*/
  475. enum htt_h2t_msg_type {
  476. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  477. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  478. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  479. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  480. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  481. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  482. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  483. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  484. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  485. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  486. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  487. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  488. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  489. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  490. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  491. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  492. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  493. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  494. /* keep this last */
  495. HTT_H2T_NUM_MSGS
  496. };
  497. /*
  498. * HTT host to target message type -
  499. * stored in bits 7:0 of the first word of the message
  500. */
  501. #define HTT_H2T_MSG_TYPE_M 0xff
  502. #define HTT_H2T_MSG_TYPE_S 0
  503. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  504. do { \
  505. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  506. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  507. } while (0)
  508. #define HTT_H2T_MSG_TYPE_GET(word) \
  509. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  510. /**
  511. * @brief host -> target version number request message definition
  512. *
  513. * |31 24|23 16|15 8|7 0|
  514. * |----------------+----------------+----------------+----------------|
  515. * | reserved | msg type |
  516. * |-------------------------------------------------------------------|
  517. * : option request TLV (optional) |
  518. * :...................................................................:
  519. *
  520. * The VER_REQ message may consist of a single 4-byte word, or may be
  521. * extended with TLVs that specify which HTT options the host is requesting
  522. * from the target.
  523. * The following option TLVs may be appended to the VER_REQ message:
  524. * - HL_SUPPRESS_TX_COMPL_IND
  525. * - HL_MAX_TX_QUEUE_GROUPS
  526. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  527. * may be appended to the VER_REQ message (but only one TLV of each type).
  528. *
  529. * Header fields:
  530. * - MSG_TYPE
  531. * Bits 7:0
  532. * Purpose: identifies this as a version number request message
  533. * Value: 0x0
  534. */
  535. #define HTT_VER_REQ_BYTES 4
  536. /* TBDXXX: figure out a reasonable number */
  537. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  538. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  539. /**
  540. * @brief HTT tx MSDU descriptor
  541. *
  542. * @details
  543. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  544. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  545. * the target firmware needs for the FW's tx processing, particularly
  546. * for creating the HW msdu descriptor.
  547. * The same HTT tx descriptor is used for HL and LL systems, though
  548. * a few fields within the tx descriptor are used only by LL or
  549. * only by HL.
  550. * The HTT tx descriptor is defined in two manners: by a struct with
  551. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  552. * definitions.
  553. * The target should use the struct def, for simplicitly and clarity,
  554. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  555. * neutral. Specifically, the host shall use the get/set macros built
  556. * around the mask + shift defs.
  557. */
  558. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  559. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  560. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  561. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  562. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  563. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  564. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  565. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  566. #define HTT_TX_VDEV_ID_WORD 0
  567. #define HTT_TX_VDEV_ID_MASK 0x3f
  568. #define HTT_TX_VDEV_ID_SHIFT 16
  569. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  570. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  571. #define HTT_TX_MSDU_LEN_DWORD 1
  572. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  573. /*
  574. * HTT_VAR_PADDR macros
  575. * Allow physical / bus addresses to be either a single 32-bit value,
  576. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  577. */
  578. #define HTT_VAR_PADDR32(var_name) \
  579. A_UINT32 var_name
  580. #define HTT_VAR_PADDR64_LE(var_name) \
  581. struct { \
  582. /* little-endian: lo precedes hi */ \
  583. A_UINT32 lo; \
  584. A_UINT32 hi; \
  585. } var_name
  586. /*
  587. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  588. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  589. * addresses are stored in a XXX-bit field.
  590. * This macro is used to define both htt_tx_msdu_desc32_t and
  591. * htt_tx_msdu_desc64_t structs.
  592. */
  593. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  594. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  595. { \
  596. /* DWORD 0: flags and meta-data */ \
  597. A_UINT32 \
  598. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  599. \
  600. /* pkt_subtype - \
  601. * Detailed specification of the tx frame contents, extending the \
  602. * general specification provided by pkt_type. \
  603. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  604. * pkt_type | pkt_subtype \
  605. * ============================================================== \
  606. * 802.3 | bit 0:3 - Reserved \
  607. * | bit 4: 0x0 - Copy-Engine Classification Results \
  608. * | not appended to the HTT message \
  609. * | 0x1 - Copy-Engine Classification Results \
  610. * | appended to the HTT message in the \
  611. * | format: \
  612. * | [HTT tx desc, frame header, \
  613. * | CE classification results] \
  614. * | The CE classification results begin \
  615. * | at the next 4-byte boundary after \
  616. * | the frame header. \
  617. * ------------+------------------------------------------------- \
  618. * Eth2 | bit 0:3 - Reserved \
  619. * | bit 4: 0x0 - Copy-Engine Classification Results \
  620. * | not appended to the HTT message \
  621. * | 0x1 - Copy-Engine Classification Results \
  622. * | appended to the HTT message. \
  623. * | See the above specification of the \
  624. * | CE classification results location. \
  625. * ------------+------------------------------------------------- \
  626. * native WiFi | bit 0:3 - Reserved \
  627. * | bit 4: 0x0 - Copy-Engine Classification Results \
  628. * | not appended to the HTT message \
  629. * | 0x1 - Copy-Engine Classification Results \
  630. * | appended to the HTT message. \
  631. * | See the above specification of the \
  632. * | CE classification results location. \
  633. * ------------+------------------------------------------------- \
  634. * mgmt | 0x0 - 802.11 MAC header absent \
  635. * | 0x1 - 802.11 MAC header present \
  636. * ------------+------------------------------------------------- \
  637. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  638. * | 0x1 - 802.11 MAC header present \
  639. * | bit 1: 0x0 - allow aggregation \
  640. * | 0x1 - don't allow aggregation \
  641. * | bit 2: 0x0 - perform encryption \
  642. * | 0x1 - don't perform encryption \
  643. * | bit 3: 0x0 - perform tx classification / queuing \
  644. * | 0x1 - don't perform tx classification; \
  645. * | insert the frame into the "misc" \
  646. * | tx queue \
  647. * | bit 4: 0x0 - Copy-Engine Classification Results \
  648. * | not appended to the HTT message \
  649. * | 0x1 - Copy-Engine Classification Results \
  650. * | appended to the HTT message. \
  651. * | See the above specification of the \
  652. * | CE classification results location. \
  653. */ \
  654. pkt_subtype: 5, \
  655. \
  656. /* pkt_type - \
  657. * General specification of the tx frame contents. \
  658. * The htt_pkt_type enum should be used to specify and check the \
  659. * value of this field. \
  660. */ \
  661. pkt_type: 3, \
  662. \
  663. /* vdev_id - \
  664. * ID for the vdev that is sending this tx frame. \
  665. * For certain non-standard packet types, e.g. pkt_type == raw \
  666. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  667. * This field is used primarily for determining where to queue \
  668. * broadcast and multicast frames. \
  669. */ \
  670. vdev_id: 6, \
  671. /* ext_tid - \
  672. * The extended traffic ID. \
  673. * If the TID is unknown, the extended TID is set to \
  674. * HTT_TX_EXT_TID_INVALID. \
  675. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  676. * value of the QoS TID. \
  677. * If the tx frame is non-QoS data, then the extended TID is set to \
  678. * HTT_TX_EXT_TID_NON_QOS. \
  679. * If the tx frame is multicast or broadcast, then the extended TID \
  680. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  681. */ \
  682. ext_tid: 5, \
  683. \
  684. /* postponed - \
  685. * This flag indicates whether the tx frame has been downloaded to \
  686. * the target before but discarded by the target, and now is being \
  687. * downloaded again; or if this is a new frame that is being \
  688. * downloaded for the first time. \
  689. * This flag allows the target to determine the correct order for \
  690. * transmitting new vs. old frames. \
  691. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  692. * This flag only applies to HL systems, since in LL systems, \
  693. * the tx flow control is handled entirely within the target. \
  694. */ \
  695. postponed: 1, \
  696. \
  697. /* extension - \
  698. * This flag indicates whether a HTT tx MSDU extension descriptor \
  699. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  700. * \
  701. * 0x0 - no extension MSDU descriptor is present \
  702. * 0x1 - an extension MSDU descriptor immediately follows the \
  703. * regular MSDU descriptor \
  704. */ \
  705. extension: 1, \
  706. \
  707. /* cksum_offload - \
  708. * This flag indicates whether checksum offload is enabled or not \
  709. * for this frame. Target FW use this flag to turn on HW checksumming \
  710. * 0x0 - No checksum offload \
  711. * 0x1 - L3 header checksum only \
  712. * 0x2 - L4 checksum only \
  713. * 0x3 - L3 header checksum + L4 checksum \
  714. */ \
  715. cksum_offload: 2, \
  716. \
  717. /* tx_comp_req - \
  718. * This flag indicates whether Tx Completion \
  719. * from fw is required or not. \
  720. * This flag is only relevant if tx completion is not \
  721. * universally enabled. \
  722. * For all LL systems, tx completion is mandatory, \
  723. * so this flag will be irrelevant. \
  724. * For HL systems tx completion is optional, but HL systems in which \
  725. * the bus throughput exceeds the WLAN throughput will \
  726. * probably want to always use tx completion, and thus \
  727. * would not check this flag. \
  728. * This flag is required when tx completions are not used universally, \
  729. * but are still required for certain tx frames for which \
  730. * an OTA delivery acknowledgment is needed by the host. \
  731. * In practice, this would be for HL systems in which the \
  732. * bus throughput is less than the WLAN throughput. \
  733. * \
  734. * 0x0 - Tx Completion Indication from Fw not required \
  735. * 0x1 - Tx Completion Indication from Fw is required \
  736. */ \
  737. tx_compl_req: 1; \
  738. \
  739. \
  740. /* DWORD 1: MSDU length and ID */ \
  741. A_UINT32 \
  742. len: 16, /* MSDU length, in bytes */ \
  743. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  744. * and this id is used to calculate fragmentation \
  745. * descriptor pointer inside the target based on \
  746. * the base address, configured inside the target. \
  747. */ \
  748. \
  749. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  750. /* frags_desc_ptr - \
  751. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  752. * where the tx frame's fragments reside in memory. \
  753. * This field only applies to LL systems, since in HL systems the \
  754. * (degenerate single-fragment) fragmentation descriptor is created \
  755. * within the target. \
  756. */ \
  757. _paddr__frags_desc_ptr_; \
  758. \
  759. /* DWORD 3 (or 4): peerid, chanfreq */ \
  760. /* \
  761. * Peer ID : Target can use this value to know which peer-id packet \
  762. * destined to. \
  763. * It's intended to be specified by host in case of NAWDS. \
  764. */ \
  765. A_UINT16 peerid; \
  766. \
  767. /* \
  768. * Channel frequency: This identifies the desired channel \
  769. * frequency (in mhz) for tx frames. This is used by FW to help \
  770. * determine when it is safe to transmit or drop frames for \
  771. * off-channel operation. \
  772. * The default value of zero indicates to FW that the corresponding \
  773. * VDEV's home channel (if there is one) is the desired channel \
  774. * frequency. \
  775. */ \
  776. A_UINT16 chanfreq; \
  777. \
  778. /* Reason reserved is commented is increasing the htt structure size \
  779. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  780. * A_UINT32 reserved_dword3_bits0_31; \
  781. */ \
  782. } POSTPACK
  783. /* define a htt_tx_msdu_desc32_t type */
  784. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  785. /* define a htt_tx_msdu_desc64_t type */
  786. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  787. /*
  788. * Make htt_tx_msdu_desc_t be an alias for either
  789. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  790. */
  791. #if HTT_PADDR64
  792. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  793. #else
  794. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  795. #endif
  796. /* decriptor information for Management frame*/
  797. /*
  798. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  799. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  800. */
  801. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  802. extern A_UINT32 mgmt_hdr_len;
  803. PREPACK struct htt_mgmt_tx_desc_t {
  804. A_UINT32 msg_type;
  805. #if HTT_PADDR64
  806. A_UINT64 frag_paddr; /* DMAble address of the data */
  807. #else
  808. A_UINT32 frag_paddr; /* DMAble address of the data */
  809. #endif
  810. A_UINT32 desc_id; /* returned to host during completion
  811. * to free the meory*/
  812. A_UINT32 len; /* Fragment length */
  813. A_UINT32 vdev_id; /* virtual device ID*/
  814. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  815. } POSTPACK;
  816. PREPACK struct htt_mgmt_tx_compl_ind {
  817. A_UINT32 desc_id;
  818. A_UINT32 status;
  819. } POSTPACK;
  820. /*
  821. * This SDU header size comes from the summation of the following:
  822. * 1. Max of:
  823. * a. Native WiFi header, for native WiFi frames: 24 bytes
  824. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  825. * b. 802.11 header, for raw frames: 36 bytes
  826. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  827. * QoS header, HT header)
  828. * c. 802.3 header, for ethernet frames: 14 bytes
  829. * (destination address, source address, ethertype / length)
  830. * 2. Max of:
  831. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  832. * b. IPv6 header, up through the Traffic Class: 2 bytes
  833. * 3. 802.1Q VLAN header: 4 bytes
  834. * 4. LLC/SNAP header: 8 bytes
  835. */
  836. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  837. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  838. #define HTT_TX_HDR_SIZE_ETHERNET 14
  839. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  840. A_COMPILE_TIME_ASSERT(
  841. htt_encap_hdr_size_max_check_nwifi,
  842. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  843. A_COMPILE_TIME_ASSERT(
  844. htt_encap_hdr_size_max_check_enet,
  845. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  846. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  847. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  848. #define HTT_TX_HDR_SIZE_802_1Q 4
  849. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  850. #define HTT_COMMON_TX_FRM_HDR_LEN \
  851. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  852. HTT_TX_HDR_SIZE_802_1Q + \
  853. HTT_TX_HDR_SIZE_LLC_SNAP)
  854. #define HTT_HL_TX_FRM_HDR_LEN \
  855. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  856. #define HTT_LL_TX_FRM_HDR_LEN \
  857. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  858. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  859. /* dword 0 */
  860. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  861. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  862. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  863. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  864. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  865. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  866. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  867. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  868. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  869. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  870. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  871. #define HTT_TX_DESC_PKT_TYPE_S 13
  872. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  873. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  874. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  875. #define HTT_TX_DESC_VDEV_ID_S 16
  876. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  877. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  878. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  879. #define HTT_TX_DESC_EXT_TID_S 22
  880. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  881. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  882. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  883. #define HTT_TX_DESC_POSTPONED_S 27
  884. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  885. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  886. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  887. #define HTT_TX_DESC_EXTENSION_S 28
  888. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  889. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  890. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  891. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  892. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  893. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  894. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  895. #define HTT_TX_DESC_TX_COMP_S 31
  896. /* dword 1 */
  897. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  898. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  899. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  900. #define HTT_TX_DESC_FRM_LEN_S 0
  901. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  902. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  903. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  904. #define HTT_TX_DESC_FRM_ID_S 16
  905. /* dword 2 */
  906. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  907. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  908. /* for systems using 64-bit format for bus addresses */
  909. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  910. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  911. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  912. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  913. /* for systems using 32-bit format for bus addresses */
  914. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  915. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  916. /* dword 3 */
  917. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  918. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  919. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  920. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  921. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  922. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  923. #if HTT_PADDR64
  924. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  925. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  926. #else
  927. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  928. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  929. #endif
  930. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  931. #define HTT_TX_DESC_PEER_ID_S 0
  932. /*
  933. * TEMPORARY:
  934. * The original definitions for the PEER_ID fields contained typos
  935. * (with _DESC_PADDR appended to this PEER_ID field name).
  936. * Retain deprecated original names for PEER_ID fields until all code that
  937. * refers to them has been updated.
  938. */
  939. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  940. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  941. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  942. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  943. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  944. HTT_TX_DESC_PEER_ID_M
  945. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  946. HTT_TX_DESC_PEER_ID_S
  947. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  948. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  949. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  950. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  951. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  952. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  953. #if HTT_PADDR64
  954. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  955. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  956. #else
  957. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  958. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  959. #endif
  960. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  961. #define HTT_TX_DESC_CHAN_FREQ_S 16
  962. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  963. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  964. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  965. do { \
  966. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  967. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  968. } while (0)
  969. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  970. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  971. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  972. do { \
  973. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  974. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  975. } while (0)
  976. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  977. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  978. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  979. do { \
  980. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  981. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  982. } while (0)
  983. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  984. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  985. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  986. do { \
  987. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  988. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  989. } while (0)
  990. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  991. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  992. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  993. do { \
  994. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  995. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  996. } while (0)
  997. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  998. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  999. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1000. do { \
  1001. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1002. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1003. } while (0)
  1004. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1005. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1006. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1007. do { \
  1008. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1009. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1010. } while (0)
  1011. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1012. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1013. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1014. do { \
  1015. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1016. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1017. } while (0)
  1018. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1019. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1020. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1021. do { \
  1022. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1023. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1024. } while (0)
  1025. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1026. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1027. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1028. do { \
  1029. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1030. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1031. } while (0)
  1032. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1033. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1034. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1035. do { \
  1036. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1037. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1038. } while (0)
  1039. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1040. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1041. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1042. do { \
  1043. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1044. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1045. } while (0)
  1046. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1047. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1048. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1049. do { \
  1050. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1051. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1052. } while (0)
  1053. /* enums used in the HTT tx MSDU extension descriptor */
  1054. enum {
  1055. htt_tx_guard_interval_regular = 0,
  1056. htt_tx_guard_interval_short = 1,
  1057. };
  1058. enum {
  1059. htt_tx_preamble_type_ofdm = 0,
  1060. htt_tx_preamble_type_cck = 1,
  1061. htt_tx_preamble_type_ht = 2,
  1062. htt_tx_preamble_type_vht = 3,
  1063. };
  1064. enum {
  1065. htt_tx_bandwidth_5MHz = 0,
  1066. htt_tx_bandwidth_10MHz = 1,
  1067. htt_tx_bandwidth_20MHz = 2,
  1068. htt_tx_bandwidth_40MHz = 3,
  1069. htt_tx_bandwidth_80MHz = 4,
  1070. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1071. };
  1072. /**
  1073. * @brief HTT tx MSDU extension descriptor
  1074. * @details
  1075. * If the target supports HTT tx MSDU extension descriptors, the host has
  1076. * the option of appending the following struct following the regular
  1077. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1078. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1079. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1080. * tx specs for each frame.
  1081. */
  1082. PREPACK struct htt_tx_msdu_desc_ext_t {
  1083. /* DWORD 0: flags */
  1084. A_UINT32
  1085. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1086. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1087. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1088. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1089. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1090. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1091. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1092. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1093. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1094. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1095. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1096. /* DWORD 1: tx power, tx rate, tx BW */
  1097. A_UINT32
  1098. /* pwr -
  1099. * Specify what power the tx frame needs to be transmitted at.
  1100. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1101. * The value needs to be appropriately sign-extended when extracting
  1102. * the value from the message and storing it in a variable that is
  1103. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1104. * automatically handles this sign-extension.)
  1105. * If the transmission uses multiple tx chains, this power spec is
  1106. * the total transmit power, assuming incoherent combination of
  1107. * per-chain power to produce the total power.
  1108. */
  1109. pwr: 8,
  1110. /* mcs_mask -
  1111. * Specify the allowable values for MCS index (modulation and coding)
  1112. * to use for transmitting the frame.
  1113. *
  1114. * For HT / VHT preamble types, this mask directly corresponds to
  1115. * the HT or VHT MCS indices that are allowed. For each bit N set
  1116. * within the mask, MCS index N is allowed for transmitting the frame.
  1117. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1118. * rates versus OFDM rates, so the host has the option of specifying
  1119. * that the target must transmit the frame with CCK or OFDM rates
  1120. * (not HT or VHT), but leaving the decision to the target whether
  1121. * to use CCK or OFDM.
  1122. *
  1123. * For CCK and OFDM, the bits within this mask are interpreted as
  1124. * follows:
  1125. * bit 0 -> CCK 1 Mbps rate is allowed
  1126. * bit 1 -> CCK 2 Mbps rate is allowed
  1127. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1128. * bit 3 -> CCK 11 Mbps rate is allowed
  1129. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1130. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1131. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1132. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1133. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1134. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1135. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1136. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1137. *
  1138. * The MCS index specification needs to be compatible with the
  1139. * bandwidth mask specification. For example, a MCS index == 9
  1140. * specification is inconsistent with a preamble type == VHT,
  1141. * Nss == 1, and channel bandwidth == 20 MHz.
  1142. *
  1143. * Furthermore, the host has only a limited ability to specify to
  1144. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1145. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1146. */
  1147. mcs_mask: 12,
  1148. /* nss_mask -
  1149. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1150. * Each bit in this mask corresponds to a Nss value:
  1151. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1152. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1153. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1154. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1155. * The values in the Nss mask must be suitable for the recipient, e.g.
  1156. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1157. * recipient which only supports 2x2 MIMO.
  1158. */
  1159. nss_mask: 4,
  1160. /* guard_interval -
  1161. * Specify a htt_tx_guard_interval enum value to indicate whether
  1162. * the transmission should use a regular guard interval or a
  1163. * short guard interval.
  1164. */
  1165. guard_interval: 1,
  1166. /* preamble_type_mask -
  1167. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1168. * may choose from for transmitting this frame.
  1169. * The bits in this mask correspond to the values in the
  1170. * htt_tx_preamble_type enum. For example, to allow the target
  1171. * to transmit the frame as either CCK or OFDM, this field would
  1172. * be set to
  1173. * (1 << htt_tx_preamble_type_ofdm) |
  1174. * (1 << htt_tx_preamble_type_cck)
  1175. */
  1176. preamble_type_mask: 4,
  1177. reserved1_31_29: 3; /* unused, set to 0x0 */
  1178. /* DWORD 2: tx chain mask, tx retries */
  1179. A_UINT32
  1180. /* chain_mask - specify which chains to transmit from */
  1181. chain_mask: 4,
  1182. /* retry_limit -
  1183. * Specify the maximum number of transmissions, including the
  1184. * initial transmission, to attempt before giving up if no ack
  1185. * is received.
  1186. * If the tx rate is specified, then all retries shall use the
  1187. * same rate as the initial transmission.
  1188. * If no tx rate is specified, the target can choose whether to
  1189. * retain the original rate during the retransmissions, or to
  1190. * fall back to a more robust rate.
  1191. */
  1192. retry_limit: 4,
  1193. /* bandwidth_mask -
  1194. * Specify what channel widths may be used for the transmission.
  1195. * A value of zero indicates "don't care" - the target may choose
  1196. * the transmission bandwidth.
  1197. * The bits within this mask correspond to the htt_tx_bandwidth
  1198. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1199. * The bandwidth_mask must be consistent with the preamble_type_mask
  1200. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1201. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1202. */
  1203. bandwidth_mask: 6,
  1204. reserved2_31_14: 18; /* unused, set to 0x0 */
  1205. /* DWORD 3: tx expiry time (TSF) LSBs */
  1206. A_UINT32 expire_tsf_lo;
  1207. /* DWORD 4: tx expiry time (TSF) MSBs */
  1208. A_UINT32 expire_tsf_hi;
  1209. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1210. } POSTPACK;
  1211. /* DWORD 0 */
  1212. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1213. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1214. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1215. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1216. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1217. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1218. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1219. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1220. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1221. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1222. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1223. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1224. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1225. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1226. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1227. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1228. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1229. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1230. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1231. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1232. /* DWORD 1 */
  1233. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1234. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1235. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1236. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1237. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1238. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1239. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1240. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1241. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1242. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1243. /* DWORD 2 */
  1244. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1245. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1246. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1247. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1248. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1249. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1250. /* DWORD 0 */
  1251. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1252. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1253. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1254. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1255. do { \
  1256. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1257. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1258. } while (0)
  1259. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1260. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1261. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1262. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1263. do { \
  1264. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1265. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1266. } while (0)
  1267. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1268. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1269. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1270. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1271. do { \
  1272. HTT_CHECK_SET_VAL( \
  1273. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1274. ((_var) |= ((_val) \
  1275. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1276. } while (0)
  1277. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1278. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1279. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1280. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1281. do { \
  1282. HTT_CHECK_SET_VAL( \
  1283. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1284. ((_var) |= ((_val) \
  1285. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1286. } while (0)
  1287. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1288. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1289. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1290. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1291. do { \
  1292. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1293. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1294. } while (0)
  1295. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1296. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1297. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1298. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1299. do { \
  1300. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1301. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1302. } while (0)
  1303. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1304. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1305. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1306. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1307. do { \
  1308. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1309. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1310. } while (0)
  1311. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1312. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1313. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1314. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1315. do { \
  1316. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1317. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1318. } while (0)
  1319. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1320. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1321. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1322. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1323. do { \
  1324. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1325. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1326. } while (0)
  1327. /* DWORD 1 */
  1328. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1329. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1330. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1331. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1332. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1333. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1334. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1335. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1336. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1337. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1338. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1339. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1340. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1341. do { \
  1342. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1343. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1344. } while (0)
  1345. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1346. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1347. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1348. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1349. do { \
  1350. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1351. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1352. } while (0)
  1353. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1354. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1355. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1356. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1357. do { \
  1358. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1359. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1360. } while (0)
  1361. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1362. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1363. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1364. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1365. do { \
  1366. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1367. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1368. } while (0)
  1369. /* DWORD 2 */
  1370. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1371. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1372. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1373. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1374. do { \
  1375. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1376. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1377. } while (0)
  1378. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1379. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1380. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1381. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1382. do { \
  1383. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1384. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1385. } while (0)
  1386. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1387. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1388. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1389. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1390. do { \
  1391. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1392. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1393. } while (0)
  1394. typedef enum {
  1395. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1396. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1397. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1398. } htt_11ax_ltf_subtype_t;
  1399. typedef enum {
  1400. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1401. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1402. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1403. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1404. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1405. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1406. } htt_tx_ext2_preamble_type_t;
  1407. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1408. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1409. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1410. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1411. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1412. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1413. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1414. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1415. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1416. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1417. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1418. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1419. /**
  1420. * @brief HTT tx MSDU extension descriptor v2
  1421. * @details
  1422. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1423. * is received as tcl_exit_base->host_meta_info in firmware.
  1424. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1425. * are already part of tcl_exit_base.
  1426. */
  1427. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1428. /* DWORD 0: flags */
  1429. A_UINT32
  1430. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1431. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1432. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1433. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1434. valid_retries : 1, /* if set, tx retries spec is valid */
  1435. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1436. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1437. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1438. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1439. valid_key_flags : 1, /* if set, key flags is valid */
  1440. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1441. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1442. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1443. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1444. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1445. 1 = ENCRYPT,
  1446. 2 ~ 3 - Reserved */
  1447. /* retry_limit -
  1448. * Specify the maximum number of transmissions, including the
  1449. * initial transmission, to attempt before giving up if no ack
  1450. * is received.
  1451. * If the tx rate is specified, then all retries shall use the
  1452. * same rate as the initial transmission.
  1453. * If no tx rate is specified, the target can choose whether to
  1454. * retain the original rate during the retransmissions, or to
  1455. * fall back to a more robust rate.
  1456. */
  1457. retry_limit : 4,
  1458. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1459. * Valid only for 11ax preamble types HE_SU
  1460. * and HE_EXT_SU
  1461. */
  1462. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1463. * Valid only for 11ax preamble types HE_SU
  1464. * and HE_EXT_SU
  1465. */
  1466. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1467. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1468. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1469. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1470. */
  1471. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1472. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1473. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1474. * Use cases:
  1475. * Any time firmware uses TQM-BYPASS for Data
  1476. * TID, firmware expect host to set this bit.
  1477. */
  1478. /* DWORD 1: tx power, tx rate */
  1479. A_UINT32
  1480. power : 8, /* unit of the power field is 0.5 dbm
  1481. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1482. * signed value ranging from -64dbm to 63.5 dbm
  1483. */
  1484. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1485. * Setting more than one MCS isn't currently
  1486. * supported by the target (but is supported
  1487. * in the interface in case in the future
  1488. * the target supports specifications of
  1489. * a limited set of MCS values.
  1490. */
  1491. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1492. * Setting more than one Nss isn't currently
  1493. * supported by the target (but is supported
  1494. * in the interface in case in the future
  1495. * the target supports specifications of
  1496. * a limited set of Nss values.
  1497. */
  1498. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1499. update_peer_cache : 1; /* When set these custom values will be
  1500. * used for all packets, until the next
  1501. * update via this ext header.
  1502. * This is to make sure not all packets
  1503. * need to include this header.
  1504. */
  1505. /* DWORD 2: tx chain mask, tx retries */
  1506. A_UINT32
  1507. /* chain_mask - specify which chains to transmit from */
  1508. chain_mask : 8,
  1509. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1510. * TODO: Update Enum values for key_flags
  1511. */
  1512. /*
  1513. * Channel frequency: This identifies the desired channel
  1514. * frequency (in MHz) for tx frames. This is used by FW to help
  1515. * determine when it is safe to transmit or drop frames for
  1516. * off-channel operation.
  1517. * The default value of zero indicates to FW that the corresponding
  1518. * VDEV's home channel (if there is one) is the desired channel
  1519. * frequency.
  1520. */
  1521. chanfreq : 16;
  1522. /* DWORD 3: tx expiry time (TSF) LSBs */
  1523. A_UINT32 expire_tsf_lo;
  1524. /* DWORD 4: tx expiry time (TSF) MSBs */
  1525. A_UINT32 expire_tsf_hi;
  1526. /* DWORD 5: flags to control routing / processing of the MSDU */
  1527. A_UINT32
  1528. /* learning_frame
  1529. * When this flag is set, this frame will be dropped by FW
  1530. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1531. */
  1532. learning_frame : 1,
  1533. /* send_as_standalone
  1534. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1535. * i.e. with no A-MSDU or A-MPDU aggregation.
  1536. * The scope is extended to other use-cases.
  1537. */
  1538. send_as_standalone : 1,
  1539. /* is_host_opaque_valid
  1540. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1541. * with valid information.
  1542. */
  1543. is_host_opaque_valid : 1,
  1544. rsvd0 : 29;
  1545. /* DWORD 6 : Host opaque cookie for special frames */
  1546. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1547. rsvd1 : 16;
  1548. /*
  1549. * This structure can be expanded further up to 40 bytes
  1550. * by adding further DWORDs as needed.
  1551. */
  1552. } POSTPACK;
  1553. /* DWORD 0 */
  1554. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1555. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1556. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1557. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1558. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1559. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1560. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1561. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1562. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1563. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1564. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1565. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1566. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1567. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1568. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1569. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1570. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1571. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1572. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1573. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1574. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1575. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1576. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1577. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1578. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1579. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1580. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1581. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1582. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1583. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1584. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1585. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1586. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1587. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1588. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1589. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1590. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1591. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1592. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1593. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1594. /* DWORD 1 */
  1595. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1596. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1597. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1598. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1599. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1600. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1601. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1602. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1603. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1604. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1605. /* DWORD 2 */
  1606. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1607. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1608. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1609. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1610. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1611. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1612. /* DWORD 5 */
  1613. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1614. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1615. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1616. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1617. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1618. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1619. /* DWORD 6 */
  1620. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1621. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1622. /* DWORD 0 */
  1623. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1624. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1625. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1626. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1627. do { \
  1628. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1629. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1630. } while (0)
  1631. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1632. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1633. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1634. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1635. do { \
  1636. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1637. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1638. } while (0)
  1639. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1640. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1641. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1642. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1643. do { \
  1644. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1645. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1646. } while (0)
  1647. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1648. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1649. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1650. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1651. do { \
  1652. HTT_CHECK_SET_VAL( \
  1653. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1654. ((_var) |= ((_val) \
  1655. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1656. } while (0)
  1657. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1658. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1659. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1660. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1661. do { \
  1662. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1663. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1664. } while (0)
  1665. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1666. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1667. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1668. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1669. do { \
  1670. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1671. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1672. } while (0)
  1673. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1674. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1675. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1676. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1677. do { \
  1678. HTT_CHECK_SET_VAL( \
  1679. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1680. ((_var) |= ((_val) \
  1681. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1682. } while (0)
  1683. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1684. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1685. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1686. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1687. do { \
  1688. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1689. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1690. } while (0)
  1691. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1692. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1693. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1694. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1695. do { \
  1696. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1697. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1698. } while (0)
  1699. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1700. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1701. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1702. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1703. do { \
  1704. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1705. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1706. } while (0)
  1707. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1708. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1709. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1710. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1711. do { \
  1712. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1713. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1714. } while (0)
  1715. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1716. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1717. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1718. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1719. do { \
  1720. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1721. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1722. } while (0)
  1723. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1724. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1725. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1726. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1727. do { \
  1728. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1729. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1730. } while (0)
  1731. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1732. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1733. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1734. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1735. do { \
  1736. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1737. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1738. } while (0)
  1739. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1740. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1741. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1742. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1743. do { \
  1744. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1745. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1746. } while (0)
  1747. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1748. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1749. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1750. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1751. do { \
  1752. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  1753. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  1754. } while (0)
  1755. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1756. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1757. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1758. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1759. do { \
  1760. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  1761. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  1762. } while (0)
  1763. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1764. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1765. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1766. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1767. do { \
  1768. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  1769. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1770. } while (0)
  1771. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1772. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1773. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1774. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1775. do { \
  1776. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1777. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  1778. } while (0)
  1779. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1780. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1781. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1782. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1783. do { \
  1784. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  1785. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1786. } while (0)
  1787. /* DWORD 1 */
  1788. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1789. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1790. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1791. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1792. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1793. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1794. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1795. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1796. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  1797. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  1798. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  1799. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  1800. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  1801. do { \
  1802. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  1803. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  1804. } while (0)
  1805. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  1806. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  1807. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  1808. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  1809. do { \
  1810. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  1811. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  1812. } while (0)
  1813. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  1814. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  1815. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  1816. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  1817. do { \
  1818. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  1819. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  1820. } while (0)
  1821. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  1822. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  1823. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  1824. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  1825. do { \
  1826. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  1827. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  1828. } while (0)
  1829. /* DWORD 2 */
  1830. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  1831. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  1832. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  1833. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  1834. do { \
  1835. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  1836. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  1837. } while (0)
  1838. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  1839. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  1840. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  1841. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  1842. do { \
  1843. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  1844. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  1845. } while (0)
  1846. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  1847. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  1848. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  1849. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  1850. do { \
  1851. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  1852. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  1853. } while (0)
  1854. /* DWORD 5 */
  1855. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  1856. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  1857. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  1858. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  1859. do { \
  1860. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  1861. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  1862. } while (0)
  1863. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  1864. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  1865. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  1866. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  1867. do { \
  1868. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  1869. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  1870. } while (0)
  1871. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  1872. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  1873. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  1874. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  1875. do { \
  1876. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  1877. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  1878. } while (0)
  1879. /* DWORD 6 */
  1880. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  1881. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  1882. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  1883. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  1884. do { \
  1885. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  1886. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  1887. } while (0)
  1888. typedef enum {
  1889. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  1890. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  1891. } htt_tcl_metadata_type;
  1892. /**
  1893. * @brief HTT TCL command number format
  1894. * @details
  1895. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  1896. * available to firmware as tcl_exit_base->tcl_status_number.
  1897. * For regular / multicast packets host will send vdev and mac id and for
  1898. * NAWDS packets, host will send peer id.
  1899. * A_UINT32 is used to avoid endianness conversion problems.
  1900. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  1901. */
  1902. typedef struct {
  1903. A_UINT32
  1904. type: 1, /* vdev_id based or peer_id based */
  1905. rsvd: 31;
  1906. } htt_tx_tcl_vdev_or_peer_t;
  1907. typedef struct {
  1908. A_UINT32
  1909. type: 1, /* vdev_id based or peer_id based */
  1910. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1911. vdev_id: 8,
  1912. pdev_id: 2,
  1913. host_inspected:1,
  1914. rsvd: 19;
  1915. } htt_tx_tcl_vdev_metadata;
  1916. typedef struct {
  1917. A_UINT32
  1918. type: 1, /* vdev_id based or peer_id based */
  1919. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1920. peer_id: 14,
  1921. rsvd: 16;
  1922. } htt_tx_tcl_peer_metadata;
  1923. PREPACK struct htt_tx_tcl_metadata {
  1924. union {
  1925. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  1926. htt_tx_tcl_vdev_metadata vdev_meta;
  1927. htt_tx_tcl_peer_metadata peer_meta;
  1928. };
  1929. } POSTPACK;
  1930. /* DWORD 0 */
  1931. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  1932. #define HTT_TX_TCL_METADATA_TYPE_S 0
  1933. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  1934. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  1935. /* VDEV metadata */
  1936. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  1937. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  1938. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  1939. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  1940. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  1941. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  1942. /* PEER metadata */
  1943. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  1944. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  1945. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  1946. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  1947. HTT_TX_TCL_METADATA_TYPE_S)
  1948. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  1949. do { \
  1950. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  1951. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  1952. } while (0)
  1953. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  1954. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  1955. HTT_TX_TCL_METADATA_VALID_HTT_S)
  1956. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  1957. do { \
  1958. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  1959. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  1960. } while (0)
  1961. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  1962. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  1963. HTT_TX_TCL_METADATA_VDEV_ID_S)
  1964. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  1965. do { \
  1966. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  1967. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  1968. } while (0)
  1969. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  1970. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  1971. HTT_TX_TCL_METADATA_PDEV_ID_S)
  1972. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  1973. do { \
  1974. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  1975. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  1976. } while (0)
  1977. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  1978. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  1979. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  1980. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  1981. do { \
  1982. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  1983. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  1984. } while (0)
  1985. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  1986. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  1987. HTT_TX_TCL_METADATA_PEER_ID_S)
  1988. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  1989. do { \
  1990. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  1991. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  1992. } while (0)
  1993. typedef enum {
  1994. HTT_TX_FW2WBM_TX_STATUS_OK,
  1995. HTT_TX_FW2WBM_TX_STATUS_DROP,
  1996. HTT_TX_FW2WBM_TX_STATUS_TTL,
  1997. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  1998. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  1999. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2000. HTT_TX_FW2WBM_TX_STATUS_MAX
  2001. } htt_tx_fw2wbm_tx_status_t;
  2002. typedef enum {
  2003. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2004. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2005. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2006. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2007. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2008. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2009. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2010. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2011. } htt_tx_fw2wbm_reinject_reason_t;
  2012. /**
  2013. * @brief HTT TX WBM Completion from firmware to host
  2014. * @details
  2015. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2016. * DWORD 3 and 4 for software based completions (Exception frames and
  2017. * TQM bypass frames)
  2018. * For software based completions, wbm_release_ring->release_source_module will
  2019. * be set to release_source_fw
  2020. */
  2021. PREPACK struct htt_tx_wbm_completion {
  2022. A_UINT32
  2023. sch_cmd_id: 24,
  2024. exception_frame: 1, /* If set, this packet was queued via exception path */
  2025. rsvd0_31_25: 7;
  2026. A_UINT32
  2027. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2028. * reception of an ACK or BA, this field indicates
  2029. * the RSSI of the received ACK or BA frame.
  2030. * When the frame is removed as result of a direct
  2031. * remove command from the SW, this field is set
  2032. * to 0x0 (which is never a valid value when real
  2033. * RSSI is available).
  2034. * Units: dB w.r.t noise floor
  2035. */
  2036. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2037. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2038. rsvd1_31_16: 16;
  2039. } POSTPACK;
  2040. /* DWORD 0 */
  2041. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2042. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2043. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2044. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2045. /* DWORD 1 */
  2046. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2047. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2048. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2049. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2050. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2051. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2052. /* DWORD 0 */
  2053. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2054. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2055. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2056. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2057. do { \
  2058. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2059. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2060. } while (0)
  2061. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2062. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2063. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2064. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2065. do { \
  2066. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2067. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2068. } while (0)
  2069. /* DWORD 1 */
  2070. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2071. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2072. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2073. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2074. do { \
  2075. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2076. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2077. } while (0)
  2078. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2079. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2080. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2081. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2082. do { \
  2083. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2084. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2085. } while (0)
  2086. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2087. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2088. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2089. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2090. do { \
  2091. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2092. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2093. } while (0)
  2094. /**
  2095. * @brief HTT TX WBM Completion from firmware to host
  2096. * @details
  2097. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2098. * (WBM) offload HW.
  2099. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2100. * For software based completions, release_source_module will
  2101. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2102. * struct wbm_release_ring and then switch to this after looking at
  2103. * release_source_module.
  2104. */
  2105. PREPACK struct htt_tx_wbm_completion_v2 {
  2106. A_UINT32
  2107. used_by_hw0; /* Refer to struct wbm_release_ring */
  2108. A_UINT32
  2109. used_by_hw1; /* Refer to struct wbm_release_ring */
  2110. A_UINT32
  2111. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2112. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2113. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2114. exception_frame: 1,
  2115. rsvd0: 12, /* For future use */
  2116. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2117. rsvd1: 1; /* For future use */
  2118. A_UINT32
  2119. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2120. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2121. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2122. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2123. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2124. */
  2125. A_UINT32
  2126. data1: 32;
  2127. A_UINT32
  2128. data2: 32;
  2129. A_UINT32
  2130. used_by_hw3; /* Refer to struct wbm_release_ring */
  2131. } POSTPACK;
  2132. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2133. /* DWORD 3 */
  2134. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2135. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2136. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2137. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2138. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2139. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2140. /* DWORD 3 */
  2141. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2142. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2143. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2144. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2145. do { \
  2146. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2147. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2148. } while (0)
  2149. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2150. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2151. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2152. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2153. do { \
  2154. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2155. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2156. } while (0)
  2157. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2158. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2159. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2160. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2161. do { \
  2162. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2163. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2164. } while (0)
  2165. /**
  2166. * @brief HTT TX WBM transmit status from firmware to host
  2167. * @details
  2168. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2169. * (WBM) offload HW.
  2170. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2171. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2172. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2173. */
  2174. PREPACK struct htt_tx_wbm_transmit_status {
  2175. A_UINT32
  2176. sch_cmd_id: 24,
  2177. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2178. * reception of an ACK or BA, this field indicates
  2179. * the RSSI of the received ACK or BA frame.
  2180. * When the frame is removed as result of a direct
  2181. * remove command from the SW, this field is set
  2182. * to 0x0 (which is never a valid value when real
  2183. * RSSI is available).
  2184. * Units: dB w.r.t noise floor
  2185. */
  2186. A_UINT32
  2187. sw_peer_id: 16,
  2188. tid_num: 5,
  2189. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2190. * and tid_num fields contain valid data.
  2191. * If this "valid" flag is not set, the
  2192. * sw_peer_id and tid_num fields must be ignored.
  2193. */
  2194. mcast: 1,
  2195. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2196. * contains valid data.
  2197. */
  2198. reserved0: 8;
  2199. A_UINT32
  2200. reserved1: 32;
  2201. } POSTPACK;
  2202. /* DWORD 4 */
  2203. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2204. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2205. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2206. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2207. /* DWORD 5 */
  2208. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2209. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2210. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2211. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2212. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2213. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2214. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2215. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2216. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2217. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2218. /* DWORD 4 */
  2219. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2220. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2221. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2222. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2223. do { \
  2224. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2225. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2226. } while (0)
  2227. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2228. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2229. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2230. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2231. do { \
  2232. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2233. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2234. } while (0)
  2235. /* DWORD 5 */
  2236. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2237. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2238. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2239. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2240. do { \
  2241. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2242. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2243. } while (0)
  2244. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2245. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2246. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2247. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2248. do { \
  2249. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2250. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2251. } while (0)
  2252. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2253. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2254. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2255. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2256. do { \
  2257. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2258. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2259. } while (0)
  2260. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2261. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2262. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2263. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2264. do { \
  2265. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2266. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2267. } while (0)
  2268. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2269. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2270. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2271. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2272. do { \
  2273. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2274. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2275. } while (0)
  2276. /**
  2277. * @brief HTT TX WBM reinject status from firmware to host
  2278. * @details
  2279. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2280. * (WBM) offload HW.
  2281. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2282. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2283. */
  2284. PREPACK struct htt_tx_wbm_reinject_status {
  2285. A_UINT32
  2286. reserved0: 32;
  2287. A_UINT32
  2288. reserved1: 32;
  2289. A_UINT32
  2290. reserved2: 32;
  2291. } POSTPACK;
  2292. /**
  2293. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2294. * @details
  2295. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2296. * (WBM) offload HW.
  2297. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2298. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2299. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2300. * STA side.
  2301. */
  2302. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2303. A_UINT32
  2304. mec_sa_addr_31_0;
  2305. A_UINT32
  2306. mec_sa_addr_47_32: 16,
  2307. sa_ast_index: 16;
  2308. A_UINT32
  2309. vdev_id: 8,
  2310. reserved0: 24;
  2311. } POSTPACK;
  2312. /* DWORD 4 - mec_sa_addr_31_0 */
  2313. /* DWORD 5 */
  2314. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2315. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2316. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2317. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2318. /* DWORD 6 */
  2319. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2320. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2321. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2322. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2323. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2324. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2325. do { \
  2326. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2327. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2328. } while (0)
  2329. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2330. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2331. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2332. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2333. do { \
  2334. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2335. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2336. } while (0)
  2337. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2338. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2339. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2340. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2341. do { \
  2342. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2343. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2344. } while (0)
  2345. typedef enum {
  2346. TX_FLOW_PRIORITY_BE,
  2347. TX_FLOW_PRIORITY_HIGH,
  2348. TX_FLOW_PRIORITY_LOW,
  2349. } htt_tx_flow_priority_t;
  2350. typedef enum {
  2351. TX_FLOW_LATENCY_SENSITIVE,
  2352. TX_FLOW_LATENCY_INSENSITIVE,
  2353. } htt_tx_flow_latency_t;
  2354. typedef enum {
  2355. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2356. TX_FLOW_INTERACTIVE_TRAFFIC,
  2357. TX_FLOW_PERIODIC_TRAFFIC,
  2358. TX_FLOW_BURSTY_TRAFFIC,
  2359. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2360. } htt_tx_flow_traffic_pattern_t;
  2361. /**
  2362. * @brief HTT TX Flow search metadata format
  2363. * @details
  2364. * Host will set this metadata in flow table's flow search entry along with
  2365. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2366. * firmware and TQM ring if the flow search entry wins.
  2367. * This metadata is available to firmware in that first MSDU's
  2368. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2369. * to one of the available flows for specific tid and returns the tqm flow
  2370. * pointer as part of htt_tx_map_flow_info message.
  2371. */
  2372. PREPACK struct htt_tx_flow_metadata {
  2373. A_UINT32
  2374. rsvd0_1_0: 2,
  2375. tid: 4,
  2376. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2377. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2378. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2379. * Else choose final tid based on latency, priority.
  2380. */
  2381. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2382. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2383. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2384. } POSTPACK;
  2385. /* DWORD 0 */
  2386. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2387. #define HTT_TX_FLOW_METADATA_TID_S 2
  2388. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2389. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2390. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2391. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2392. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2393. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2394. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2395. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2396. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2397. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2398. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2399. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2400. /* DWORD 0 */
  2401. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2402. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2403. HTT_TX_FLOW_METADATA_TID_S)
  2404. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2405. do { \
  2406. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2407. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2408. } while (0)
  2409. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2410. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2411. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2412. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2413. do { \
  2414. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2415. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2416. } while (0)
  2417. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2418. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2419. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2420. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2421. do { \
  2422. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2423. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2424. } while (0)
  2425. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2426. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2427. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2428. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2429. do { \
  2430. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2431. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2432. } while (0)
  2433. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2434. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2435. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2436. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2437. do { \
  2438. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2439. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2440. } while (0)
  2441. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2442. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2443. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2444. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2445. do { \
  2446. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2447. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2448. } while (0)
  2449. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2450. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2451. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2452. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2453. do { \
  2454. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2455. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2456. } while (0)
  2457. /**
  2458. * @brief Used in HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY and HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY messages
  2459. *
  2460. * @details
  2461. * HTT wds entry from source port learning
  2462. * Host will learn wds entries from rx and send this message to firmware
  2463. * to enable firmware to configure/delete AST entries for wds clients.
  2464. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2465. * and when SA's entry is deleted, firmware removes this AST entry
  2466. *
  2467. * The message would appear as follows:
  2468. *
  2469. * |31 30|29 |17 16|15 8|7 0|
  2470. * |----------------+----------------+----------------+----------------|
  2471. * | rsvd0 |PDVID| vdev_id | msg_type |
  2472. * |-------------------------------------------------------------------|
  2473. * | sa_addr_31_0 |
  2474. * |-------------------------------------------------------------------|
  2475. * | | ta_peer_id | sa_addr_47_32 |
  2476. * |-------------------------------------------------------------------|
  2477. * Where PDVID = pdev_id
  2478. *
  2479. * The message is interpreted as follows:
  2480. *
  2481. * dword0 - b'0:7 - msg_type: This will be set to
  2482. * HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY or
  2483. * HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2484. *
  2485. * dword0 - b'8:15 - vdev_id
  2486. *
  2487. * dword0 - b'16:17 - pdev_id
  2488. *
  2489. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2490. *
  2491. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2492. *
  2493. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2494. *
  2495. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2496. */
  2497. PREPACK struct htt_wds_entry {
  2498. A_UINT32
  2499. msg_type: 8,
  2500. vdev_id: 8,
  2501. pdev_id: 2,
  2502. rsvd0: 14;
  2503. A_UINT32 sa_addr_31_0;
  2504. A_UINT32
  2505. sa_addr_47_32: 16,
  2506. ta_peer_id: 14,
  2507. rsvd2: 2;
  2508. } POSTPACK;
  2509. /* DWORD 0 */
  2510. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2511. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2512. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2513. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2514. /* DWORD 2 */
  2515. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2516. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2517. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2518. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2519. /* DWORD 0 */
  2520. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2521. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2522. HTT_WDS_ENTRY_VDEV_ID_S)
  2523. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2524. do { \
  2525. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2526. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2527. } while (0)
  2528. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2529. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2530. HTT_WDS_ENTRY_PDEV_ID_S)
  2531. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2532. do { \
  2533. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2534. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2535. } while (0)
  2536. /* DWORD 2 */
  2537. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2538. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2539. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2540. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2541. do { \
  2542. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2543. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2544. } while (0)
  2545. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2546. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2547. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2548. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2549. do { \
  2550. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2551. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2552. } while (0)
  2553. /**
  2554. * @brief MAC DMA rx ring setup specification
  2555. * @details
  2556. * To allow for dynamic rx ring reconfiguration and to avoid race
  2557. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2558. * it uses. Instead, it sends this message to the target, indicating how
  2559. * the rx ring used by the host should be set up and maintained.
  2560. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2561. * specifications.
  2562. *
  2563. * |31 16|15 8|7 0|
  2564. * |---------------------------------------------------------------|
  2565. * header: | reserved | num rings | msg type |
  2566. * |---------------------------------------------------------------|
  2567. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2568. #if HTT_PADDR64
  2569. * | FW_IDX shadow register physical address (bits 63:32) |
  2570. #endif
  2571. * |---------------------------------------------------------------|
  2572. * | rx ring base physical address (bits 31:0) |
  2573. #if HTT_PADDR64
  2574. * | rx ring base physical address (bits 63:32) |
  2575. #endif
  2576. * |---------------------------------------------------------------|
  2577. * | rx ring buffer size | rx ring length |
  2578. * |---------------------------------------------------------------|
  2579. * | FW_IDX initial value | enabled flags |
  2580. * |---------------------------------------------------------------|
  2581. * | MSDU payload offset | 802.11 header offset |
  2582. * |---------------------------------------------------------------|
  2583. * | PPDU end offset | PPDU start offset |
  2584. * |---------------------------------------------------------------|
  2585. * | MPDU end offset | MPDU start offset |
  2586. * |---------------------------------------------------------------|
  2587. * | MSDU end offset | MSDU start offset |
  2588. * |---------------------------------------------------------------|
  2589. * | frag info offset | rx attention offset |
  2590. * |---------------------------------------------------------------|
  2591. * payload 2, if present, has the same format as payload 1
  2592. * Header fields:
  2593. * - MSG_TYPE
  2594. * Bits 7:0
  2595. * Purpose: identifies this as an rx ring configuration message
  2596. * Value: 0x2
  2597. * - NUM_RINGS
  2598. * Bits 15:8
  2599. * Purpose: indicates whether the host is setting up one rx ring or two
  2600. * Value: 1 or 2
  2601. * Payload:
  2602. * for systems using 64-bit format for bus addresses:
  2603. * - IDX_SHADOW_REG_PADDR_LO
  2604. * Bits 31:0
  2605. * Value: lower 4 bytes of physical address of the host's
  2606. * FW_IDX shadow register
  2607. * - IDX_SHADOW_REG_PADDR_HI
  2608. * Bits 31:0
  2609. * Value: upper 4 bytes of physical address of the host's
  2610. * FW_IDX shadow register
  2611. * - RING_BASE_PADDR_LO
  2612. * Bits 31:0
  2613. * Value: lower 4 bytes of physical address of the host's rx ring
  2614. * - RING_BASE_PADDR_HI
  2615. * Bits 31:0
  2616. * Value: uppper 4 bytes of physical address of the host's rx ring
  2617. * for systems using 32-bit format for bus addresses:
  2618. * - IDX_SHADOW_REG_PADDR
  2619. * Bits 31:0
  2620. * Value: physical address of the host's FW_IDX shadow register
  2621. * - RING_BASE_PADDR
  2622. * Bits 31:0
  2623. * Value: physical address of the host's rx ring
  2624. * - RING_LEN
  2625. * Bits 15:0
  2626. * Value: number of elements in the rx ring
  2627. * - RING_BUF_SZ
  2628. * Bits 31:16
  2629. * Value: size of the buffers referenced by the rx ring, in byte units
  2630. * - ENABLED_FLAGS
  2631. * Bits 15:0
  2632. * Value: 1-bit flags to show whether different rx fields are enabled
  2633. * bit 0: 802.11 header enabled (1) or disabled (0)
  2634. * bit 1: MSDU payload enabled (1) or disabled (0)
  2635. * bit 2: PPDU start enabled (1) or disabled (0)
  2636. * bit 3: PPDU end enabled (1) or disabled (0)
  2637. * bit 4: MPDU start enabled (1) or disabled (0)
  2638. * bit 5: MPDU end enabled (1) or disabled (0)
  2639. * bit 6: MSDU start enabled (1) or disabled (0)
  2640. * bit 7: MSDU end enabled (1) or disabled (0)
  2641. * bit 8: rx attention enabled (1) or disabled (0)
  2642. * bit 9: frag info enabled (1) or disabled (0)
  2643. * bit 10: unicast rx enabled (1) or disabled (0)
  2644. * bit 11: multicast rx enabled (1) or disabled (0)
  2645. * bit 12: ctrl rx enabled (1) or disabled (0)
  2646. * bit 13: mgmt rx enabled (1) or disabled (0)
  2647. * bit 14: null rx enabled (1) or disabled (0)
  2648. * bit 15: phy data rx enabled (1) or disabled (0)
  2649. * - IDX_INIT_VAL
  2650. * Bits 31:16
  2651. * Purpose: Specify the initial value for the FW_IDX.
  2652. * Value: the number of buffers initially present in the host's rx ring
  2653. * - OFFSET_802_11_HDR
  2654. * Bits 15:0
  2655. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2656. * - OFFSET_MSDU_PAYLOAD
  2657. * Bits 31:16
  2658. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2659. * - OFFSET_PPDU_START
  2660. * Bits 15:0
  2661. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2662. * - OFFSET_PPDU_END
  2663. * Bits 31:16
  2664. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2665. * - OFFSET_MPDU_START
  2666. * Bits 15:0
  2667. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2668. * - OFFSET_MPDU_END
  2669. * Bits 31:16
  2670. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2671. * - OFFSET_MSDU_START
  2672. * Bits 15:0
  2673. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2674. * - OFFSET_MSDU_END
  2675. * Bits 31:16
  2676. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2677. * - OFFSET_RX_ATTN
  2678. * Bits 15:0
  2679. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2680. * - OFFSET_FRAG_INFO
  2681. * Bits 31:16
  2682. * Value: offset in QUAD-bytes of frag info table
  2683. */
  2684. /* header fields */
  2685. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2686. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2687. /* payload fields */
  2688. /* for systems using a 64-bit format for bus addresses */
  2689. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2690. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2691. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2692. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2693. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2694. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2695. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2696. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2697. /* for systems using a 32-bit format for bus addresses */
  2698. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2699. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2700. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2701. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2702. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2703. #define HTT_RX_RING_CFG_LEN_S 0
  2704. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2705. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2706. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2707. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2708. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2709. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2710. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2711. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2712. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2713. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2714. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2715. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2716. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2717. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2718. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2719. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2720. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2721. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2722. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2723. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2724. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2725. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2726. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2727. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2728. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2729. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2730. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2731. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2732. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2733. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2734. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2735. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2736. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2737. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2738. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2739. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2740. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2741. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2742. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2743. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2744. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2745. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2746. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2747. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2748. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2749. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2750. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2751. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2752. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2753. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2754. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2755. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2756. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2757. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2758. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2759. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2760. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2761. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2762. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2763. #if HTT_PADDR64
  2764. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2765. #else
  2766. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2767. #endif
  2768. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2769. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2770. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2771. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2772. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2773. do { \
  2774. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2775. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2776. } while (0)
  2777. /* degenerate case for 32-bit fields */
  2778. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  2779. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  2780. ((_var) = (_val))
  2781. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  2782. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  2783. ((_var) = (_val))
  2784. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  2785. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  2786. ((_var) = (_val))
  2787. /* degenerate case for 32-bit fields */
  2788. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  2789. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  2790. ((_var) = (_val))
  2791. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  2792. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  2793. ((_var) = (_val))
  2794. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  2795. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  2796. ((_var) = (_val))
  2797. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  2798. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  2799. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  2800. do { \
  2801. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  2802. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  2803. } while (0)
  2804. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  2805. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  2806. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  2807. do { \
  2808. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  2809. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  2810. } while (0)
  2811. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  2812. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  2813. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  2814. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  2815. do { \
  2816. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  2817. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  2818. } while (0)
  2819. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  2820. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  2821. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  2822. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  2823. do { \
  2824. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  2825. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  2826. } while (0)
  2827. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  2828. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  2829. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  2830. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  2831. do { \
  2832. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  2833. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  2834. } while (0)
  2835. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  2836. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  2837. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  2838. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  2839. do { \
  2840. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  2841. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  2842. } while (0)
  2843. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  2844. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  2845. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  2846. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  2847. do { \
  2848. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  2849. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  2850. } while (0)
  2851. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  2852. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  2853. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  2854. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  2855. do { \
  2856. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  2857. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  2858. } while (0)
  2859. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  2860. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  2861. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  2862. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  2863. do { \
  2864. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  2865. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  2866. } while (0)
  2867. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  2868. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  2869. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  2870. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  2871. do { \
  2872. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  2873. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  2874. } while (0)
  2875. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  2876. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  2877. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  2878. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  2879. do { \
  2880. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  2881. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  2882. } while (0)
  2883. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  2884. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  2885. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  2886. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  2887. do { \
  2888. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  2889. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  2890. } while (0)
  2891. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  2892. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  2893. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  2894. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  2895. do { \
  2896. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  2897. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  2898. } while (0)
  2899. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  2900. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  2901. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  2902. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  2903. do { \
  2904. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  2905. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  2906. } while (0)
  2907. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  2908. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  2909. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  2910. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  2911. do { \
  2912. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  2913. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  2914. } while (0)
  2915. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  2916. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  2917. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  2918. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  2919. do { \
  2920. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  2921. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  2922. } while (0)
  2923. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  2924. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  2925. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  2926. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  2927. do { \
  2928. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  2929. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  2930. } while (0)
  2931. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  2932. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  2933. HTT_RX_RING_CFG_ENABLED_NULL_S)
  2934. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  2935. do { \
  2936. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  2937. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  2938. } while (0)
  2939. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  2940. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  2941. HTT_RX_RING_CFG_ENABLED_PHY_S)
  2942. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  2943. do { \
  2944. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  2945. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  2946. } while (0)
  2947. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  2948. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  2949. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  2950. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  2951. do { \
  2952. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  2953. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  2954. } while (0)
  2955. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  2956. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  2957. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  2958. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  2959. do { \
  2960. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  2961. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  2962. } while (0)
  2963. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  2964. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  2965. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  2966. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  2967. do { \
  2968. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  2969. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  2970. } while (0)
  2971. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  2972. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  2973. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  2974. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  2975. do { \
  2976. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  2977. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  2978. } while (0)
  2979. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  2980. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  2981. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  2982. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  2983. do { \
  2984. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  2985. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  2986. } while (0)
  2987. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  2988. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  2989. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  2990. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  2991. do { \
  2992. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  2993. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  2994. } while (0)
  2995. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  2996. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  2997. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  2998. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  2999. do { \
  3000. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3001. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3002. } while (0)
  3003. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3004. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3005. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3006. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3007. do { \
  3008. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3009. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3010. } while (0)
  3011. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3012. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3013. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3014. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3015. do { \
  3016. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3017. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3018. } while (0)
  3019. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3020. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3021. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3022. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3023. do { \
  3024. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3025. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3026. } while (0)
  3027. /**
  3028. * @brief host -> target FW statistics retrieve
  3029. *
  3030. * @details
  3031. * The following field definitions describe the format of the HTT host
  3032. * to target FW stats retrieve message. The message specifies the type of
  3033. * stats host wants to retrieve.
  3034. *
  3035. * |31 24|23 16|15 8|7 0|
  3036. * |-----------------------------------------------------------|
  3037. * | stats types request bitmask | msg type |
  3038. * |-----------------------------------------------------------|
  3039. * | stats types reset bitmask | reserved |
  3040. * |-----------------------------------------------------------|
  3041. * | stats type | config value |
  3042. * |-----------------------------------------------------------|
  3043. * | cookie LSBs |
  3044. * |-----------------------------------------------------------|
  3045. * | cookie MSBs |
  3046. * |-----------------------------------------------------------|
  3047. * Header fields:
  3048. * - MSG_TYPE
  3049. * Bits 7:0
  3050. * Purpose: identifies this is a stats upload request message
  3051. * Value: 0x3
  3052. * - UPLOAD_TYPES
  3053. * Bits 31:8
  3054. * Purpose: identifies which types of FW statistics to upload
  3055. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3056. * - RESET_TYPES
  3057. * Bits 31:8
  3058. * Purpose: identifies which types of FW statistics to reset
  3059. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3060. * - CFG_VAL
  3061. * Bits 23:0
  3062. * Purpose: give an opaque configuration value to the specified stats type
  3063. * Value: stats-type specific configuration value
  3064. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3065. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3066. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3067. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3068. * - CFG_STAT_TYPE
  3069. * Bits 31:24
  3070. * Purpose: specify which stats type (if any) the config value applies to
  3071. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3072. * a valid configuration specification
  3073. * - COOKIE_LSBS
  3074. * Bits 31:0
  3075. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3076. * message with its preceding host->target stats request message.
  3077. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3078. * - COOKIE_MSBS
  3079. * Bits 31:0
  3080. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3081. * message with its preceding host->target stats request message.
  3082. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3083. */
  3084. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3085. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3086. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3087. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3088. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3089. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3090. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3091. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3092. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3093. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3094. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3095. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3096. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3097. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3098. do { \
  3099. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3100. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3101. } while (0)
  3102. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3103. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3104. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3105. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3106. do { \
  3107. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3108. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3109. } while (0)
  3110. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3111. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3112. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3113. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3114. do { \
  3115. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3116. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3117. } while (0)
  3118. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3119. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3120. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3121. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3122. do { \
  3123. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3124. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3125. } while (0)
  3126. /**
  3127. * @brief host -> target HTT out-of-band sync request
  3128. *
  3129. * @details
  3130. * The HTT SYNC tells the target to suspend processing of subsequent
  3131. * HTT host-to-target messages until some other target agent locally
  3132. * informs the target HTT FW that the current sync counter is equal to
  3133. * or greater than (in a modulo sense) the sync counter specified in
  3134. * the SYNC message.
  3135. * This allows other host-target components to synchronize their operation
  3136. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3137. * security key has been downloaded to and activated by the target.
  3138. * In the absence of any explicit synchronization counter value
  3139. * specification, the target HTT FW will use zero as the default current
  3140. * sync value.
  3141. *
  3142. * |31 24|23 16|15 8|7 0|
  3143. * |-----------------------------------------------------------|
  3144. * | reserved | sync count | msg type |
  3145. * |-----------------------------------------------------------|
  3146. * Header fields:
  3147. * - MSG_TYPE
  3148. * Bits 7:0
  3149. * Purpose: identifies this as a sync message
  3150. * Value: 0x4
  3151. * - SYNC_COUNT
  3152. * Bits 15:8
  3153. * Purpose: specifies what sync value the HTT FW will wait for from
  3154. * an out-of-band specification to resume its operation
  3155. * Value: in-band sync counter value to compare against the out-of-band
  3156. * counter spec.
  3157. * The HTT target FW will suspend its host->target message processing
  3158. * as long as
  3159. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3160. */
  3161. #define HTT_H2T_SYNC_MSG_SZ 4
  3162. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3163. #define HTT_H2T_SYNC_COUNT_S 8
  3164. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3165. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3166. HTT_H2T_SYNC_COUNT_S)
  3167. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3168. do { \
  3169. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3170. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3171. } while (0)
  3172. /**
  3173. * @brief HTT aggregation configuration
  3174. */
  3175. #define HTT_AGGR_CFG_MSG_SZ 4
  3176. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3177. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3178. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3179. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3180. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3181. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3182. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3183. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3184. do { \
  3185. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3186. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3187. } while (0)
  3188. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3189. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3190. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3191. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3192. do { \
  3193. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3194. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3195. } while (0)
  3196. /**
  3197. * @brief host -> target HTT configure max amsdu info per vdev
  3198. *
  3199. * @details
  3200. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3201. *
  3202. * |31 21|20 16|15 8|7 0|
  3203. * |-----------------------------------------------------------|
  3204. * | reserved | vdev id | max amsdu | msg type |
  3205. * |-----------------------------------------------------------|
  3206. * Header fields:
  3207. * - MSG_TYPE
  3208. * Bits 7:0
  3209. * Purpose: identifies this as a aggr cfg ex message
  3210. * Value: 0xa
  3211. * - MAX_NUM_AMSDU_SUBFRM
  3212. * Bits 15:8
  3213. * Purpose: max MSDUs per A-MSDU
  3214. * - VDEV_ID
  3215. * Bits 20:16
  3216. * Purpose: ID of the vdev to which this limit is applied
  3217. */
  3218. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3219. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3220. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3221. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3222. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3223. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3224. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3225. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3226. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3227. do { \
  3228. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3229. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3230. } while (0)
  3231. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3232. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3233. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3234. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3235. do { \
  3236. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3237. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3238. } while (0)
  3239. /**
  3240. * @brief HTT WDI_IPA Config Message
  3241. *
  3242. * @details
  3243. * The HTT WDI_IPA config message is created/sent by host at driver
  3244. * init time. It contains information about data structures used on
  3245. * WDI_IPA TX and RX path.
  3246. * TX CE ring is used for pushing packet metadata from IPA uC
  3247. * to WLAN FW
  3248. * TX Completion ring is used for generating TX completions from
  3249. * WLAN FW to IPA uC
  3250. * RX Indication ring is used for indicating RX packets from FW
  3251. * to IPA uC
  3252. * RX Ring2 is used as either completion ring or as second
  3253. * indication ring. when Ring2 is used as completion ring, IPA uC
  3254. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3255. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3256. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3257. * indicated in RX Indication ring. Please see WDI_IPA specification
  3258. * for more details.
  3259. * |31 24|23 16|15 8|7 0|
  3260. * |----------------+----------------+----------------+----------------|
  3261. * | tx pkt pool size | Rsvd | msg_type |
  3262. * |-------------------------------------------------------------------|
  3263. * | tx comp ring base (bits 31:0) |
  3264. #if HTT_PADDR64
  3265. * | tx comp ring base (bits 63:32) |
  3266. #endif
  3267. * |-------------------------------------------------------------------|
  3268. * | tx comp ring size |
  3269. * |-------------------------------------------------------------------|
  3270. * | tx comp WR_IDX physical address (bits 31:0) |
  3271. #if HTT_PADDR64
  3272. * | tx comp WR_IDX physical address (bits 63:32) |
  3273. #endif
  3274. * |-------------------------------------------------------------------|
  3275. * | tx CE WR_IDX physical address (bits 31:0) |
  3276. #if HTT_PADDR64
  3277. * | tx CE WR_IDX physical address (bits 63:32) |
  3278. #endif
  3279. * |-------------------------------------------------------------------|
  3280. * | rx indication ring base (bits 31:0) |
  3281. #if HTT_PADDR64
  3282. * | rx indication ring base (bits 63:32) |
  3283. #endif
  3284. * |-------------------------------------------------------------------|
  3285. * | rx indication ring size |
  3286. * |-------------------------------------------------------------------|
  3287. * | rx ind RD_IDX physical address (bits 31:0) |
  3288. #if HTT_PADDR64
  3289. * | rx ind RD_IDX physical address (bits 63:32) |
  3290. #endif
  3291. * |-------------------------------------------------------------------|
  3292. * | rx ind WR_IDX physical address (bits 31:0) |
  3293. #if HTT_PADDR64
  3294. * | rx ind WR_IDX physical address (bits 63:32) |
  3295. #endif
  3296. * |-------------------------------------------------------------------|
  3297. * |-------------------------------------------------------------------|
  3298. * | rx ring2 base (bits 31:0) |
  3299. #if HTT_PADDR64
  3300. * | rx ring2 base (bits 63:32) |
  3301. #endif
  3302. * |-------------------------------------------------------------------|
  3303. * | rx ring2 size |
  3304. * |-------------------------------------------------------------------|
  3305. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3306. #if HTT_PADDR64
  3307. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3308. #endif
  3309. * |-------------------------------------------------------------------|
  3310. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3311. #if HTT_PADDR64
  3312. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3313. #endif
  3314. * |-------------------------------------------------------------------|
  3315. *
  3316. * Header fields:
  3317. * Header fields:
  3318. * - MSG_TYPE
  3319. * Bits 7:0
  3320. * Purpose: Identifies this as WDI_IPA config message
  3321. * value: = 0x8
  3322. * - TX_PKT_POOL_SIZE
  3323. * Bits 15:0
  3324. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3325. * WDI_IPA TX path
  3326. * For systems using 32-bit format for bus addresses:
  3327. * - TX_COMP_RING_BASE_ADDR
  3328. * Bits 31:0
  3329. * Purpose: TX Completion Ring base address in DDR
  3330. * - TX_COMP_RING_SIZE
  3331. * Bits 31:0
  3332. * Purpose: TX Completion Ring size (must be power of 2)
  3333. * - TX_COMP_WR_IDX_ADDR
  3334. * Bits 31:0
  3335. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3336. * updates the Write Index for WDI_IPA TX completion ring
  3337. * - TX_CE_WR_IDX_ADDR
  3338. * Bits 31:0
  3339. * Purpose: DDR address where IPA uC
  3340. * updates the WR Index for TX CE ring
  3341. * (needed for fusion platforms)
  3342. * - RX_IND_RING_BASE_ADDR
  3343. * Bits 31:0
  3344. * Purpose: RX Indication Ring base address in DDR
  3345. * - RX_IND_RING_SIZE
  3346. * Bits 31:0
  3347. * Purpose: RX Indication Ring size
  3348. * - RX_IND_RD_IDX_ADDR
  3349. * Bits 31:0
  3350. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3351. * RX indication ring
  3352. * - RX_IND_WR_IDX_ADDR
  3353. * Bits 31:0
  3354. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3355. * updates the Write Index for WDI_IPA RX indication ring
  3356. * - RX_RING2_BASE_ADDR
  3357. * Bits 31:0
  3358. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3359. * - RX_RING2_SIZE
  3360. * Bits 31:0
  3361. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3362. * - RX_RING2_RD_IDX_ADDR
  3363. * Bits 31:0
  3364. * Purpose: If Second RX ring is Indication ring, DDR address where
  3365. * IPA uC updates the Read Index for Ring2.
  3366. * If Second RX ring is completion ring, this is NOT used
  3367. * - RX_RING2_WR_IDX_ADDR
  3368. * Bits 31:0
  3369. * Purpose: If Second RX ring is Indication ring, DDR address where
  3370. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3371. * If second RX ring is completion ring, DDR address where
  3372. * IPA uC updates the Write Index for Ring 2.
  3373. * For systems using 64-bit format for bus addresses:
  3374. * - TX_COMP_RING_BASE_ADDR_LO
  3375. * Bits 31:0
  3376. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3377. * - TX_COMP_RING_BASE_ADDR_HI
  3378. * Bits 31:0
  3379. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3380. * - TX_COMP_RING_SIZE
  3381. * Bits 31:0
  3382. * Purpose: TX Completion Ring size (must be power of 2)
  3383. * - TX_COMP_WR_IDX_ADDR_LO
  3384. * Bits 31:0
  3385. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3386. * Lower 4 bytes of DDR address where WIFI FW
  3387. * updates the Write Index for WDI_IPA TX completion ring
  3388. * - TX_COMP_WR_IDX_ADDR_HI
  3389. * Bits 31:0
  3390. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3391. * Higher 4 bytes of DDR address where WIFI FW
  3392. * updates the Write Index for WDI_IPA TX completion ring
  3393. * - TX_CE_WR_IDX_ADDR_LO
  3394. * Bits 31:0
  3395. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3396. * updates the WR Index for TX CE ring
  3397. * (needed for fusion platforms)
  3398. * - TX_CE_WR_IDX_ADDR_HI
  3399. * Bits 31:0
  3400. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3401. * updates the WR Index for TX CE ring
  3402. * (needed for fusion platforms)
  3403. * - RX_IND_RING_BASE_ADDR_LO
  3404. * Bits 31:0
  3405. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3406. * - RX_IND_RING_BASE_ADDR_HI
  3407. * Bits 31:0
  3408. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3409. * - RX_IND_RING_SIZE
  3410. * Bits 31:0
  3411. * Purpose: RX Indication Ring size
  3412. * - RX_IND_RD_IDX_ADDR_LO
  3413. * Bits 31:0
  3414. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3415. * for WDI_IPA RX indication ring
  3416. * - RX_IND_RD_IDX_ADDR_HI
  3417. * Bits 31:0
  3418. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3419. * for WDI_IPA RX indication ring
  3420. * - RX_IND_WR_IDX_ADDR_LO
  3421. * Bits 31:0
  3422. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3423. * Lower 4 bytes of DDR address where WIFI FW
  3424. * updates the Write Index for WDI_IPA RX indication ring
  3425. * - RX_IND_WR_IDX_ADDR_HI
  3426. * Bits 31:0
  3427. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3428. * Higher 4 bytes of DDR address where WIFI FW
  3429. * updates the Write Index for WDI_IPA RX indication ring
  3430. * - RX_RING2_BASE_ADDR_LO
  3431. * Bits 31:0
  3432. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3433. * - RX_RING2_BASE_ADDR_HI
  3434. * Bits 31:0
  3435. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3436. * - RX_RING2_SIZE
  3437. * Bits 31:0
  3438. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3439. * - RX_RING2_RD_IDX_ADDR_LO
  3440. * Bits 31:0
  3441. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3442. * DDR address where IPA uC updates the Read Index for Ring2.
  3443. * If Second RX ring is completion ring, this is NOT used
  3444. * - RX_RING2_RD_IDX_ADDR_HI
  3445. * Bits 31:0
  3446. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3447. * DDR address where IPA uC updates the Read Index for Ring2.
  3448. * If Second RX ring is completion ring, this is NOT used
  3449. * - RX_RING2_WR_IDX_ADDR_LO
  3450. * Bits 31:0
  3451. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3452. * DDR address where WIFI FW updates the Write Index
  3453. * for WDI_IPA RX ring2
  3454. * If second RX ring is completion ring, lower 4 bytes of
  3455. * DDR address where IPA uC updates the Write Index for Ring 2.
  3456. * - RX_RING2_WR_IDX_ADDR_HI
  3457. * Bits 31:0
  3458. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3459. * DDR address where WIFI FW updates the Write Index
  3460. * for WDI_IPA RX ring2
  3461. * If second RX ring is completion ring, higher 4 bytes of
  3462. * DDR address where IPA uC updates the Write Index for Ring 2.
  3463. */
  3464. #if HTT_PADDR64
  3465. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3466. #else
  3467. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3468. #endif
  3469. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3470. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3471. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3472. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3473. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3474. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3475. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3476. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3477. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3478. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3479. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3480. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3481. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3482. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3483. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3484. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3485. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3486. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3487. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3488. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3489. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3490. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3491. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3492. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3493. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3494. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3495. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3496. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3497. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3498. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3499. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3500. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3501. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3502. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3503. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3504. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3505. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3506. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3507. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3508. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3509. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3510. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3511. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3512. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3513. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3514. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3515. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3516. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3517. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3518. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3519. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3520. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3521. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3522. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3523. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3524. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3525. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3526. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3527. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3528. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3529. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3530. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3531. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3532. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3533. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3534. do { \
  3535. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3536. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3537. } while (0)
  3538. /* for systems using 32-bit format for bus addr */
  3539. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3540. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3541. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3542. do { \
  3543. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3544. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3545. } while (0)
  3546. /* for systems using 64-bit format for bus addr */
  3547. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3548. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3549. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3550. do { \
  3551. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3552. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3553. } while (0)
  3554. /* for systems using 64-bit format for bus addr */
  3555. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3556. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3557. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3558. do { \
  3559. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3560. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3561. } while (0)
  3562. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3563. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3564. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3565. do { \
  3566. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3567. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3568. } while (0)
  3569. /* for systems using 32-bit format for bus addr */
  3570. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3571. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3572. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3573. do { \
  3574. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3575. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3576. } while (0)
  3577. /* for systems using 64-bit format for bus addr */
  3578. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3579. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3580. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3581. do { \
  3582. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3583. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3584. } while (0)
  3585. /* for systems using 64-bit format for bus addr */
  3586. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3587. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3588. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3589. do { \
  3590. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3591. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3592. } while (0)
  3593. /* for systems using 32-bit format for bus addr */
  3594. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3595. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3596. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3597. do { \
  3598. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3599. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3600. } while (0)
  3601. /* for systems using 64-bit format for bus addr */
  3602. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3603. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3604. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3605. do { \
  3606. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3607. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3608. } while (0)
  3609. /* for systems using 64-bit format for bus addr */
  3610. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3611. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3612. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3613. do { \
  3614. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3615. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3616. } while (0)
  3617. /* for systems using 32-bit format for bus addr */
  3618. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3619. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3620. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3621. do { \
  3622. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3623. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3624. } while (0)
  3625. /* for systems using 64-bit format for bus addr */
  3626. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3627. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3628. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3629. do { \
  3630. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3631. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3632. } while (0)
  3633. /* for systems using 64-bit format for bus addr */
  3634. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3635. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3636. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3637. do { \
  3638. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3639. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3640. } while (0)
  3641. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3642. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3643. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3644. do { \
  3645. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3646. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3647. } while (0)
  3648. /* for systems using 32-bit format for bus addr */
  3649. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3650. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3651. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3652. do { \
  3653. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3654. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3655. } while (0)
  3656. /* for systems using 64-bit format for bus addr */
  3657. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3658. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3659. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3660. do { \
  3661. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3662. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3663. } while (0)
  3664. /* for systems using 64-bit format for bus addr */
  3665. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3666. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3667. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3668. do { \
  3669. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3670. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3671. } while (0)
  3672. /* for systems using 32-bit format for bus addr */
  3673. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3674. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3675. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3676. do { \
  3677. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3678. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3679. } while (0)
  3680. /* for systems using 64-bit format for bus addr */
  3681. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3682. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3683. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3684. do { \
  3685. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3686. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3687. } while (0)
  3688. /* for systems using 64-bit format for bus addr */
  3689. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3690. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3691. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3692. do { \
  3693. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3694. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3695. } while (0)
  3696. /* for systems using 32-bit format for bus addr */
  3697. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3698. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3699. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3700. do { \
  3701. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3702. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3703. } while (0)
  3704. /* for systems using 64-bit format for bus addr */
  3705. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3706. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3707. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3708. do { \
  3709. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3710. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3711. } while (0)
  3712. /* for systems using 64-bit format for bus addr */
  3713. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3714. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3715. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3716. do { \
  3717. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3718. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3719. } while (0)
  3720. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3721. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3722. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3723. do { \
  3724. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3725. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3726. } while (0)
  3727. /* for systems using 32-bit format for bus addr */
  3728. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3729. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3730. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3731. do { \
  3732. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3733. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3734. } while (0)
  3735. /* for systems using 64-bit format for bus addr */
  3736. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3737. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3738. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3739. do { \
  3740. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3741. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3742. } while (0)
  3743. /* for systems using 64-bit format for bus addr */
  3744. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3745. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3746. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3747. do { \
  3748. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3749. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3750. } while (0)
  3751. /* for systems using 32-bit format for bus addr */
  3752. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3753. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3754. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3755. do { \
  3756. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3757. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3758. } while (0)
  3759. /* for systems using 64-bit format for bus addr */
  3760. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3761. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3762. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3763. do { \
  3764. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3765. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3766. } while (0)
  3767. /* for systems using 64-bit format for bus addr */
  3768. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  3769. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  3770. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  3771. do { \
  3772. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  3773. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  3774. } while (0)
  3775. /*
  3776. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  3777. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  3778. * addresses are stored in a XXX-bit field.
  3779. * This macro is used to define both htt_wdi_ipa_config32_t and
  3780. * htt_wdi_ipa_config64_t structs.
  3781. */
  3782. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  3783. _paddr__tx_comp_ring_base_addr_, \
  3784. _paddr__tx_comp_wr_idx_addr_, \
  3785. _paddr__tx_ce_wr_idx_addr_, \
  3786. _paddr__rx_ind_ring_base_addr_, \
  3787. _paddr__rx_ind_rd_idx_addr_, \
  3788. _paddr__rx_ind_wr_idx_addr_, \
  3789. _paddr__rx_ring2_base_addr_,\
  3790. _paddr__rx_ring2_rd_idx_addr_,\
  3791. _paddr__rx_ring2_wr_idx_addr_) \
  3792. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  3793. { \
  3794. /* DWORD 0: flags and meta-data */ \
  3795. A_UINT32 \
  3796. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  3797. reserved: 8, \
  3798. tx_pkt_pool_size: 16;\
  3799. /* DWORD 1 */\
  3800. _paddr__tx_comp_ring_base_addr_;\
  3801. /* DWORD 2 (or 3)*/\
  3802. A_UINT32 tx_comp_ring_size;\
  3803. /* DWORD 3 (or 4)*/\
  3804. _paddr__tx_comp_wr_idx_addr_;\
  3805. /* DWORD 4 (or 6)*/\
  3806. _paddr__tx_ce_wr_idx_addr_;\
  3807. /* DWORD 5 (or 8)*/\
  3808. _paddr__rx_ind_ring_base_addr_;\
  3809. /* DWORD 6 (or 10)*/\
  3810. A_UINT32 rx_ind_ring_size;\
  3811. /* DWORD 7 (or 11)*/\
  3812. _paddr__rx_ind_rd_idx_addr_;\
  3813. /* DWORD 8 (or 13)*/\
  3814. _paddr__rx_ind_wr_idx_addr_;\
  3815. /* DWORD 9 (or 15)*/\
  3816. _paddr__rx_ring2_base_addr_;\
  3817. /* DWORD 10 (or 17) */\
  3818. A_UINT32 rx_ring2_size;\
  3819. /* DWORD 11 (or 18) */\
  3820. _paddr__rx_ring2_rd_idx_addr_;\
  3821. /* DWORD 12 (or 20) */\
  3822. _paddr__rx_ring2_wr_idx_addr_;\
  3823. } POSTPACK
  3824. /* define a htt_wdi_ipa_config32_t type */
  3825. TEMPLATE_HTT_WDI_IPA_CONFIG_T(32, HTT_VAR_PADDR32(tx_comp_ring_base_addr), HTT_VAR_PADDR32(tx_comp_wr_idx_addr), HTT_VAR_PADDR32(tx_ce_wr_idx_addr), HTT_VAR_PADDR32(rx_ind_ring_base_addr), HTT_VAR_PADDR32(rx_ind_rd_idx_addr),HTT_VAR_PADDR32(rx_ind_wr_idx_addr), HTT_VAR_PADDR32(rx_ring2_base_addr), HTT_VAR_PADDR32(rx_ring2_rd_idx_addr), HTT_VAR_PADDR32(rx_ring2_wr_idx_addr));
  3826. /* define a htt_wdi_ipa_config64_t type */
  3827. TEMPLATE_HTT_WDI_IPA_CONFIG_T(64, HTT_VAR_PADDR64_LE(tx_comp_ring_base_addr), HTT_VAR_PADDR64_LE(tx_comp_wr_idx_addr), HTT_VAR_PADDR64_LE(tx_ce_wr_idx_addr), HTT_VAR_PADDR64_LE(rx_ind_ring_base_addr), HTT_VAR_PADDR64_LE(rx_ind_rd_idx_addr), HTT_VAR_PADDR64_LE(rx_ind_wr_idx_addr), HTT_VAR_PADDR64_LE(rx_ring2_base_addr), HTT_VAR_PADDR64_LE(rx_ring2_rd_idx_addr), HTT_VAR_PADDR64_LE(rx_ring2_wr_idx_addr));
  3828. #if HTT_PADDR64
  3829. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  3830. #else
  3831. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  3832. #endif
  3833. enum htt_wdi_ipa_op_code {
  3834. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  3835. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  3836. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  3837. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  3838. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  3839. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  3840. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  3841. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  3842. /* keep this last */
  3843. HTT_WDI_IPA_OPCODE_MAX
  3844. };
  3845. /**
  3846. * @brief HTT WDI_IPA Operation Request Message
  3847. *
  3848. * @details
  3849. * HTT WDI_IPA Operation Request message is sent by host
  3850. * to either suspend or resume WDI_IPA TX or RX path.
  3851. * |31 24|23 16|15 8|7 0|
  3852. * |----------------+----------------+----------------+----------------|
  3853. * | op_code | Rsvd | msg_type |
  3854. * |-------------------------------------------------------------------|
  3855. *
  3856. * Header fields:
  3857. * - MSG_TYPE
  3858. * Bits 7:0
  3859. * Purpose: Identifies this as WDI_IPA Operation Request message
  3860. * value: = 0x9
  3861. * - OP_CODE
  3862. * Bits 31:16
  3863. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  3864. * value: = enum htt_wdi_ipa_op_code
  3865. */
  3866. PREPACK struct htt_wdi_ipa_op_request_t
  3867. {
  3868. /* DWORD 0: flags and meta-data */
  3869. A_UINT32
  3870. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  3871. reserved: 8,
  3872. op_code: 16;
  3873. } POSTPACK;
  3874. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  3875. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  3876. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  3877. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  3878. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  3879. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  3880. do { \
  3881. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  3882. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  3883. } while (0)
  3884. /*
  3885. * @brief host -> target HTT_SRING_SETUP message
  3886. *
  3887. * @details
  3888. * After target is booted up, Host can send SRING setup message for
  3889. * each host facing LMAC SRING. Target setups up HW registers based
  3890. * on setup message and confirms back to Host if response_required is set.
  3891. * Host should wait for confirmation message before sending new SRING
  3892. * setup message
  3893. *
  3894. * The message would appear as follows:
  3895. * |31 24|23 20|19|18 16|15|14 8|7 0|
  3896. * |--------------- +-----------------+----------------+------------------|
  3897. * | ring_type | ring_id | pdev_id | msg_type |
  3898. * |----------------------------------------------------------------------|
  3899. * | ring_base_addr_lo |
  3900. * |----------------------------------------------------------------------|
  3901. * | ring_base_addr_hi |
  3902. * |----------------------------------------------------------------------|
  3903. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  3904. * |----------------------------------------------------------------------|
  3905. * | ring_head_offset32_remote_addr_lo |
  3906. * |----------------------------------------------------------------------|
  3907. * | ring_head_offset32_remote_addr_hi |
  3908. * |----------------------------------------------------------------------|
  3909. * | ring_tail_offset32_remote_addr_lo |
  3910. * |----------------------------------------------------------------------|
  3911. * | ring_tail_offset32_remote_addr_hi |
  3912. * |----------------------------------------------------------------------|
  3913. * | ring_msi_addr_lo |
  3914. * |----------------------------------------------------------------------|
  3915. * | ring_msi_addr_hi |
  3916. * |----------------------------------------------------------------------|
  3917. * | ring_msi_data |
  3918. * |----------------------------------------------------------------------|
  3919. * | intr_timer_th |IM| intr_batch_counter_th |
  3920. * |----------------------------------------------------------------------|
  3921. * | reserved |RR|PTCF| intr_low_threshold |
  3922. * |----------------------------------------------------------------------|
  3923. * Where
  3924. * IM = sw_intr_mode
  3925. * RR = response_required
  3926. * PTCF = prefetch_timer_cfg
  3927. *
  3928. * The message is interpreted as follows:
  3929. * dword0 - b'0:7 - msg_type: This will be set to
  3930. * HTT_H2T_MSG_TYPE_SRING_SETUP
  3931. * b'8:15 - pdev_id:
  3932. * 0 (for rings at SOC/UMAC level),
  3933. * 1/2/3 mac id (for rings at LMAC level)
  3934. * b'16:23 - ring_id: identify which ring is to setup,
  3935. * more details can be got from enum htt_srng_ring_id
  3936. * b'24:31 - ring_type: identify type of host rings,
  3937. * more details can be got from enum htt_srng_ring_type
  3938. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  3939. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  3940. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  3941. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  3942. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  3943. * SW_TO_HW_RING.
  3944. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  3945. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  3946. * Lower 32 bits of memory address of the remote variable
  3947. * storing the 4-byte word offset that identifies the head
  3948. * element within the ring.
  3949. * (The head offset variable has type A_UINT32.)
  3950. * Valid for HW_TO_SW and SW_TO_SW rings.
  3951. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  3952. * Upper 32 bits of memory address of the remote variable
  3953. * storing the 4-byte word offset that identifies the head
  3954. * element within the ring.
  3955. * (The head offset variable has type A_UINT32.)
  3956. * Valid for HW_TO_SW and SW_TO_SW rings.
  3957. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  3958. * Lower 32 bits of memory address of the remote variable
  3959. * storing the 4-byte word offset that identifies the tail
  3960. * element within the ring.
  3961. * (The tail offset variable has type A_UINT32.)
  3962. * Valid for HW_TO_SW and SW_TO_SW rings.
  3963. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  3964. * Upper 32 bits of memory address of the remote variable
  3965. * storing the 4-byte word offset that identifies the tail
  3966. * element within the ring.
  3967. * (The tail offset variable has type A_UINT32.)
  3968. * Valid for HW_TO_SW and SW_TO_SW rings.
  3969. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  3970. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3971. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  3972. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3973. * dword10 - b'0:31 - ring_msi_data: MSI data
  3974. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  3975. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3976. * dword11 - b'0:14 - intr_batch_counter_th:
  3977. * batch counter threshold is in units of 4-byte words.
  3978. * HW internally maintains and increments batch count.
  3979. * (see SRING spec for detail description).
  3980. * When batch count reaches threshold value, an interrupt
  3981. * is generated by HW.
  3982. * b'15 - sw_intr_mode:
  3983. * This configuration shall be static.
  3984. * Only programmed at power up.
  3985. * 0: generate pulse style sw interrupts
  3986. * 1: generate level style sw interrupts
  3987. * b'16:31 - intr_timer_th:
  3988. * The timer init value when timer is idle or is
  3989. * initialized to start downcounting.
  3990. * In 8us units (to cover a range of 0 to 524 ms)
  3991. * dword12 - b'0:15 - intr_low_threshold:
  3992. * Used only by Consumer ring to generate ring_sw_int_p.
  3993. * Ring entries low threshold water mark, that is used
  3994. * in combination with the interrupt timer as well as
  3995. * the the clearing of the level interrupt.
  3996. * b'16:18 - prefetch_timer_cfg:
  3997. * Used only by Consumer ring to set timer mode to
  3998. * support Application prefetch handling.
  3999. * The external tail offset/pointer will be updated
  4000. * at following intervals:
  4001. * 3'b000: (Prefetch feature disabled; used only for debug)
  4002. * 3'b001: 1 usec
  4003. * 3'b010: 4 usec
  4004. * 3'b011: 8 usec (default)
  4005. * 3'b100: 16 usec
  4006. * Others: Reserverd
  4007. * b'19 - response_required:
  4008. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4009. * b'20:31 - reserved: reserved for future use
  4010. */
  4011. PREPACK struct htt_sring_setup_t {
  4012. A_UINT32 msg_type: 8,
  4013. pdev_id: 8,
  4014. ring_id: 8,
  4015. ring_type: 8;
  4016. A_UINT32 ring_base_addr_lo;
  4017. A_UINT32 ring_base_addr_hi;
  4018. A_UINT32 ring_size: 16,
  4019. ring_entry_size: 8,
  4020. ring_misc_cfg_flag: 8;
  4021. A_UINT32 ring_head_offset32_remote_addr_lo;
  4022. A_UINT32 ring_head_offset32_remote_addr_hi;
  4023. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4024. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4025. A_UINT32 ring_msi_addr_lo;
  4026. A_UINT32 ring_msi_addr_hi;
  4027. A_UINT32 ring_msi_data;
  4028. A_UINT32 intr_batch_counter_th: 15,
  4029. sw_intr_mode: 1,
  4030. intr_timer_th: 16;
  4031. A_UINT32 intr_low_threshold: 16,
  4032. prefetch_timer_cfg: 3,
  4033. response_required: 1,
  4034. reserved1: 12;
  4035. } POSTPACK;
  4036. enum htt_srng_ring_type {
  4037. HTT_HW_TO_SW_RING = 0,
  4038. HTT_SW_TO_HW_RING,
  4039. HTT_SW_TO_SW_RING,
  4040. /* Insert new ring types above this line */
  4041. };
  4042. enum htt_srng_ring_id {
  4043. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4044. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4045. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4046. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4047. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4048. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4049. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4050. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4051. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4052. /* Add Other SRING which can't be directly configured by host software above this line */
  4053. };
  4054. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4055. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4056. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4057. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4058. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4059. HTT_SRING_SETUP_PDEV_ID_S)
  4060. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4061. do { \
  4062. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4063. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4064. } while (0)
  4065. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4066. #define HTT_SRING_SETUP_RING_ID_S 16
  4067. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4068. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4069. HTT_SRING_SETUP_RING_ID_S)
  4070. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4071. do { \
  4072. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4073. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4074. } while (0)
  4075. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4076. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4077. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4078. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4079. HTT_SRING_SETUP_RING_TYPE_S)
  4080. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4081. do { \
  4082. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4083. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4084. } while (0)
  4085. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4086. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4087. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4088. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4089. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4090. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4091. do { \
  4092. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4093. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4094. } while (0)
  4095. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4096. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4097. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4098. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4099. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4100. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4101. do { \
  4102. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4103. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4104. } while (0)
  4105. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4106. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4107. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4108. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4109. HTT_SRING_SETUP_RING_SIZE_S)
  4110. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4111. do { \
  4112. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4113. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4114. } while (0)
  4115. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4116. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4117. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4118. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4119. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4120. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4121. do { \
  4122. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4123. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4124. } while (0)
  4125. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4126. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4127. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4128. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4129. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4130. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4131. do { \
  4132. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4133. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4134. } while (0)
  4135. /* This control bit is applicable to only Producer, which updates Ring ID field
  4136. * of each descriptor before pushing into the ring.
  4137. * 0: updates ring_id(default)
  4138. * 1: ring_id updating disabled */
  4139. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4140. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4141. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4142. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4143. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4144. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4145. do { \
  4146. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4147. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4148. } while (0)
  4149. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4150. * of each descriptor before pushing into the ring.
  4151. * 0: updates Loopcnt(default)
  4152. * 1: Loopcnt updating disabled */
  4153. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4154. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4155. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4156. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4157. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4158. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4159. do { \
  4160. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4161. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4162. } while (0)
  4163. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4164. * into security_id port of GXI/AXI. */
  4165. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4166. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4167. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4168. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4169. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4170. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4171. do { \
  4172. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4173. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4174. } while (0)
  4175. /* During MSI write operation, SRNG drives value of this register bit into
  4176. * swap bit of GXI/AXI. */
  4177. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4178. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4179. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4180. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4181. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4182. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4183. do { \
  4184. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4185. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4186. } while (0)
  4187. /* During Pointer write operation, SRNG drives value of this register bit into
  4188. * swap bit of GXI/AXI. */
  4189. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4190. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4191. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4192. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4193. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4194. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4195. do { \
  4196. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4197. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4198. } while (0)
  4199. /* During any data or TLV write operation, SRNG drives value of this register
  4200. * bit into swap bit of GXI/AXI. */
  4201. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4202. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4203. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4204. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4205. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4206. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4207. do { \
  4208. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4209. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4210. } while (0)
  4211. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4212. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4213. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4214. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4215. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4216. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4217. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4218. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4219. do { \
  4220. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4221. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4222. } while (0)
  4223. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4224. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4225. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4226. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4227. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4228. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4229. do { \
  4230. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4231. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4232. } while (0)
  4233. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4234. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4235. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4236. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4237. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4238. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4239. do { \
  4240. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4241. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4242. } while (0)
  4243. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4244. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4245. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4246. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4247. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4248. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4249. do { \
  4250. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4251. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4252. } while (0)
  4253. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4254. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4255. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4256. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4257. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4258. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4259. do { \
  4260. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4261. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4262. } while (0)
  4263. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4264. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4265. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4266. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4267. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4268. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4269. do { \
  4270. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4271. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4272. } while (0)
  4273. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4274. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4275. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4276. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4277. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4278. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4279. do { \
  4280. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4281. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4282. } while (0)
  4283. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4284. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4285. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4286. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4287. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4288. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4289. do { \
  4290. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4291. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4292. } while (0)
  4293. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4294. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4295. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4296. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4297. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4298. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4299. do { \
  4300. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4301. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4302. } while (0)
  4303. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4304. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4305. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4306. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4307. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4308. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4309. do { \
  4310. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4311. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4312. } while (0)
  4313. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4314. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4315. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4316. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4317. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4318. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4319. do { \
  4320. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4321. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4322. } while (0)
  4323. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4324. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4325. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4326. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4327. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4328. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4329. do { \
  4330. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4331. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4332. } while (0)
  4333. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4334. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4335. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4336. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4337. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4338. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4339. do { \
  4340. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4341. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4342. } while (0)
  4343. /**
  4344. * @brief HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG Message
  4345. *
  4346. * @details
  4347. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4348. * configure RXDMA rings.
  4349. * The configuration is per ring based and includes both packet subtypes
  4350. * and PPDU/MPDU TLVs.
  4351. *
  4352. * The message would appear as follows:
  4353. *
  4354. * |31 27|26|25|24|23 16|15 8|7 0|
  4355. * |-----------------+----------------+----------------+---------------|
  4356. * | rsvd1 |OV|PS|SS| ring_id | pdev_id | msg_type |
  4357. * |-------------------------------------------------------------------|
  4358. * | rsvd2 | ring_buffer_size |
  4359. * |-------------------------------------------------------------------|
  4360. * | packet_type_enable_flags_0 |
  4361. * |-------------------------------------------------------------------|
  4362. * | packet_type_enable_flags_1 |
  4363. * |-------------------------------------------------------------------|
  4364. * | packet_type_enable_flags_2 |
  4365. * |-------------------------------------------------------------------|
  4366. * | packet_type_enable_flags_3 |
  4367. * |-------------------------------------------------------------------|
  4368. * | tlv_filter_in_flags |
  4369. * |-------------------------------------------------------------------|
  4370. * | rx_header_offset | rx_packet_offset |
  4371. * |-------------------------------------------------------------------|
  4372. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  4373. * |-------------------------------------------------------------------|
  4374. * | rx_msdu_start_offset | rx_msdu_end_offset |
  4375. * |-------------------------------------------------------------------|
  4376. * | rsvd3 | rx_attention_offset |
  4377. * |-------------------------------------------------------------------|
  4378. * Where:
  4379. * PS = pkt_swap
  4380. * SS = status_swap
  4381. * OV = rx_offsets_valid
  4382. * The message is interpreted as follows:
  4383. * dword0 - b'0:7 - msg_type: This will be set to
  4384. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4385. * b'8:15 - pdev_id:
  4386. * 0 (for rings at SOC/UMAC level),
  4387. * 1/2/3 mac id (for rings at LMAC level)
  4388. * b'16:23 - ring_id : Identify the ring to configure.
  4389. * More details can be got from enum htt_srng_ring_id
  4390. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  4391. * BUF_RING_CFG_0 defs within HW .h files,
  4392. * e.g. wmac_top_reg_seq_hwioreg.h
  4393. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  4394. * BUF_RING_CFG_0 defs within HW .h files,
  4395. * e.g. wmac_top_reg_seq_hwioreg.h
  4396. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  4397. * configuration fields are valid
  4398. * b'27:31 - rsvd1: reserved for future use
  4399. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4400. * in byte units.
  4401. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4402. * - b'16:31 - rsvd2: Reserved for future use
  4403. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4404. * Enable MGMT packet from 0b0000 to 0b1001
  4405. * bits from low to high: FP, MD, MO - 3 bits
  4406. * FP: Filter_Pass
  4407. * MD: Monitor_Direct
  4408. * MO: Monitor_Other
  4409. * 10 mgmt subtypes * 3 bits -> 30 bits
  4410. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4411. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4412. * Enable MGMT packet from 0b1010 to 0b1111
  4413. * bits from low to high: FP, MD, MO - 3 bits
  4414. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4415. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4416. * Enable CTRL packet from 0b0000 to 0b1001
  4417. * bits from low to high: FP, MD, MO - 3 bits
  4418. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4419. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4420. * Enable CTRL packet from 0b1010 to 0b1111,
  4421. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4422. * bits from low to high: FP, MD, MO - 3 bits
  4423. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4424. * dword6 - b'0:31 - tlv_filter_in_flags:
  4425. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4426. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4427. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  4428. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4429. * A value of 0 will be considered as ignore this config.
  4430. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4431. * e.g. wmac_top_reg_seq_hwioreg.h
  4432. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  4433. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4434. * A value of 0 will be considered as ignore this config.
  4435. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4436. * e.g. wmac_top_reg_seq_hwioreg.h
  4437. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  4438. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4439. * A value of 0 will be considered as ignore this config.
  4440. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4441. * e.g. wmac_top_reg_seq_hwioreg.h
  4442. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  4443. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4444. * A value of 0 will be considered as ignore this config.
  4445. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4446. * e.g. wmac_top_reg_seq_hwioreg.h
  4447. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  4448. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4449. * A value of 0 will be considered as ignore this config.
  4450. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4451. * e.g. wmac_top_reg_seq_hwioreg.h
  4452. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  4453. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4454. * A value of 0 will be considered as ignore this config.
  4455. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4456. * e.g. wmac_top_reg_seq_hwioreg.h
  4457. * dword10 - b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  4458. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4459. * A value of 0 will be considered as ignore this config.
  4460. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  4461. * e.g. wmac_top_reg_seq_hwioreg.h
  4462. * - b'16-31 - rsvd3 for future use
  4463. */
  4464. PREPACK struct htt_rx_ring_selection_cfg_t {
  4465. A_UINT32 msg_type: 8,
  4466. pdev_id: 8,
  4467. ring_id: 8,
  4468. status_swap: 1,
  4469. pkt_swap: 1,
  4470. rx_offsets_valid: 1,
  4471. rsvd1: 5;
  4472. A_UINT32 ring_buffer_size: 16,
  4473. rsvd2: 16;
  4474. A_UINT32 packet_type_enable_flags_0;
  4475. A_UINT32 packet_type_enable_flags_1;
  4476. A_UINT32 packet_type_enable_flags_2;
  4477. A_UINT32 packet_type_enable_flags_3;
  4478. A_UINT32 tlv_filter_in_flags;
  4479. A_UINT32 rx_packet_offset: 16,
  4480. rx_header_offset: 16;
  4481. A_UINT32 rx_mpdu_end_offset: 16,
  4482. rx_mpdu_start_offset: 16;
  4483. A_UINT32 rx_msdu_end_offset: 16,
  4484. rx_msdu_start_offset: 16;
  4485. A_UINT32 rx_attn_offset: 16,
  4486. rsvd3: 16;
  4487. } POSTPACK;
  4488. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4489. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4490. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4491. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4492. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4493. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4494. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4495. do { \
  4496. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4497. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4498. } while (0)
  4499. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4500. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4501. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4502. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4503. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4504. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4505. do { \
  4506. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4507. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4508. } while (0)
  4509. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4510. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4511. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4512. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4513. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4514. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4515. do { \
  4516. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  4517. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4518. } while (0)
  4519. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4520. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4521. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4522. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4523. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4524. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4525. do { \
  4526. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  4527. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4528. } while (0)
  4529. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  4530. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  4531. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  4532. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  4533. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  4534. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  4535. do { \
  4536. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  4537. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  4538. } while (0)
  4539. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4540. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4541. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4542. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4543. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4544. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4545. do { \
  4546. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  4547. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4548. } while (0)
  4549. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4550. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4551. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4552. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4553. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4554. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4555. do { \
  4556. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  4557. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4558. } while (0)
  4559. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4560. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4561. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4562. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4563. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4564. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4565. do { \
  4566. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  4567. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4568. } while (0)
  4569. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4570. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4571. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4572. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4573. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4574. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4575. do { \
  4576. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  4577. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4578. } while (0)
  4579. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4580. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4581. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4582. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4583. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4584. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4585. do { \
  4586. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  4587. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4588. } while (0)
  4589. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4590. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4591. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4592. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4593. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4594. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4595. do { \
  4596. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4597. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4598. } while (0)
  4599. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  4600. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  4601. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  4602. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  4603. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  4604. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  4605. do { \
  4606. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  4607. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  4608. } while (0)
  4609. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  4610. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  4611. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  4612. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  4613. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  4614. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  4615. do { \
  4616. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  4617. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  4618. } while (0)
  4619. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  4620. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  4621. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  4622. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  4623. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  4624. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  4625. do { \
  4626. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  4627. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  4628. } while (0)
  4629. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  4630. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  4631. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  4632. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  4633. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  4634. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  4635. do { \
  4636. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  4637. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  4638. } while (0)
  4639. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  4640. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  4641. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  4642. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  4643. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  4644. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  4645. do { \
  4646. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  4647. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  4648. } while (0)
  4649. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  4650. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  4651. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  4652. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  4653. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  4654. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  4655. do { \
  4656. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  4657. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  4658. } while (0)
  4659. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  4660. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  4661. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  4662. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  4663. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  4664. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  4665. do { \
  4666. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  4667. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  4668. } while (0)
  4669. /*
  4670. * Subtype based MGMT frames enable bits.
  4671. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4672. */
  4673. /* association request */
  4674. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  4675. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4676. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  4677. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4678. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  4679. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4680. /* association response */
  4681. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  4682. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4683. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  4684. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4685. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  4686. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4687. /* Reassociation request */
  4688. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  4689. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  4690. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  4691. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  4692. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  4693. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  4694. /* Reassociation response */
  4695. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  4696. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  4697. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  4698. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  4699. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  4700. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  4701. /* Probe request */
  4702. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  4703. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  4704. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  4705. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  4706. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  4707. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  4708. /* Probe response */
  4709. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  4710. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  4711. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  4712. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  4713. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  4714. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  4715. /* Timing Advertisement */
  4716. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  4717. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  4718. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  4719. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  4720. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  4721. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  4722. /* Reserved */
  4723. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  4724. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  4725. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  4726. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  4727. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  4728. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  4729. /* Beacon */
  4730. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  4731. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  4732. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  4733. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  4734. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  4735. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  4736. /* ATIM */
  4737. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  4738. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  4739. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  4740. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  4741. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  4742. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  4743. /* Disassociation */
  4744. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  4745. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  4746. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  4747. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  4748. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  4749. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  4750. /* Authentication */
  4751. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  4752. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  4753. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  4754. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  4755. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  4756. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  4757. /* Deauthentication */
  4758. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  4759. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  4760. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  4761. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  4762. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  4763. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  4764. /* Action */
  4765. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  4766. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  4767. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  4768. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  4769. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  4770. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  4771. /* Action No Ack */
  4772. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  4773. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  4774. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  4775. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  4776. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  4777. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  4778. /* Reserved */
  4779. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  4780. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  4781. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  4782. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  4783. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  4784. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  4785. /*
  4786. * Subtype based CTRL frames enable bits.
  4787. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  4788. */
  4789. /* Reserved */
  4790. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  4791. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  4792. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  4793. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  4794. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  4795. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  4796. /* Reserved */
  4797. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  4798. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  4799. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  4800. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  4801. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  4802. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  4803. /* Reserved */
  4804. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  4805. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  4806. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  4807. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  4808. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  4809. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  4810. /* Reserved */
  4811. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  4812. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  4813. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  4814. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  4815. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  4816. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  4817. /* Reserved */
  4818. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  4819. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  4820. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  4821. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  4822. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  4823. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  4824. /* Reserved */
  4825. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  4826. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  4827. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  4828. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  4829. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  4830. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  4831. /* Reserved */
  4832. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  4833. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  4834. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  4835. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  4836. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  4837. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  4838. /* Control Wrapper */
  4839. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  4840. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  4841. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  4842. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  4843. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  4844. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  4845. /* Block Ack Request */
  4846. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  4847. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  4848. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  4849. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  4850. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  4851. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  4852. /* Block Ack*/
  4853. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  4854. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  4855. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  4856. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  4857. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  4858. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  4859. /* PS-POLL */
  4860. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  4861. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  4862. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  4863. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  4864. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  4865. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  4866. /* RTS */
  4867. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  4868. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  4869. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  4870. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  4871. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  4872. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  4873. /* CTS */
  4874. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  4875. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  4876. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  4877. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  4878. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  4879. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  4880. /* ACK */
  4881. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  4882. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  4883. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  4884. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  4885. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  4886. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  4887. /* CF-END */
  4888. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  4889. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  4890. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  4891. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  4892. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  4893. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  4894. /* CF-END + CF-ACK */
  4895. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  4896. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  4897. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  4898. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  4899. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  4900. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  4901. /* Multicast data */
  4902. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  4903. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  4904. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  4905. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  4906. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  4907. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  4908. /* Unicast data */
  4909. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  4910. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  4911. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  4912. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  4913. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  4914. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  4915. /* NULL data */
  4916. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  4917. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  4918. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  4919. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  4920. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  4921. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  4922. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  4923. do { \
  4924. HTT_CHECK_SET_VAL(httsym, value); \
  4925. (word) |= (value) << httsym##_S; \
  4926. } while (0)
  4927. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  4928. (((word) & httsym##_M) >> httsym##_S)
  4929. #define htt_rx_ring_pkt_enable_subtype_set( \
  4930. word, flag, mode, type, subtype, val) \
  4931. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  4932. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  4933. #define htt_rx_ring_pkt_enable_subtype_get( \
  4934. word, flag, mode, type, subtype) \
  4935. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  4936. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  4937. /* Definition to filter in TLVs */
  4938. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  4939. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  4940. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  4941. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  4942. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  4943. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  4944. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  4945. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  4946. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  4947. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  4948. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  4949. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  4950. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  4951. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  4952. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  4953. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  4954. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  4955. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  4956. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  4957. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  4958. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  4959. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  4960. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  4961. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  4962. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  4963. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  4964. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  4965. do { \
  4966. HTT_CHECK_SET_VAL(httsym, enable); \
  4967. (word) |= (enable) << httsym##_S; \
  4968. } while (0)
  4969. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  4970. (((word) & httsym##_M) >> httsym##_S)
  4971. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  4972. HTT_RX_RING_TLV_ENABLE_SET( \
  4973. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  4974. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  4975. HTT_RX_RING_TLV_ENABLE_GET( \
  4976. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  4977. /**
  4978. * @brief HTT_H2T_MSG_TYPE_RFS_CONFIG
  4979. * host --> target Receive Flow Steering configuration message definition.
  4980. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  4981. * The reason for this is we want RFS to be configured and ready before MAC
  4982. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  4983. *
  4984. * |31 24|23 16|15 9|8|7 0|
  4985. * |----------------+----------------+----------------+----------------|
  4986. * | reserved |E| msg type |
  4987. * |-------------------------------------------------------------------|
  4988. * Where E = RFS enable flag
  4989. *
  4990. * The RFS_CONFIG message consists of a single 4-byte word.
  4991. *
  4992. * Header fields:
  4993. * - MSG_TYPE
  4994. * Bits 7:0
  4995. * Purpose: identifies this as a RFS config msg
  4996. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  4997. * - RFS_CONFIG
  4998. * Bit 8
  4999. * Purpose: Tells target whether to enable (1) or disable (0)
  5000. * flow steering feature when sending rx indication messages to host
  5001. */
  5002. #define HTT_H2T_RFS_CONFIG_M 0x100
  5003. #define HTT_H2T_RFS_CONFIG_S 8
  5004. #define HTT_RX_RFS_CONFIG_GET(_var) \
  5005. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  5006. HTT_H2T_RFS_CONFIG_S)
  5007. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  5008. do { \
  5009. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  5010. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  5011. } while (0)
  5012. #define HTT_RFS_CFG_REQ_BYTES 4
  5013. /**
  5014. * @brief host -> target FW extended statistics retrieve
  5015. *
  5016. * @details
  5017. * The following field definitions describe the format of the HTT host
  5018. * to target FW extended stats retrieve message.
  5019. * The message specifies the type of stats the host wants to retrieve.
  5020. *
  5021. * |31 24|23 16|15 8|7 0|
  5022. * |-----------------------------------------------------------|
  5023. * | reserved | stats type | pdev_mask | msg type |
  5024. * |-----------------------------------------------------------|
  5025. * | config param [0] |
  5026. * |-----------------------------------------------------------|
  5027. * | config param [1] |
  5028. * |-----------------------------------------------------------|
  5029. * | config param [2] |
  5030. * |-----------------------------------------------------------|
  5031. * | config param [3] |
  5032. * |-----------------------------------------------------------|
  5033. * | reserved |
  5034. * |-----------------------------------------------------------|
  5035. * | cookie LSBs |
  5036. * |-----------------------------------------------------------|
  5037. * | cookie MSBs |
  5038. * |-----------------------------------------------------------|
  5039. * Header fields:
  5040. * - MSG_TYPE
  5041. * Bits 7:0
  5042. * Purpose: identifies this is a extended stats upload request message
  5043. * Value: 0x10
  5044. * - PDEV_MASK
  5045. * Bits 8:15
  5046. * Purpose: identifies the mask of PDEVs to retrieve stats from
  5047. * Value: This is a overloaded field, refer to usage and interpretation of
  5048. * PDEV in interface document.
  5049. * Bit 8 : Reserved for SOC stats
  5050. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5051. * Indicates MACID_MASK in DBS
  5052. * - STATS_TYPE
  5053. * Bits 23:16
  5054. * Purpose: identifies which FW statistics to upload
  5055. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  5056. * - Reserved
  5057. * Bits 31:24
  5058. * - CONFIG_PARAM [0]
  5059. * Bits 31:0
  5060. * Purpose: give an opaque configuration value to the specified stats type
  5061. * Value: stats-type specific configuration value
  5062. * Refer to htt_stats.h for interpretation for each stats sub_type
  5063. * - CONFIG_PARAM [1]
  5064. * Bits 31:0
  5065. * Purpose: give an opaque configuration value to the specified stats type
  5066. * Value: stats-type specific configuration value
  5067. * Refer to htt_stats.h for interpretation for each stats sub_type
  5068. * - CONFIG_PARAM [2]
  5069. * Bits 31:0
  5070. * Purpose: give an opaque configuration value to the specified stats type
  5071. * Value: stats-type specific configuration value
  5072. * Refer to htt_stats.h for interpretation for each stats sub_type
  5073. * - CONFIG_PARAM [3]
  5074. * Bits 31:0
  5075. * Purpose: give an opaque configuration value to the specified stats type
  5076. * Value: stats-type specific configuration value
  5077. * Refer to htt_stats.h for interpretation for each stats sub_type
  5078. * - Reserved [31:0] for future use.
  5079. * - COOKIE_LSBS
  5080. * Bits 31:0
  5081. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5082. * message with its preceding host->target stats request message.
  5083. * Value: LSBs of the opaque cookie specified by the host-side requestor
  5084. * - COOKIE_MSBS
  5085. * Bits 31:0
  5086. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5087. * message with its preceding host->target stats request message.
  5088. * Value: MSBs of the opaque cookie specified by the host-side requestor
  5089. */
  5090. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  5091. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  5092. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  5093. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  5094. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  5095. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  5096. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  5097. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  5098. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  5099. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  5100. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  5101. do { \
  5102. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  5103. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  5104. } while (0)
  5105. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  5106. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  5107. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  5108. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  5109. do { \
  5110. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  5111. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  5112. } while (0)
  5113. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  5114. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  5115. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  5116. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  5117. do { \
  5118. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  5119. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  5120. } while (0)
  5121. /**
  5122. * @brief host -> target FW PPDU_STATS request message
  5123. *
  5124. * @details
  5125. * The following field definitions describe the format of the HTT host
  5126. * to target FW for PPDU_STATS_CFG msg.
  5127. * The message allows the host to configure the PPDU_STATS_IND messages
  5128. * produced by the target.
  5129. *
  5130. * |31 24|23 16|15 8|7 0|
  5131. * |-----------------------------------------------------------|
  5132. * | REQ bit mask | pdev_mask | msg type |
  5133. * |-----------------------------------------------------------|
  5134. * Header fields:
  5135. * - MSG_TYPE
  5136. * Bits 7:0
  5137. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  5138. * Value: 0x11
  5139. * - PDEV_MASK
  5140. * Bits 8:15
  5141. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  5142. * Value: This is a overloaded field, refer to usage and interpretation of
  5143. * PDEV in interface document.
  5144. * Bit 8 : Reserved for SOC stats
  5145. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5146. * Indicates MACID_MASK in DBS
  5147. * - REQ_TLV_BIT_MASK
  5148. * Bits 16:31
  5149. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  5150. * needs to be included in the target's PPDU_STATS_IND messages.
  5151. * Value: refer htt_ppdu_stats_tlv_tag_t
  5152. *
  5153. */
  5154. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  5155. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  5156. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  5157. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  5158. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  5159. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  5160. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  5161. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  5162. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  5163. do { \
  5164. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  5165. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  5166. } while (0)
  5167. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  5168. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  5169. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  5170. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  5171. do { \
  5172. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  5173. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  5174. } while (0)
  5175. /*=== target -> host messages ===============================================*/
  5176. enum htt_t2h_msg_type {
  5177. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  5178. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  5179. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  5180. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  5181. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  5182. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  5183. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  5184. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  5185. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  5186. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  5187. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  5188. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  5189. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  5190. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  5191. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  5192. /* only used for HL, add HTT MSG for HTT CREDIT update */
  5193. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  5194. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  5195. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  5196. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  5197. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  5198. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  5199. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  5200. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  5201. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  5202. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  5203. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  5204. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  5205. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  5206. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  5207. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  5208. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  5209. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  5210. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  5211. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  5212. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  5213. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  5214. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  5215. HTT_T2H_MSG_TYPE_TEST,
  5216. /* keep this last */
  5217. HTT_T2H_NUM_MSGS
  5218. };
  5219. /*
  5220. * HTT target to host message type -
  5221. * stored in bits 7:0 of the first word of the message
  5222. */
  5223. #define HTT_T2H_MSG_TYPE_M 0xff
  5224. #define HTT_T2H_MSG_TYPE_S 0
  5225. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  5226. do { \
  5227. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  5228. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  5229. } while (0)
  5230. #define HTT_T2H_MSG_TYPE_GET(word) \
  5231. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  5232. /**
  5233. * @brief target -> host version number confirmation message definition
  5234. *
  5235. * |31 24|23 16|15 8|7 0|
  5236. * |----------------+----------------+----------------+----------------|
  5237. * | reserved | major number | minor number | msg type |
  5238. * |-------------------------------------------------------------------|
  5239. * : option request TLV (optional) |
  5240. * :...................................................................:
  5241. *
  5242. * The VER_CONF message may consist of a single 4-byte word, or may be
  5243. * extended with TLVs that specify HTT options selected by the target.
  5244. * The following option TLVs may be appended to the VER_CONF message:
  5245. * - LL_BUS_ADDR_SIZE
  5246. * - HL_SUPPRESS_TX_COMPL_IND
  5247. * - MAX_TX_QUEUE_GROUPS
  5248. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  5249. * may be appended to the VER_CONF message (but only one TLV of each type).
  5250. *
  5251. * Header fields:
  5252. * - MSG_TYPE
  5253. * Bits 7:0
  5254. * Purpose: identifies this as a version number confirmation message
  5255. * Value: 0x0
  5256. * - VER_MINOR
  5257. * Bits 15:8
  5258. * Purpose: Specify the minor number of the HTT message library version
  5259. * in use by the target firmware.
  5260. * The minor number specifies the specific revision within a range
  5261. * of fundamentally compatible HTT message definition revisions.
  5262. * Compatible revisions involve adding new messages or perhaps
  5263. * adding new fields to existing messages, in a backwards-compatible
  5264. * manner.
  5265. * Incompatible revisions involve changing the message type values,
  5266. * or redefining existing messages.
  5267. * Value: minor number
  5268. * - VER_MAJOR
  5269. * Bits 15:8
  5270. * Purpose: Specify the major number of the HTT message library version
  5271. * in use by the target firmware.
  5272. * The major number specifies the family of minor revisions that are
  5273. * fundamentally compatible with each other, but not with prior or
  5274. * later families.
  5275. * Value: major number
  5276. */
  5277. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  5278. #define HTT_VER_CONF_MINOR_S 8
  5279. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  5280. #define HTT_VER_CONF_MAJOR_S 16
  5281. #define HTT_VER_CONF_MINOR_SET(word, value) \
  5282. do { \
  5283. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  5284. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  5285. } while (0)
  5286. #define HTT_VER_CONF_MINOR_GET(word) \
  5287. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  5288. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  5289. do { \
  5290. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  5291. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  5292. } while (0)
  5293. #define HTT_VER_CONF_MAJOR_GET(word) \
  5294. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  5295. #define HTT_VER_CONF_BYTES 4
  5296. /**
  5297. * @brief - target -> host HTT Rx In order indication message
  5298. *
  5299. * @details
  5300. *
  5301. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  5302. * |----------------+-------------------+---------------------+---------------|
  5303. * | peer ID | P| F| O| ext TID | msg type |
  5304. * |--------------------------------------------------------------------------|
  5305. * | MSDU count | Reserved | vdev id |
  5306. * |--------------------------------------------------------------------------|
  5307. * | MSDU 0 bus address (bits 31:0) |
  5308. #if HTT_PADDR64
  5309. * | MSDU 0 bus address (bits 63:32) |
  5310. #endif
  5311. * |--------------------------------------------------------------------------|
  5312. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  5313. * |--------------------------------------------------------------------------|
  5314. * | MSDU 1 bus address (bits 31:0) |
  5315. #if HTT_PADDR64
  5316. * | MSDU 1 bus address (bits 63:32) |
  5317. #endif
  5318. * |--------------------------------------------------------------------------|
  5319. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  5320. * |--------------------------------------------------------------------------|
  5321. */
  5322. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  5323. *
  5324. * @details
  5325. * bits
  5326. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  5327. * |-----+----+-------+--------+--------+---------+---------+-----------|
  5328. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  5329. * | | frag | | | | fail |chksum fail|
  5330. * |-----+----+-------+--------+--------+---------+---------+-----------|
  5331. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  5332. */
  5333. struct htt_rx_in_ord_paddr_ind_hdr_t
  5334. {
  5335. A_UINT32 /* word 0 */
  5336. msg_type: 8,
  5337. ext_tid: 5,
  5338. offload: 1,
  5339. frag: 1,
  5340. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  5341. peer_id: 16;
  5342. A_UINT32 /* word 1 */
  5343. vap_id: 8,
  5344. reserved_1: 8,
  5345. msdu_cnt: 16;
  5346. };
  5347. struct htt_rx_in_ord_paddr_ind_msdu32_t
  5348. {
  5349. A_UINT32 dma_addr;
  5350. A_UINT32
  5351. length: 16,
  5352. fw_desc: 8,
  5353. msdu_info:8;
  5354. };
  5355. struct htt_rx_in_ord_paddr_ind_msdu64_t
  5356. {
  5357. A_UINT32 dma_addr_lo;
  5358. A_UINT32 dma_addr_hi;
  5359. A_UINT32
  5360. length: 16,
  5361. fw_desc: 8,
  5362. msdu_info:8;
  5363. };
  5364. #if HTT_PADDR64
  5365. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  5366. #else
  5367. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  5368. #endif
  5369. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  5370. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  5371. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  5372. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  5373. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  5374. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  5375. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  5376. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  5377. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  5378. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  5379. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  5380. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  5381. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  5382. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  5383. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  5384. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  5385. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  5386. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  5387. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  5388. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  5389. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  5390. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  5391. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  5392. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  5393. /* for systems using 64-bit format for bus addresses */
  5394. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  5395. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  5396. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  5397. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  5398. /* for systems using 32-bit format for bus addresses */
  5399. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  5400. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  5401. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  5402. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  5403. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  5404. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  5405. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  5406. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  5407. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  5408. do { \
  5409. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  5410. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  5411. } while (0)
  5412. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  5413. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  5414. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  5415. do { \
  5416. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  5417. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  5418. } while (0)
  5419. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  5420. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  5421. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  5422. do { \
  5423. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  5424. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  5425. } while (0)
  5426. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  5427. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  5428. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  5429. do { \
  5430. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  5431. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  5432. } while (0)
  5433. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  5434. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  5435. /* for systems using 64-bit format for bus addresses */
  5436. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  5437. do { \
  5438. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  5439. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  5440. } while (0)
  5441. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  5442. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  5443. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  5444. do { \
  5445. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  5446. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  5447. } while (0)
  5448. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  5449. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  5450. /* for systems using 32-bit format for bus addresses */
  5451. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  5452. do { \
  5453. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  5454. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  5455. } while (0)
  5456. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  5457. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  5458. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  5459. do { \
  5460. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  5461. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  5462. } while (0)
  5463. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  5464. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  5465. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  5466. do { \
  5467. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  5468. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  5469. } while (0)
  5470. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  5471. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  5472. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  5473. do { \
  5474. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  5475. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  5476. } while (0)
  5477. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  5478. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  5479. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  5480. do { \
  5481. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  5482. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  5483. } while (0)
  5484. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  5485. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  5486. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  5487. do { \
  5488. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  5489. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  5490. } while (0)
  5491. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  5492. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  5493. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  5494. do { \
  5495. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  5496. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  5497. } while (0)
  5498. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  5499. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  5500. /* definitions used within target -> host rx indication message */
  5501. PREPACK struct htt_rx_ind_hdr_prefix_t
  5502. {
  5503. A_UINT32 /* word 0 */
  5504. msg_type: 8,
  5505. ext_tid: 5,
  5506. release_valid: 1,
  5507. flush_valid: 1,
  5508. reserved0: 1,
  5509. peer_id: 16;
  5510. A_UINT32 /* word 1 */
  5511. flush_start_seq_num: 6,
  5512. flush_end_seq_num: 6,
  5513. release_start_seq_num: 6,
  5514. release_end_seq_num: 6,
  5515. num_mpdu_ranges: 8;
  5516. } POSTPACK;
  5517. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  5518. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  5519. #define HTT_TGT_RSSI_INVALID 0x80
  5520. PREPACK struct htt_rx_ppdu_desc_t
  5521. {
  5522. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  5523. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  5524. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  5525. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  5526. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  5527. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  5528. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  5529. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  5530. A_UINT32 /* word 0 */
  5531. rssi_cmb: 8,
  5532. timestamp_submicrosec: 8,
  5533. phy_err_code: 8,
  5534. phy_err: 1,
  5535. legacy_rate: 4,
  5536. legacy_rate_sel: 1,
  5537. end_valid: 1,
  5538. start_valid: 1;
  5539. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  5540. union {
  5541. A_UINT32 /* word 1 */
  5542. rssi0_pri20: 8,
  5543. rssi0_ext20: 8,
  5544. rssi0_ext40: 8,
  5545. rssi0_ext80: 8;
  5546. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  5547. } u0;
  5548. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  5549. union {
  5550. A_UINT32 /* word 2 */
  5551. rssi1_pri20: 8,
  5552. rssi1_ext20: 8,
  5553. rssi1_ext40: 8,
  5554. rssi1_ext80: 8;
  5555. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  5556. } u1;
  5557. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  5558. union {
  5559. A_UINT32 /* word 3 */
  5560. rssi2_pri20: 8,
  5561. rssi2_ext20: 8,
  5562. rssi2_ext40: 8,
  5563. rssi2_ext80: 8;
  5564. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  5565. } u2;
  5566. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  5567. union {
  5568. A_UINT32 /* word 4 */
  5569. rssi3_pri20: 8,
  5570. rssi3_ext20: 8,
  5571. rssi3_ext40: 8,
  5572. rssi3_ext80: 8;
  5573. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  5574. } u3;
  5575. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  5576. A_UINT32 tsf32; /* word 5 */
  5577. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  5578. A_UINT32 timestamp_microsec; /* word 6 */
  5579. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  5580. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  5581. A_UINT32 /* word 7 */
  5582. vht_sig_a1: 24,
  5583. preamble_type: 8;
  5584. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  5585. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  5586. A_UINT32 /* word 8 */
  5587. vht_sig_a2: 24,
  5588. /* sa_ant_matrix
  5589. * For cases where a single rx chain has options to be connected to
  5590. * different rx antennas, show which rx antennas were in use during
  5591. * receipt of a given PPDU.
  5592. * This sa_ant_matrix provides a bitmask of the antennas used while
  5593. * receiving this frame.
  5594. */
  5595. sa_ant_matrix: 8;
  5596. } POSTPACK;
  5597. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  5598. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  5599. PREPACK struct htt_rx_ind_hdr_suffix_t
  5600. {
  5601. A_UINT32 /* word 0 */
  5602. fw_rx_desc_bytes: 16,
  5603. reserved0: 16;
  5604. } POSTPACK;
  5605. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  5606. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  5607. PREPACK struct htt_rx_ind_hdr_t
  5608. {
  5609. struct htt_rx_ind_hdr_prefix_t prefix;
  5610. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  5611. struct htt_rx_ind_hdr_suffix_t suffix;
  5612. } POSTPACK;
  5613. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  5614. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  5615. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  5616. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  5617. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  5618. /*
  5619. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  5620. * the offset into the HTT rx indication message at which the
  5621. * FW rx PPDU descriptor resides
  5622. */
  5623. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  5624. /*
  5625. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  5626. * the offset into the HTT rx indication message at which the
  5627. * header suffix (FW rx MSDU byte count) resides
  5628. */
  5629. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  5630. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  5631. /*
  5632. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  5633. * the offset into the HTT rx indication message at which the per-MSDU
  5634. * information starts
  5635. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  5636. * per-MSDU information portion of the message. The per-MSDU info itself
  5637. * starts at byte 12.
  5638. */
  5639. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  5640. /**
  5641. * @brief target -> host rx indication message definition
  5642. *
  5643. * @details
  5644. * The following field definitions describe the format of the rx indication
  5645. * message sent from the target to the host.
  5646. * The message consists of three major sections:
  5647. * 1. a fixed-length header
  5648. * 2. a variable-length list of firmware rx MSDU descriptors
  5649. * 3. one or more 4-octet MPDU range information elements
  5650. * The fixed length header itself has two sub-sections
  5651. * 1. the message meta-information, including identification of the
  5652. * sender and type of the received data, and a 4-octet flush/release IE
  5653. * 2. the firmware rx PPDU descriptor
  5654. *
  5655. * The format of the message is depicted below.
  5656. * in this depiction, the following abbreviations are used for information
  5657. * elements within the message:
  5658. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  5659. * elements associated with the PPDU start are valid.
  5660. * Specifically, the following fields are valid only if SV is set:
  5661. * RSSI (all variants), L, legacy rate, preamble type, service,
  5662. * VHT-SIG-A
  5663. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  5664. * elements associated with the PPDU end are valid.
  5665. * Specifically, the following fields are valid only if EV is set:
  5666. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  5667. * - L - Legacy rate selector - if legacy rates are used, this flag
  5668. * indicates whether the rate is from a CCK (L == 1) or OFDM
  5669. * (L == 0) PHY.
  5670. * - P - PHY error flag - boolean indication of whether the rx frame had
  5671. * a PHY error
  5672. *
  5673. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  5674. * |----------------+-------------------+---------------------+---------------|
  5675. * | peer ID | |RV|FV| ext TID | msg type |
  5676. * |--------------------------------------------------------------------------|
  5677. * | num | release | release | flush | flush |
  5678. * | MPDU | end | start | end | start |
  5679. * | ranges | seq num | seq num | seq num | seq num |
  5680. * |==========================================================================|
  5681. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  5682. * |V|V| | rate | | | timestamp | RSSI |
  5683. * |--------------------------------------------------------------------------|
  5684. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  5685. * |--------------------------------------------------------------------------|
  5686. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  5687. * |--------------------------------------------------------------------------|
  5688. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  5689. * |--------------------------------------------------------------------------|
  5690. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  5691. * |--------------------------------------------------------------------------|
  5692. * | TSF LSBs |
  5693. * |--------------------------------------------------------------------------|
  5694. * | microsec timestamp |
  5695. * |--------------------------------------------------------------------------|
  5696. * | preamble type | HT-SIG / VHT-SIG-A1 |
  5697. * |--------------------------------------------------------------------------|
  5698. * | service | HT-SIG / VHT-SIG-A2 |
  5699. * |==========================================================================|
  5700. * | reserved | FW rx desc bytes |
  5701. * |--------------------------------------------------------------------------|
  5702. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  5703. * | desc B3 | desc B2 | desc B1 | desc B0 |
  5704. * |--------------------------------------------------------------------------|
  5705. * : : :
  5706. * |--------------------------------------------------------------------------|
  5707. * | alignment | MSDU Rx |
  5708. * | padding | desc Bn |
  5709. * |--------------------------------------------------------------------------|
  5710. * | reserved | MPDU range status | MPDU count |
  5711. * |--------------------------------------------------------------------------|
  5712. * : reserved : MPDU range status : MPDU count :
  5713. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  5714. *
  5715. * Header fields:
  5716. * - MSG_TYPE
  5717. * Bits 7:0
  5718. * Purpose: identifies this as an rx indication message
  5719. * Value: 0x1
  5720. * - EXT_TID
  5721. * Bits 12:8
  5722. * Purpose: identify the traffic ID of the rx data, including
  5723. * special "extended" TID values for multicast, broadcast, and
  5724. * non-QoS data frames
  5725. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  5726. * - FLUSH_VALID (FV)
  5727. * Bit 13
  5728. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  5729. * is valid
  5730. * Value:
  5731. * 1 -> flush IE is valid and needs to be processed
  5732. * 0 -> flush IE is not valid and should be ignored
  5733. * - REL_VALID (RV)
  5734. * Bit 13
  5735. * Purpose: indicate whether the release IE (start/end sequence numbers)
  5736. * is valid
  5737. * Value:
  5738. * 1 -> release IE is valid and needs to be processed
  5739. * 0 -> release IE is not valid and should be ignored
  5740. * - PEER_ID
  5741. * Bits 31:16
  5742. * Purpose: Identify, by ID, which peer sent the rx data
  5743. * Value: ID of the peer who sent the rx data
  5744. * - FLUSH_SEQ_NUM_START
  5745. * Bits 5:0
  5746. * Purpose: Indicate the start of a series of MPDUs to flush
  5747. * Not all MPDUs within this series are necessarily valid - the host
  5748. * must check each sequence number within this range to see if the
  5749. * corresponding MPDU is actually present.
  5750. * This field is only valid if the FV bit is set.
  5751. * Value:
  5752. * The sequence number for the first MPDUs to check to flush.
  5753. * The sequence number is masked by 0x3f.
  5754. * - FLUSH_SEQ_NUM_END
  5755. * Bits 11:6
  5756. * Purpose: Indicate the end of a series of MPDUs to flush
  5757. * Value:
  5758. * The sequence number one larger than the sequence number of the
  5759. * last MPDU to check to flush.
  5760. * The sequence number is masked by 0x3f.
  5761. * Not all MPDUs within this series are necessarily valid - the host
  5762. * must check each sequence number within this range to see if the
  5763. * corresponding MPDU is actually present.
  5764. * This field is only valid if the FV bit is set.
  5765. * - REL_SEQ_NUM_START
  5766. * Bits 17:12
  5767. * Purpose: Indicate the start of a series of MPDUs to release.
  5768. * All MPDUs within this series are present and valid - the host
  5769. * need not check each sequence number within this range to see if
  5770. * the corresponding MPDU is actually present.
  5771. * This field is only valid if the RV bit is set.
  5772. * Value:
  5773. * The sequence number for the first MPDUs to check to release.
  5774. * The sequence number is masked by 0x3f.
  5775. * - REL_SEQ_NUM_END
  5776. * Bits 23:18
  5777. * Purpose: Indicate the end of a series of MPDUs to release.
  5778. * Value:
  5779. * The sequence number one larger than the sequence number of the
  5780. * last MPDU to check to release.
  5781. * The sequence number is masked by 0x3f.
  5782. * All MPDUs within this series are present and valid - the host
  5783. * need not check each sequence number within this range to see if
  5784. * the corresponding MPDU is actually present.
  5785. * This field is only valid if the RV bit is set.
  5786. * - NUM_MPDU_RANGES
  5787. * Bits 31:24
  5788. * Purpose: Indicate how many ranges of MPDUs are present.
  5789. * Each MPDU range consists of a series of contiguous MPDUs within the
  5790. * rx frame sequence which all have the same MPDU status.
  5791. * Value: 1-63 (typically a small number, like 1-3)
  5792. *
  5793. * Rx PPDU descriptor fields:
  5794. * - RSSI_CMB
  5795. * Bits 7:0
  5796. * Purpose: Combined RSSI from all active rx chains, across the active
  5797. * bandwidth.
  5798. * Value: RSSI dB units w.r.t. noise floor
  5799. * - TIMESTAMP_SUBMICROSEC
  5800. * Bits 15:8
  5801. * Purpose: high-resolution timestamp
  5802. * Value:
  5803. * Sub-microsecond time of PPDU reception.
  5804. * This timestamp ranges from [0,MAC clock MHz).
  5805. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  5806. * to form a high-resolution, large range rx timestamp.
  5807. * - PHY_ERR_CODE
  5808. * Bits 23:16
  5809. * Purpose:
  5810. * If the rx frame processing resulted in a PHY error, indicate what
  5811. * type of rx PHY error occurred.
  5812. * Value:
  5813. * This field is valid if the "P" (PHY_ERR) flag is set.
  5814. * TBD: document/specify the values for this field
  5815. * - PHY_ERR
  5816. * Bit 24
  5817. * Purpose: indicate whether the rx PPDU had a PHY error
  5818. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  5819. * - LEGACY_RATE
  5820. * Bits 28:25
  5821. * Purpose:
  5822. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  5823. * specify which rate was used.
  5824. * Value:
  5825. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  5826. * flag.
  5827. * If LEGACY_RATE_SEL is 0:
  5828. * 0x8: OFDM 48 Mbps
  5829. * 0x9: OFDM 24 Mbps
  5830. * 0xA: OFDM 12 Mbps
  5831. * 0xB: OFDM 6 Mbps
  5832. * 0xC: OFDM 54 Mbps
  5833. * 0xD: OFDM 36 Mbps
  5834. * 0xE: OFDM 18 Mbps
  5835. * 0xF: OFDM 9 Mbps
  5836. * If LEGACY_RATE_SEL is 1:
  5837. * 0x8: CCK 11 Mbps long preamble
  5838. * 0x9: CCK 5.5 Mbps long preamble
  5839. * 0xA: CCK 2 Mbps long preamble
  5840. * 0xB: CCK 1 Mbps long preamble
  5841. * 0xC: CCK 11 Mbps short preamble
  5842. * 0xD: CCK 5.5 Mbps short preamble
  5843. * 0xE: CCK 2 Mbps short preamble
  5844. * - LEGACY_RATE_SEL
  5845. * Bit 29
  5846. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  5847. * Value:
  5848. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  5849. * used a legacy rate.
  5850. * 0 -> OFDM, 1 -> CCK
  5851. * - END_VALID
  5852. * Bit 30
  5853. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5854. * the start of the PPDU are valid. Specifically, the following
  5855. * fields are only valid if END_VALID is set:
  5856. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  5857. * TIMESTAMP_SUBMICROSEC
  5858. * Value:
  5859. * 0 -> rx PPDU desc end fields are not valid
  5860. * 1 -> rx PPDU desc end fields are valid
  5861. * - START_VALID
  5862. * Bit 31
  5863. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5864. * the end of the PPDU are valid. Specifically, the following
  5865. * fields are only valid if START_VALID is set:
  5866. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  5867. * VHT-SIG-A
  5868. * Value:
  5869. * 0 -> rx PPDU desc start fields are not valid
  5870. * 1 -> rx PPDU desc start fields are valid
  5871. * - RSSI0_PRI20
  5872. * Bits 7:0
  5873. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  5874. * Value: RSSI dB units w.r.t. noise floor
  5875. *
  5876. * - RSSI0_EXT20
  5877. * Bits 7:0
  5878. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  5879. * (if the rx bandwidth was >= 40 MHz)
  5880. * Value: RSSI dB units w.r.t. noise floor
  5881. * - RSSI0_EXT40
  5882. * Bits 7:0
  5883. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  5884. * (if the rx bandwidth was >= 80 MHz)
  5885. * Value: RSSI dB units w.r.t. noise floor
  5886. * - RSSI0_EXT80
  5887. * Bits 7:0
  5888. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  5889. * (if the rx bandwidth was >= 160 MHz)
  5890. * Value: RSSI dB units w.r.t. noise floor
  5891. *
  5892. * - RSSI1_PRI20
  5893. * Bits 7:0
  5894. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  5895. * Value: RSSI dB units w.r.t. noise floor
  5896. * - RSSI1_EXT20
  5897. * Bits 7:0
  5898. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  5899. * (if the rx bandwidth was >= 40 MHz)
  5900. * Value: RSSI dB units w.r.t. noise floor
  5901. * - RSSI1_EXT40
  5902. * Bits 7:0
  5903. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  5904. * (if the rx bandwidth was >= 80 MHz)
  5905. * Value: RSSI dB units w.r.t. noise floor
  5906. * - RSSI1_EXT80
  5907. * Bits 7:0
  5908. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  5909. * (if the rx bandwidth was >= 160 MHz)
  5910. * Value: RSSI dB units w.r.t. noise floor
  5911. *
  5912. * - RSSI2_PRI20
  5913. * Bits 7:0
  5914. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  5915. * Value: RSSI dB units w.r.t. noise floor
  5916. * - RSSI2_EXT20
  5917. * Bits 7:0
  5918. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  5919. * (if the rx bandwidth was >= 40 MHz)
  5920. * Value: RSSI dB units w.r.t. noise floor
  5921. * - RSSI2_EXT40
  5922. * Bits 7:0
  5923. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  5924. * (if the rx bandwidth was >= 80 MHz)
  5925. * Value: RSSI dB units w.r.t. noise floor
  5926. * - RSSI2_EXT80
  5927. * Bits 7:0
  5928. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  5929. * (if the rx bandwidth was >= 160 MHz)
  5930. * Value: RSSI dB units w.r.t. noise floor
  5931. *
  5932. * - RSSI3_PRI20
  5933. * Bits 7:0
  5934. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  5935. * Value: RSSI dB units w.r.t. noise floor
  5936. * - RSSI3_EXT20
  5937. * Bits 7:0
  5938. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  5939. * (if the rx bandwidth was >= 40 MHz)
  5940. * Value: RSSI dB units w.r.t. noise floor
  5941. * - RSSI3_EXT40
  5942. * Bits 7:0
  5943. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  5944. * (if the rx bandwidth was >= 80 MHz)
  5945. * Value: RSSI dB units w.r.t. noise floor
  5946. * - RSSI3_EXT80
  5947. * Bits 7:0
  5948. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  5949. * (if the rx bandwidth was >= 160 MHz)
  5950. * Value: RSSI dB units w.r.t. noise floor
  5951. *
  5952. * - TSF32
  5953. * Bits 31:0
  5954. * Purpose: specify the time the rx PPDU was received, in TSF units
  5955. * Value: 32 LSBs of the TSF
  5956. * - TIMESTAMP_MICROSEC
  5957. * Bits 31:0
  5958. * Purpose: specify the time the rx PPDU was received, in microsecond units
  5959. * Value: PPDU rx time, in microseconds
  5960. * - VHT_SIG_A1
  5961. * Bits 23:0
  5962. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  5963. * from the rx PPDU
  5964. * Value:
  5965. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  5966. * VHT-SIG-A1 data.
  5967. * If PREAMBLE_TYPE specifies HT, then this field contains the
  5968. * first 24 bits of the HT-SIG data.
  5969. * Otherwise, this field is invalid.
  5970. * Refer to the the 802.11 protocol for the definition of the
  5971. * HT-SIG and VHT-SIG-A1 fields
  5972. * - VHT_SIG_A2
  5973. * Bits 23:0
  5974. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  5975. * from the rx PPDU
  5976. * Value:
  5977. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  5978. * VHT-SIG-A2 data.
  5979. * If PREAMBLE_TYPE specifies HT, then this field contains the
  5980. * last 24 bits of the HT-SIG data.
  5981. * Otherwise, this field is invalid.
  5982. * Refer to the the 802.11 protocol for the definition of the
  5983. * HT-SIG and VHT-SIG-A2 fields
  5984. * - PREAMBLE_TYPE
  5985. * Bits 31:24
  5986. * Purpose: indicate the PHY format of the received burst
  5987. * Value:
  5988. * 0x4: Legacy (OFDM/CCK)
  5989. * 0x8: HT
  5990. * 0x9: HT with TxBF
  5991. * 0xC: VHT
  5992. * 0xD: VHT with TxBF
  5993. * - SERVICE
  5994. * Bits 31:24
  5995. * Purpose: TBD
  5996. * Value: TBD
  5997. *
  5998. * Rx MSDU descriptor fields:
  5999. * - FW_RX_DESC_BYTES
  6000. * Bits 15:0
  6001. * Purpose: Indicate how many bytes in the Rx indication are used for
  6002. * FW Rx descriptors
  6003. *
  6004. * Payload fields:
  6005. * - MPDU_COUNT
  6006. * Bits 7:0
  6007. * Purpose: Indicate how many sequential MPDUs share the same status.
  6008. * All MPDUs within the indicated list are from the same RA-TA-TID.
  6009. * - MPDU_STATUS
  6010. * Bits 15:8
  6011. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  6012. * received successfully.
  6013. * Value:
  6014. * 0x1: success
  6015. * 0x2: FCS error
  6016. * 0x3: duplicate error
  6017. * 0x4: replay error
  6018. * 0x5: invalid peer
  6019. */
  6020. /* header fields */
  6021. #define HTT_RX_IND_EXT_TID_M 0x1f00
  6022. #define HTT_RX_IND_EXT_TID_S 8
  6023. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  6024. #define HTT_RX_IND_FLUSH_VALID_S 13
  6025. #define HTT_RX_IND_REL_VALID_M 0x4000
  6026. #define HTT_RX_IND_REL_VALID_S 14
  6027. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  6028. #define HTT_RX_IND_PEER_ID_S 16
  6029. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  6030. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  6031. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  6032. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  6033. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  6034. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  6035. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  6036. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  6037. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  6038. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  6039. /* rx PPDU descriptor fields */
  6040. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  6041. #define HTT_RX_IND_RSSI_CMB_S 0
  6042. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  6043. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  6044. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  6045. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  6046. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  6047. #define HTT_RX_IND_PHY_ERR_S 24
  6048. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  6049. #define HTT_RX_IND_LEGACY_RATE_S 25
  6050. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  6051. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  6052. #define HTT_RX_IND_END_VALID_M 0x40000000
  6053. #define HTT_RX_IND_END_VALID_S 30
  6054. #define HTT_RX_IND_START_VALID_M 0x80000000
  6055. #define HTT_RX_IND_START_VALID_S 31
  6056. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  6057. #define HTT_RX_IND_RSSI_PRI20_S 0
  6058. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  6059. #define HTT_RX_IND_RSSI_EXT20_S 8
  6060. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  6061. #define HTT_RX_IND_RSSI_EXT40_S 16
  6062. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  6063. #define HTT_RX_IND_RSSI_EXT80_S 24
  6064. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  6065. #define HTT_RX_IND_VHT_SIG_A1_S 0
  6066. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  6067. #define HTT_RX_IND_VHT_SIG_A2_S 0
  6068. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  6069. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  6070. #define HTT_RX_IND_SERVICE_M 0xff000000
  6071. #define HTT_RX_IND_SERVICE_S 24
  6072. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  6073. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  6074. /* rx MSDU descriptor fields */
  6075. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  6076. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  6077. /* payload fields */
  6078. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  6079. #define HTT_RX_IND_MPDU_COUNT_S 0
  6080. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  6081. #define HTT_RX_IND_MPDU_STATUS_S 8
  6082. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  6083. do { \
  6084. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  6085. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  6086. } while (0)
  6087. #define HTT_RX_IND_EXT_TID_GET(word) \
  6088. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  6089. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  6090. do { \
  6091. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  6092. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  6093. } while (0)
  6094. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  6095. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  6096. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  6097. do { \
  6098. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  6099. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  6100. } while (0)
  6101. #define HTT_RX_IND_REL_VALID_GET(word) \
  6102. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  6103. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  6104. do { \
  6105. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  6106. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  6107. } while (0)
  6108. #define HTT_RX_IND_PEER_ID_GET(word) \
  6109. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  6110. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  6111. do { \
  6112. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  6113. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  6114. } while (0)
  6115. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  6116. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  6117. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  6118. do { \
  6119. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  6120. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  6121. } while (0)
  6122. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  6123. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  6124. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  6125. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  6126. do { \
  6127. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  6128. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  6129. } while (0)
  6130. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  6131. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  6132. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  6133. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  6134. do { \
  6135. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  6136. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  6137. } while (0)
  6138. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  6139. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  6140. HTT_RX_IND_REL_SEQ_NUM_START_S)
  6141. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  6142. do { \
  6143. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  6144. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  6145. } while (0)
  6146. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  6147. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  6148. HTT_RX_IND_REL_SEQ_NUM_END_S)
  6149. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  6150. do { \
  6151. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  6152. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  6153. } while (0)
  6154. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  6155. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  6156. HTT_RX_IND_NUM_MPDU_RANGES_S)
  6157. /* FW rx PPDU descriptor fields */
  6158. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  6159. do { \
  6160. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  6161. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  6162. } while (0)
  6163. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  6164. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  6165. HTT_RX_IND_RSSI_CMB_S)
  6166. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  6167. do { \
  6168. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  6169. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  6170. } while (0)
  6171. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  6172. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  6173. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  6174. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  6175. do { \
  6176. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  6177. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  6178. } while (0)
  6179. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  6180. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  6181. HTT_RX_IND_PHY_ERR_CODE_S)
  6182. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  6183. do { \
  6184. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  6185. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  6186. } while (0)
  6187. #define HTT_RX_IND_PHY_ERR_GET(word) \
  6188. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  6189. HTT_RX_IND_PHY_ERR_S)
  6190. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  6191. do { \
  6192. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  6193. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  6194. } while (0)
  6195. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  6196. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  6197. HTT_RX_IND_LEGACY_RATE_S)
  6198. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  6199. do { \
  6200. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  6201. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  6202. } while (0)
  6203. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  6204. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  6205. HTT_RX_IND_LEGACY_RATE_SEL_S)
  6206. #define HTT_RX_IND_END_VALID_SET(word, value) \
  6207. do { \
  6208. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  6209. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  6210. } while (0)
  6211. #define HTT_RX_IND_END_VALID_GET(word) \
  6212. (((word) & HTT_RX_IND_END_VALID_M) >> \
  6213. HTT_RX_IND_END_VALID_S)
  6214. #define HTT_RX_IND_START_VALID_SET(word, value) \
  6215. do { \
  6216. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  6217. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  6218. } while (0)
  6219. #define HTT_RX_IND_START_VALID_GET(word) \
  6220. (((word) & HTT_RX_IND_START_VALID_M) >> \
  6221. HTT_RX_IND_START_VALID_S)
  6222. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  6223. do { \
  6224. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  6225. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  6226. } while (0)
  6227. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  6228. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  6229. HTT_RX_IND_RSSI_PRI20_S)
  6230. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  6231. do { \
  6232. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  6233. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  6234. } while (0)
  6235. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  6236. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  6237. HTT_RX_IND_RSSI_EXT20_S)
  6238. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  6239. do { \
  6240. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  6241. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  6242. } while (0)
  6243. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  6244. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  6245. HTT_RX_IND_RSSI_EXT40_S)
  6246. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  6247. do { \
  6248. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  6249. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  6250. } while (0)
  6251. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  6252. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  6253. HTT_RX_IND_RSSI_EXT80_S)
  6254. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  6255. do { \
  6256. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  6257. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  6258. } while (0)
  6259. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  6260. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  6261. HTT_RX_IND_VHT_SIG_A1_S)
  6262. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  6263. do { \
  6264. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  6265. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  6266. } while (0)
  6267. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  6268. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  6269. HTT_RX_IND_VHT_SIG_A2_S)
  6270. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  6271. do { \
  6272. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  6273. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  6274. } while (0)
  6275. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  6276. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  6277. HTT_RX_IND_PREAMBLE_TYPE_S)
  6278. #define HTT_RX_IND_SERVICE_SET(word, value) \
  6279. do { \
  6280. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  6281. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  6282. } while (0)
  6283. #define HTT_RX_IND_SERVICE_GET(word) \
  6284. (((word) & HTT_RX_IND_SERVICE_M) >> \
  6285. HTT_RX_IND_SERVICE_S)
  6286. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  6287. do { \
  6288. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  6289. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  6290. } while (0)
  6291. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  6292. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  6293. HTT_RX_IND_SA_ANT_MATRIX_S)
  6294. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  6295. do { \
  6296. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  6297. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  6298. } while (0)
  6299. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  6300. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  6301. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  6302. do { \
  6303. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  6304. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  6305. } while (0)
  6306. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  6307. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  6308. #define HTT_RX_IND_HL_BYTES \
  6309. (HTT_RX_IND_HDR_BYTES + \
  6310. 4 /* single FW rx MSDU descriptor */ + \
  6311. 4 /* single MPDU range information element */)
  6312. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  6313. /* Could we use one macro entry? */
  6314. #define HTT_WORD_SET(word, field, value) \
  6315. do { \
  6316. HTT_CHECK_SET_VAL(field, value); \
  6317. (word) |= ((value) << field ## _S); \
  6318. } while (0)
  6319. #define HTT_WORD_GET(word, field) \
  6320. (((word) & field ## _M) >> field ## _S)
  6321. PREPACK struct hl_htt_rx_ind_base {
  6322. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  6323. } POSTPACK;
  6324. /*
  6325. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  6326. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  6327. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  6328. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  6329. * htt_rx_ind_hl_rx_desc_t.
  6330. */
  6331. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  6332. struct htt_rx_ind_hl_rx_desc_t {
  6333. A_UINT8 ver;
  6334. A_UINT8 len;
  6335. struct {
  6336. A_UINT8
  6337. first_msdu: 1,
  6338. last_msdu: 1,
  6339. c3_failed: 1,
  6340. c4_failed: 1,
  6341. ipv6: 1,
  6342. tcp: 1,
  6343. udp: 1,
  6344. reserved: 1;
  6345. } flags;
  6346. /* NOTE: no reserved space - don't append any new fields here */
  6347. };
  6348. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  6349. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6350. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  6351. #define HTT_RX_IND_HL_RX_DESC_VER 0
  6352. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  6353. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6354. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  6355. #define HTT_RX_IND_HL_FLAG_OFFSET \
  6356. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6357. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  6358. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  6359. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  6360. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  6361. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  6362. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  6363. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  6364. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  6365. /* This structure is used in HL, the basic descriptor information
  6366. * used by host. the structure is translated by FW from HW desc
  6367. * or generated by FW. But in HL monitor mode, the host would use
  6368. * the same structure with LL.
  6369. */
  6370. PREPACK struct hl_htt_rx_desc_base {
  6371. A_UINT32
  6372. seq_num:12,
  6373. encrypted:1,
  6374. chan_info_present:1,
  6375. resv0:2,
  6376. mcast_bcast:1,
  6377. fragment:1,
  6378. key_id_oct:8,
  6379. resv1:6;
  6380. A_UINT32
  6381. pn_31_0;
  6382. union {
  6383. struct {
  6384. A_UINT16 pn_47_32;
  6385. A_UINT16 pn_63_48;
  6386. } pn16;
  6387. A_UINT32 pn_63_32;
  6388. } u0;
  6389. A_UINT32
  6390. pn_95_64;
  6391. A_UINT32
  6392. pn_127_96;
  6393. } POSTPACK;
  6394. /*
  6395. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  6396. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  6397. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  6398. * Please see htt_chan_change_t for description of the fields.
  6399. */
  6400. PREPACK struct htt_chan_info_t
  6401. {
  6402. A_UINT32 primary_chan_center_freq_mhz: 16,
  6403. contig_chan1_center_freq_mhz: 16;
  6404. A_UINT32 contig_chan2_center_freq_mhz: 16,
  6405. phy_mode: 8,
  6406. reserved: 8;
  6407. } POSTPACK;
  6408. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  6409. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  6410. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  6411. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  6412. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  6413. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  6414. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  6415. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  6416. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  6417. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  6418. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  6419. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  6420. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  6421. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  6422. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  6423. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  6424. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  6425. /* Channel information */
  6426. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  6427. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  6428. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  6429. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  6430. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  6431. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  6432. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  6433. #define HTT_CHAN_INFO_PHY_MODE_S 16
  6434. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  6435. do { \
  6436. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  6437. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  6438. } while (0)
  6439. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  6440. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  6441. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  6442. do { \
  6443. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  6444. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  6445. } while (0)
  6446. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  6447. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  6448. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  6449. do { \
  6450. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  6451. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  6452. } while (0)
  6453. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  6454. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  6455. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  6456. do { \
  6457. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  6458. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  6459. } while (0)
  6460. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  6461. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  6462. /*
  6463. * @brief target -> host rx reorder flush message definition
  6464. *
  6465. * @details
  6466. * The following field definitions describe the format of the rx flush
  6467. * message sent from the target to the host.
  6468. * The message consists of a 4-octet header, followed by one or more
  6469. * 4-octet payload information elements.
  6470. *
  6471. * |31 24|23 8|7 0|
  6472. * |--------------------------------------------------------------|
  6473. * | TID | peer ID | msg type |
  6474. * |--------------------------------------------------------------|
  6475. * | seq num end | seq num start | MPDU status | reserved |
  6476. * |--------------------------------------------------------------|
  6477. * First DWORD:
  6478. * - MSG_TYPE
  6479. * Bits 7:0
  6480. * Purpose: identifies this as an rx flush message
  6481. * Value: 0x2
  6482. * - PEER_ID
  6483. * Bits 23:8 (only bits 18:8 actually used)
  6484. * Purpose: identify which peer's rx data is being flushed
  6485. * Value: (rx) peer ID
  6486. * - TID
  6487. * Bits 31:24 (only bits 27:24 actually used)
  6488. * Purpose: Specifies which traffic identifier's rx data is being flushed
  6489. * Value: traffic identifier
  6490. * Second DWORD:
  6491. * - MPDU_STATUS
  6492. * Bits 15:8
  6493. * Purpose:
  6494. * Indicate whether the flushed MPDUs should be discarded or processed.
  6495. * Value:
  6496. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  6497. * stages of rx processing
  6498. * other: discard the MPDUs
  6499. * It is anticipated that flush messages will always have
  6500. * MPDU status == 1, but the status flag is included for
  6501. * flexibility.
  6502. * - SEQ_NUM_START
  6503. * Bits 23:16
  6504. * Purpose:
  6505. * Indicate the start of a series of consecutive MPDUs being flushed.
  6506. * Not all MPDUs within this range are necessarily valid - the host
  6507. * must check each sequence number within this range to see if the
  6508. * corresponding MPDU is actually present.
  6509. * Value:
  6510. * The sequence number for the first MPDU in the sequence.
  6511. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6512. * - SEQ_NUM_END
  6513. * Bits 30:24
  6514. * Purpose:
  6515. * Indicate the end of a series of consecutive MPDUs being flushed.
  6516. * Value:
  6517. * The sequence number one larger than the sequence number of the
  6518. * last MPDU being flushed.
  6519. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6520. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  6521. * are to be released for further rx processing.
  6522. * Not all MPDUs within this range are necessarily valid - the host
  6523. * must check each sequence number within this range to see if the
  6524. * corresponding MPDU is actually present.
  6525. */
  6526. /* first DWORD */
  6527. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  6528. #define HTT_RX_FLUSH_PEER_ID_S 8
  6529. #define HTT_RX_FLUSH_TID_M 0xff000000
  6530. #define HTT_RX_FLUSH_TID_S 24
  6531. /* second DWORD */
  6532. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  6533. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  6534. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  6535. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  6536. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  6537. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  6538. #define HTT_RX_FLUSH_BYTES 8
  6539. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  6540. do { \
  6541. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  6542. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  6543. } while (0)
  6544. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  6545. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  6546. #define HTT_RX_FLUSH_TID_SET(word, value) \
  6547. do { \
  6548. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  6549. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  6550. } while (0)
  6551. #define HTT_RX_FLUSH_TID_GET(word) \
  6552. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  6553. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  6554. do { \
  6555. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  6556. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  6557. } while (0)
  6558. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  6559. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  6560. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  6561. do { \
  6562. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  6563. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  6564. } while (0)
  6565. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  6566. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  6567. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  6568. do { \
  6569. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  6570. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  6571. } while (0)
  6572. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  6573. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  6574. /*
  6575. * @brief target -> host rx pn check indication message
  6576. *
  6577. * @details
  6578. * The following field definitions describe the format of the Rx PN check
  6579. * indication message sent from the target to the host.
  6580. * The message consists of a 4-octet header, followed by the start and
  6581. * end sequence numbers to be released, followed by the PN IEs. Each PN
  6582. * IE is one octet containing the sequence number that failed the PN
  6583. * check.
  6584. *
  6585. * |31 24|23 8|7 0|
  6586. * |--------------------------------------------------------------|
  6587. * | TID | peer ID | msg type |
  6588. * |--------------------------------------------------------------|
  6589. * | Reserved | PN IE count | seq num end | seq num start|
  6590. * |--------------------------------------------------------------|
  6591. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  6592. * |--------------------------------------------------------------|
  6593. * First DWORD:
  6594. * - MSG_TYPE
  6595. * Bits 7:0
  6596. * Purpose: Identifies this as an rx pn check indication message
  6597. * Value: 0x2
  6598. * - PEER_ID
  6599. * Bits 23:8 (only bits 18:8 actually used)
  6600. * Purpose: identify which peer
  6601. * Value: (rx) peer ID
  6602. * - TID
  6603. * Bits 31:24 (only bits 27:24 actually used)
  6604. * Purpose: identify traffic identifier
  6605. * Value: traffic identifier
  6606. * Second DWORD:
  6607. * - SEQ_NUM_START
  6608. * Bits 7:0
  6609. * Purpose:
  6610. * Indicates the starting sequence number of the MPDU in this
  6611. * series of MPDUs that went though PN check.
  6612. * Value:
  6613. * The sequence number for the first MPDU in the sequence.
  6614. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6615. * - SEQ_NUM_END
  6616. * Bits 15:8
  6617. * Purpose:
  6618. * Indicates the ending sequence number of the MPDU in this
  6619. * series of MPDUs that went though PN check.
  6620. * Value:
  6621. * The sequence number one larger then the sequence number of the last
  6622. * MPDU being flushed.
  6623. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6624. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  6625. * for invalid PN numbers and are ready to be released for further processing.
  6626. * Not all MPDUs within this range are necessarily valid - the host
  6627. * must check each sequence number within this range to see if the
  6628. * corresponding MPDU is actually present.
  6629. * - PN_IE_COUNT
  6630. * Bits 23:16
  6631. * Purpose:
  6632. * Used to determine the variable number of PN information elements in this
  6633. * message
  6634. *
  6635. * PN information elements:
  6636. * - PN_IE_x-
  6637. * Purpose:
  6638. * Each PN information element contains the sequence number of the MPDU that
  6639. * has failed the target PN check.
  6640. * Value:
  6641. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  6642. * that failed the PN check.
  6643. */
  6644. /* first DWORD */
  6645. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  6646. #define HTT_RX_PN_IND_PEER_ID_S 8
  6647. #define HTT_RX_PN_IND_TID_M 0xff000000
  6648. #define HTT_RX_PN_IND_TID_S 24
  6649. /* second DWORD */
  6650. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  6651. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  6652. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  6653. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  6654. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  6655. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  6656. #define HTT_RX_PN_IND_BYTES 8
  6657. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  6658. do { \
  6659. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  6660. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  6661. } while (0)
  6662. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  6663. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  6664. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  6665. do { \
  6666. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  6667. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  6668. } while (0)
  6669. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  6670. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  6671. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  6672. do { \
  6673. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  6674. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  6675. } while (0)
  6676. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  6677. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  6678. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  6679. do { \
  6680. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  6681. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  6682. } while (0)
  6683. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  6684. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  6685. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  6686. do { \
  6687. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  6688. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  6689. } while (0)
  6690. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  6691. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  6692. /*
  6693. * @brief target -> host rx offload deliver message for LL system
  6694. *
  6695. * @details
  6696. * In a low latency system this message is sent whenever the offload
  6697. * manager flushes out the packets it has coalesced in its coalescing buffer.
  6698. * The DMA of the actual packets into host memory is done before sending out
  6699. * this message. This message indicates only how many MSDUs to reap. The
  6700. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  6701. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  6702. * DMA'd by the MAC directly into host memory these packets do not contain
  6703. * the MAC descriptors in the header portion of the packet. Instead they contain
  6704. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  6705. * message, the packets are delivered directly to the NW stack without going
  6706. * through the regular reorder buffering and PN checking path since it has
  6707. * already been done in target.
  6708. *
  6709. * |31 24|23 16|15 8|7 0|
  6710. * |-----------------------------------------------------------------------|
  6711. * | Total MSDU count | reserved | msg type |
  6712. * |-----------------------------------------------------------------------|
  6713. *
  6714. * @brief target -> host rx offload deliver message for HL system
  6715. *
  6716. * @details
  6717. * In a high latency system this message is sent whenever the offload manager
  6718. * flushes out the packets it has coalesced in its coalescing buffer. The
  6719. * actual packets are also carried along with this message. When the host
  6720. * receives this message, it is expected to deliver these packets to the NW
  6721. * stack directly instead of routing them through the reorder buffering and
  6722. * PN checking path since it has already been done in target.
  6723. *
  6724. * |31 24|23 16|15 8|7 0|
  6725. * |-----------------------------------------------------------------------|
  6726. * | Total MSDU count | reserved | msg type |
  6727. * |-----------------------------------------------------------------------|
  6728. * | peer ID | MSDU length |
  6729. * |-----------------------------------------------------------------------|
  6730. * | MSDU payload | FW Desc | tid | vdev ID |
  6731. * |-----------------------------------------------------------------------|
  6732. * | MSDU payload contd. |
  6733. * |-----------------------------------------------------------------------|
  6734. * | peer ID | MSDU length |
  6735. * |-----------------------------------------------------------------------|
  6736. * | MSDU payload | FW Desc | tid | vdev ID |
  6737. * |-----------------------------------------------------------------------|
  6738. * | MSDU payload contd. |
  6739. * |-----------------------------------------------------------------------|
  6740. *
  6741. */
  6742. /* first DWORD */
  6743. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  6744. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  6745. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  6746. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  6747. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  6748. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  6749. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  6750. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  6751. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  6752. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  6753. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  6754. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  6755. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  6756. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  6757. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  6758. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  6759. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  6760. do { \
  6761. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  6762. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  6763. } while (0)
  6764. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  6765. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  6766. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  6767. do { \
  6768. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  6769. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  6770. } while (0)
  6771. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  6772. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  6773. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  6774. do { \
  6775. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  6776. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  6777. } while (0)
  6778. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  6779. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  6780. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  6781. do { \
  6782. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  6783. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  6784. } while (0)
  6785. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  6786. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  6787. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  6788. do { \
  6789. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  6790. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  6791. } while (0)
  6792. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  6793. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  6794. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  6795. do { \
  6796. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  6797. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  6798. } while (0)
  6799. /**
  6800. * @brief target -> host rx peer map/unmap message definition
  6801. *
  6802. * @details
  6803. * The following diagram shows the format of the rx peer map message sent
  6804. * from the target to the host. This layout assumes the target operates
  6805. * as little-endian.
  6806. *
  6807. * This message always contains a SW peer ID. The main purpose of the
  6808. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  6809. * with, so that the host can use that peer ID to determine which peer
  6810. * transmitted the rx frame. This SW peer ID is sometimes also used for
  6811. * other purposes, such as identifying during tx completions which peer
  6812. * the tx frames in question were transmitted to.
  6813. *
  6814. * In certain generations of chips, the peer map message also contains
  6815. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  6816. * to identify which peer the frame needs to be forwarded to (i.e. the
  6817. * peer assocated with the Destination MAC Address within the packet),
  6818. * and particularly which vdev needs to transmit the frame (for cases
  6819. * of inter-vdev rx --> tx forwarding).
  6820. * This DA-based peer ID that is provided for certain rx frames
  6821. * (the rx frames that need to be re-transmitted as tx frames)
  6822. * is the ID that the HW uses for referring to the peer in question,
  6823. * rather than the peer ID that the SW+FW use to refer to the peer.
  6824. *
  6825. *
  6826. * |31 24|23 16|15 8|7 0|
  6827. * |-----------------------------------------------------------------------|
  6828. * | SW peer ID | VDEV ID | msg type |
  6829. * |-----------------------------------------------------------------------|
  6830. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6831. * |-----------------------------------------------------------------------|
  6832. * | HW peer ID | MAC addr 5 | MAC addr 4 |
  6833. * |-----------------------------------------------------------------------|
  6834. *
  6835. *
  6836. * The following diagram shows the format of the rx peer unmap message sent
  6837. * from the target to the host.
  6838. *
  6839. * |31 24|23 16|15 8|7 0|
  6840. * |-----------------------------------------------------------------------|
  6841. * | SW peer ID | VDEV ID | msg type |
  6842. * |-----------------------------------------------------------------------|
  6843. *
  6844. * The following field definitions describe the format of the rx peer map
  6845. * and peer unmap messages sent from the target to the host.
  6846. * - MSG_TYPE
  6847. * Bits 7:0
  6848. * Purpose: identifies this as an rx peer map or peer unmap message
  6849. * Value: peer map -> 0x3, peer unmap -> 0x4
  6850. * - VDEV_ID
  6851. * Bits 15:8
  6852. * Purpose: Indicates which virtual device the peer is associated
  6853. * with.
  6854. * Value: vdev ID (used in the host to look up the vdev object)
  6855. * - PEER_ID (a.k.a. SW_PEER_ID)
  6856. * Bits 31:16
  6857. * Purpose: The peer ID (index) that WAL is allocating (map) or
  6858. * freeing (unmap)
  6859. * Value: (rx) peer ID
  6860. * - MAC_ADDR_L32 (peer map only)
  6861. * Bits 31:0
  6862. * Purpose: Identifies which peer node the peer ID is for.
  6863. * Value: lower 4 bytes of peer node's MAC address
  6864. * - MAC_ADDR_U16 (peer map only)
  6865. * Bits 15:0
  6866. * Purpose: Identifies which peer node the peer ID is for.
  6867. * Value: upper 2 bytes of peer node's MAC address
  6868. * - HW_PEER_ID
  6869. * Bits 31:16
  6870. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  6871. * address, so for rx frames marked for rx --> tx forwarding, the
  6872. * host can determine from the HW peer ID provided as meta-data with
  6873. * the rx frame which peer the frame is supposed to be forwarded to.
  6874. * Value: ID used by the MAC HW to identify the peer
  6875. */
  6876. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  6877. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  6878. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  6879. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  6880. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  6881. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  6882. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  6883. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  6884. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  6885. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  6886. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  6887. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  6888. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  6889. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  6890. do { \
  6891. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  6892. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  6893. } while (0)
  6894. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  6895. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  6896. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  6897. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  6898. do { \
  6899. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  6900. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  6901. } while (0)
  6902. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  6903. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  6904. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  6905. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  6906. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  6907. do { \
  6908. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  6909. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  6910. } while (0)
  6911. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  6912. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  6913. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  6914. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  6915. #define HTT_RX_PEER_MAP_BYTES 12
  6916. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  6917. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  6918. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  6919. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  6920. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  6921. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  6922. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  6923. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  6924. #define HTT_RX_PEER_UNMAP_BYTES 4
  6925. /**
  6926. * @brief target -> host rx peer map V2 message definition
  6927. *
  6928. * @details
  6929. * The following diagram shows the format of the rx peer map v2 message sent
  6930. * from the target to the host. This layout assumes the target operates
  6931. * as little-endian.
  6932. *
  6933. * This message always contains a SW peer ID. The main purpose of the
  6934. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  6935. * with, so that the host can use that peer ID to determine which peer
  6936. * transmitted the rx frame. This SW peer ID is sometimes also used for
  6937. * other purposes, such as identifying during tx completions which peer
  6938. * the tx frames in question were transmitted to.
  6939. *
  6940. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  6941. * is used during rx --> tx frame forwarding to identify which peer the
  6942. * frame needs to be forwarded to (i.e. the peer assocated with the
  6943. * Destination MAC Address within the packet), and particularly which vdev
  6944. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  6945. * This DA-based peer ID that is provided for certain rx frames
  6946. * (the rx frames that need to be re-transmitted as tx frames)
  6947. * is the ID that the HW uses for referring to the peer in question,
  6948. * rather than the peer ID that the SW+FW use to refer to the peer.
  6949. *
  6950. *
  6951. * |31 24|23 16|15 8|7 0|
  6952. * |-----------------------------------------------------------------------|
  6953. * | SW peer ID | VDEV ID | msg type |
  6954. * |-----------------------------------------------------------------------|
  6955. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6956. * |-----------------------------------------------------------------------|
  6957. * | HW peer ID | MAC addr 5 | MAC addr 4 |
  6958. * |-----------------------------------------------------------------------|
  6959. * | Reserved_17_31 | Next Hop | AST Hash Value |
  6960. * |-----------------------------------------------------------------------|
  6961. * | Reserved_0 |
  6962. * |-----------------------------------------------------------------------|
  6963. * | Reserved_1 |
  6964. * |-----------------------------------------------------------------------|
  6965. * | Reserved_2 |
  6966. * |-----------------------------------------------------------------------|
  6967. * | Reserved_3 |
  6968. * |-----------------------------------------------------------------------|
  6969. *
  6970. *
  6971. * The following field definitions describe the format of the rx peer map v2
  6972. * messages sent from the target to the host.
  6973. * - MSG_TYPE
  6974. * Bits 7:0
  6975. * Purpose: identifies this as an rx peer map v2 message
  6976. * Value: peer map v2 -> 0x1e
  6977. * - VDEV_ID
  6978. * Bits 15:8
  6979. * Purpose: Indicates which virtual device the peer is associated with.
  6980. * Value: vdev ID (used in the host to look up the vdev object)
  6981. * - SW_PEER_ID
  6982. * Bits 31:16
  6983. * Purpose: The peer ID (index) that WAL is allocating
  6984. * Value: (rx) peer ID
  6985. * - MAC_ADDR_L32
  6986. * Bits 31:0
  6987. * Purpose: Identifies which peer node the peer ID is for.
  6988. * Value: lower 4 bytes of peer node's MAC address
  6989. * - MAC_ADDR_U16
  6990. * Bits 15:0
  6991. * Purpose: Identifies which peer node the peer ID is for.
  6992. * Value: upper 2 bytes of peer node's MAC address
  6993. * - HW_PEER_ID
  6994. * Bits 31:16
  6995. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  6996. * address, so for rx frames marked for rx --> tx forwarding, the
  6997. * host can determine from the HW peer ID provided as meta-data with
  6998. * the rx frame which peer the frame is supposed to be forwarded to.
  6999. * Value: ID used by the MAC HW to identify the peer
  7000. * - AST_HASH_VALUE
  7001. * Bits 15:0
  7002. * Purpose: Indicates AST Hash value is required for the TCL AST index
  7003. * override feature.
  7004. * - NEXT_HOP
  7005. * Bit 16
  7006. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  7007. * (Wireless Distribution System).
  7008. */
  7009. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  7010. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  7011. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  7012. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  7013. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  7014. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  7015. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  7016. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  7017. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  7018. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  7019. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  7020. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  7021. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  7022. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  7023. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  7024. do { \
  7025. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  7026. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  7027. } while (0)
  7028. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  7029. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  7030. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  7031. do { \
  7032. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  7033. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  7034. } while (0)
  7035. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  7036. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  7037. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  7038. do { \
  7039. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  7040. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  7041. } while (0)
  7042. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  7043. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  7044. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  7045. do { \
  7046. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  7047. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  7048. } while (0)
  7049. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  7050. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  7051. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  7052. do { \
  7053. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  7054. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  7055. } while (0)
  7056. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  7057. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  7058. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  7059. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  7060. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  7061. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  7062. #define HTT_RX_PEER_MAP_V2_BYTES 32
  7063. /**
  7064. * @brief target -> host rx peer unmap V2 message definition
  7065. *
  7066. *
  7067. * The following diagram shows the format of the rx peer unmap message sent
  7068. * from the target to the host.
  7069. *
  7070. * |31 24|23 16|15 8|7 0|
  7071. * |-----------------------------------------------------------------------|
  7072. * | SW peer ID | VDEV ID | msg type |
  7073. * |-----------------------------------------------------------------------|
  7074. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  7075. * |-----------------------------------------------------------------------|
  7076. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  7077. * |-----------------------------------------------------------------------|
  7078. * | Peer Delete Duration |
  7079. * |-----------------------------------------------------------------------|
  7080. * | Reserved_0 |
  7081. * |-----------------------------------------------------------------------|
  7082. * | Reserved_1 |
  7083. * |-----------------------------------------------------------------------|
  7084. * | Reserved_2 |
  7085. * |-----------------------------------------------------------------------|
  7086. *
  7087. *
  7088. * The following field definitions describe the format of the rx peer unmap
  7089. * messages sent from the target to the host.
  7090. * - MSG_TYPE
  7091. * Bits 7:0
  7092. * Purpose: identifies this as an rx peer unmap v2 message
  7093. * Value: peer unmap v2 -> 0x1f
  7094. * - VDEV_ID
  7095. * Bits 15:8
  7096. * Purpose: Indicates which virtual device the peer is associated
  7097. * with.
  7098. * Value: vdev ID (used in the host to look up the vdev object)
  7099. * - SW_PEER_ID
  7100. * Bits 31:16
  7101. * Purpose: The peer ID (index) that WAL is freeing
  7102. * Value: (rx) peer ID
  7103. * - MAC_ADDR_L32
  7104. * Bits 31:0
  7105. * Purpose: Identifies which peer node the peer ID is for.
  7106. * Value: lower 4 bytes of peer node's MAC address
  7107. * - MAC_ADDR_U16
  7108. * Bits 15:0
  7109. * Purpose: Identifies which peer node the peer ID is for.
  7110. * Value: upper 2 bytes of peer node's MAC address
  7111. * - NEXT_HOP
  7112. * Bits 16
  7113. * Purpose: Bit indicates next_hop AST entry used for WDS
  7114. * (Wireless Distribution System).
  7115. * - PEER_DELETE_DURATION
  7116. * Bits 31:0
  7117. * Purpose: Time taken to delete peer, in msec,
  7118. * Used for monitoring / debugging PEER delete response delay
  7119. */
  7120. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  7121. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  7122. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  7123. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  7124. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  7125. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  7126. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  7127. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  7128. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  7129. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  7130. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  7131. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  7132. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  7133. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  7134. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  7135. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  7136. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  7137. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  7138. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  7139. do { \
  7140. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  7141. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  7142. } while (0)
  7143. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  7144. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  7145. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  7146. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  7147. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  7148. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  7149. /**
  7150. * @brief target -> host message specifying security parameters
  7151. *
  7152. * @details
  7153. * The following diagram shows the format of the security specification
  7154. * message sent from the target to the host.
  7155. * This security specification message tells the host whether a PN check is
  7156. * necessary on rx data frames, and if so, how large the PN counter is.
  7157. * This message also tells the host about the security processing to apply
  7158. * to defragmented rx frames - specifically, whether a Message Integrity
  7159. * Check is required, and the Michael key to use.
  7160. *
  7161. * |31 24|23 16|15|14 8|7 0|
  7162. * |-----------------------------------------------------------------------|
  7163. * | peer ID | U| security type | msg type |
  7164. * |-----------------------------------------------------------------------|
  7165. * | Michael Key K0 |
  7166. * |-----------------------------------------------------------------------|
  7167. * | Michael Key K1 |
  7168. * |-----------------------------------------------------------------------|
  7169. * | WAPI RSC Low0 |
  7170. * |-----------------------------------------------------------------------|
  7171. * | WAPI RSC Low1 |
  7172. * |-----------------------------------------------------------------------|
  7173. * | WAPI RSC Hi0 |
  7174. * |-----------------------------------------------------------------------|
  7175. * | WAPI RSC Hi1 |
  7176. * |-----------------------------------------------------------------------|
  7177. *
  7178. * The following field definitions describe the format of the security
  7179. * indication message sent from the target to the host.
  7180. * - MSG_TYPE
  7181. * Bits 7:0
  7182. * Purpose: identifies this as a security specification message
  7183. * Value: 0xb
  7184. * - SEC_TYPE
  7185. * Bits 14:8
  7186. * Purpose: specifies which type of security applies to the peer
  7187. * Value: htt_sec_type enum value
  7188. * - UNICAST
  7189. * Bit 15
  7190. * Purpose: whether this security is applied to unicast or multicast data
  7191. * Value: 1 -> unicast, 0 -> multicast
  7192. * - PEER_ID
  7193. * Bits 31:16
  7194. * Purpose: The ID number for the peer the security specification is for
  7195. * Value: peer ID
  7196. * - MICHAEL_KEY_K0
  7197. * Bits 31:0
  7198. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  7199. * Value: Michael Key K0 (if security type is TKIP)
  7200. * - MICHAEL_KEY_K1
  7201. * Bits 31:0
  7202. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  7203. * Value: Michael Key K1 (if security type is TKIP)
  7204. * - WAPI_RSC_LOW0
  7205. * Bits 31:0
  7206. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  7207. * Value: WAPI RSC Low0 (if security type is WAPI)
  7208. * - WAPI_RSC_LOW1
  7209. * Bits 31:0
  7210. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  7211. * Value: WAPI RSC Low1 (if security type is WAPI)
  7212. * - WAPI_RSC_HI0
  7213. * Bits 31:0
  7214. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  7215. * Value: WAPI RSC Hi0 (if security type is WAPI)
  7216. * - WAPI_RSC_HI1
  7217. * Bits 31:0
  7218. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  7219. * Value: WAPI RSC Hi1 (if security type is WAPI)
  7220. */
  7221. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  7222. #define HTT_SEC_IND_SEC_TYPE_S 8
  7223. #define HTT_SEC_IND_UNICAST_M 0x00008000
  7224. #define HTT_SEC_IND_UNICAST_S 15
  7225. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  7226. #define HTT_SEC_IND_PEER_ID_S 16
  7227. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  7228. do { \
  7229. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  7230. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  7231. } while (0)
  7232. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  7233. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  7234. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  7235. do { \
  7236. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  7237. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  7238. } while (0)
  7239. #define HTT_SEC_IND_UNICAST_GET(word) \
  7240. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  7241. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  7242. do { \
  7243. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  7244. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  7245. } while (0)
  7246. #define HTT_SEC_IND_PEER_ID_GET(word) \
  7247. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  7248. #define HTT_SEC_IND_BYTES 28
  7249. /**
  7250. * @brief target -> host rx ADDBA / DELBA message definitions
  7251. *
  7252. * @details
  7253. * The following diagram shows the format of the rx ADDBA message sent
  7254. * from the target to the host:
  7255. *
  7256. * |31 20|19 16|15 8|7 0|
  7257. * |---------------------------------------------------------------------|
  7258. * | peer ID | TID | window size | msg type |
  7259. * |---------------------------------------------------------------------|
  7260. *
  7261. * The following diagram shows the format of the rx DELBA message sent
  7262. * from the target to the host:
  7263. *
  7264. * |31 20|19 16|15 10|9 8|7 0|
  7265. * |---------------------------------------------------------------------|
  7266. * | peer ID | TID | reserved | IR| msg type |
  7267. * |---------------------------------------------------------------------|
  7268. *
  7269. * The following field definitions describe the format of the rx ADDBA
  7270. * and DELBA messages sent from the target to the host.
  7271. * - MSG_TYPE
  7272. * Bits 7:0
  7273. * Purpose: identifies this as an rx ADDBA or DELBA message
  7274. * Value: ADDBA -> 0x5, DELBA -> 0x6
  7275. * - IR (initiator / recipient)
  7276. * Bits 9:8 (DELBA only)
  7277. * Purpose: specify whether the DELBA handshake was initiated by the
  7278. * local STA/AP, or by the peer STA/AP
  7279. * Value:
  7280. * 0 - unspecified
  7281. * 1 - initiator (a.k.a. originator)
  7282. * 2 - recipient (a.k.a. responder)
  7283. * 3 - unused / reserved
  7284. * - WIN_SIZE
  7285. * Bits 15:8 (ADDBA only)
  7286. * Purpose: Specifies the length of the block ack window (max = 64).
  7287. * Value:
  7288. * block ack window length specified by the received ADDBA
  7289. * management message.
  7290. * - TID
  7291. * Bits 19:16
  7292. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  7293. * Value:
  7294. * TID specified by the received ADDBA or DELBA management message.
  7295. * - PEER_ID
  7296. * Bits 31:20
  7297. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  7298. * Value:
  7299. * ID (hash value) used by the host for fast, direct lookup of
  7300. * host SW peer info, including rx reorder states.
  7301. */
  7302. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  7303. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  7304. #define HTT_RX_ADDBA_TID_M 0xf0000
  7305. #define HTT_RX_ADDBA_TID_S 16
  7306. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  7307. #define HTT_RX_ADDBA_PEER_ID_S 20
  7308. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  7309. do { \
  7310. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  7311. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  7312. } while (0)
  7313. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  7314. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  7315. #define HTT_RX_ADDBA_TID_SET(word, value) \
  7316. do { \
  7317. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  7318. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  7319. } while (0)
  7320. #define HTT_RX_ADDBA_TID_GET(word) \
  7321. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  7322. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  7323. do { \
  7324. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  7325. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  7326. } while (0)
  7327. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  7328. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  7329. #define HTT_RX_ADDBA_BYTES 4
  7330. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  7331. #define HTT_RX_DELBA_INITIATOR_S 8
  7332. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  7333. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  7334. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  7335. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  7336. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  7337. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  7338. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  7339. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  7340. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  7341. do { \
  7342. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  7343. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  7344. } while (0)
  7345. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  7346. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  7347. #define HTT_RX_DELBA_BYTES 4
  7348. /**
  7349. * @brief tx queue group information element definition
  7350. *
  7351. * @details
  7352. * The following diagram shows the format of the tx queue group
  7353. * information element, which can be included in target --> host
  7354. * messages to specify the number of tx "credits" (tx descriptors
  7355. * for LL, or tx buffers for HL) available to a particular group
  7356. * of host-side tx queues, and which host-side tx queues belong to
  7357. * the group.
  7358. *
  7359. * |31|30 24|23 16|15|14|13 0|
  7360. * |------------------------------------------------------------------------|
  7361. * | X| reserved | tx queue grp ID | A| S| credit count |
  7362. * |------------------------------------------------------------------------|
  7363. * | vdev ID mask | AC mask |
  7364. * |------------------------------------------------------------------------|
  7365. *
  7366. * The following definitions describe the fields within the tx queue group
  7367. * information element:
  7368. * - credit_count
  7369. * Bits 13:1
  7370. * Purpose: specify how many tx credits are available to the tx queue group
  7371. * Value: An absolute or relative, positive or negative credit value
  7372. * The 'A' bit specifies whether the value is absolute or relative.
  7373. * The 'S' bit specifies whether the value is positive or negative.
  7374. * A negative value can only be relative, not absolute.
  7375. * An absolute value replaces any prior credit value the host has for
  7376. * the tx queue group in question.
  7377. * A relative value is added to the prior credit value the host has for
  7378. * the tx queue group in question.
  7379. * - sign
  7380. * Bit 14
  7381. * Purpose: specify whether the credit count is positive or negative
  7382. * Value: 0 -> positive, 1 -> negative
  7383. * - absolute
  7384. * Bit 15
  7385. * Purpose: specify whether the credit count is absolute or relative
  7386. * Value: 0 -> relative, 1 -> absolute
  7387. * - txq_group_id
  7388. * Bits 23:16
  7389. * Purpose: indicate which tx queue group's credit and/or membership are
  7390. * being specified
  7391. * Value: 0 to max_tx_queue_groups-1
  7392. * - reserved
  7393. * Bits 30:16
  7394. * Value: 0x0
  7395. * - eXtension
  7396. * Bit 31
  7397. * Purpose: specify whether another tx queue group info element follows
  7398. * Value: 0 -> no more tx queue group information elements
  7399. * 1 -> another tx queue group information element immediately follows
  7400. * - ac_mask
  7401. * Bits 15:0
  7402. * Purpose: specify which Access Categories belong to the tx queue group
  7403. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  7404. * the tx queue group.
  7405. * The AC bit-mask values are obtained by left-shifting by the
  7406. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  7407. * - vdev_id_mask
  7408. * Bits 31:16
  7409. * Purpose: specify which vdev's tx queues belong to the tx queue group
  7410. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  7411. * belong to the tx queue group.
  7412. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  7413. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  7414. */
  7415. PREPACK struct htt_txq_group {
  7416. A_UINT32
  7417. credit_count: 14,
  7418. sign: 1,
  7419. absolute: 1,
  7420. tx_queue_group_id: 8,
  7421. reserved0: 7,
  7422. extension: 1;
  7423. A_UINT32
  7424. ac_mask: 16,
  7425. vdev_id_mask: 16;
  7426. } POSTPACK;
  7427. /* first word */
  7428. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  7429. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  7430. #define HTT_TXQ_GROUP_SIGN_S 14
  7431. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  7432. #define HTT_TXQ_GROUP_ABS_S 15
  7433. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  7434. #define HTT_TXQ_GROUP_ID_S 16
  7435. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  7436. #define HTT_TXQ_GROUP_EXT_S 31
  7437. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  7438. /* second word */
  7439. #define HTT_TXQ_GROUP_AC_MASK_S 0
  7440. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  7441. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  7442. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  7443. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  7444. do { \
  7445. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  7446. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  7447. } while (0)
  7448. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  7449. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  7450. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  7451. do { \
  7452. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  7453. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  7454. } while (0)
  7455. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  7456. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  7457. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  7458. do { \
  7459. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  7460. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  7461. } while (0)
  7462. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  7463. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  7464. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  7465. do { \
  7466. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  7467. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  7468. } while (0)
  7469. #define HTT_TXQ_GROUP_ID_GET(_info) \
  7470. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  7471. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  7472. do { \
  7473. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  7474. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  7475. } while (0)
  7476. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  7477. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  7478. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  7479. do { \
  7480. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  7481. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  7482. } while (0)
  7483. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  7484. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  7485. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  7486. do { \
  7487. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  7488. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  7489. } while (0)
  7490. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  7491. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  7492. /**
  7493. * @brief target -> host TX completion indication message definition
  7494. *
  7495. * @details
  7496. * The following diagram shows the format of the TX completion indication sent
  7497. * from the target to the host
  7498. *
  7499. * |31 29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  7500. * |----------------------------------------------------------------|
  7501. * header: |rsvd |A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  7502. * |----------------------------------------------------------------|
  7503. * payload: | MSDU1 ID | MSDU0 ID |
  7504. * |----------------------------------------------------------------|
  7505. * : MSDU3 ID | MSDU2 ID :
  7506. * |----------------------------------------------------------------|
  7507. * | struct htt_tx_compl_ind_append_retries |
  7508. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
  7509. * | struct htt_tx_compl_ind_append_tx_tstamp |
  7510. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
  7511. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  7512. * |----------------------------------------------------------------|
  7513. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  7514. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
  7515. * | MSDU0 tx_tsf64_low |
  7516. * |----------------------------------------------------------------|
  7517. * | MSDU0 tx_tsf64_high |
  7518. * |----------------------------------------------------------------|
  7519. * | MSDU1 tx_tsf64_low |
  7520. * |----------------------------------------------------------------|
  7521. * | MSDU1 tx_tsf64_high |
  7522. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
  7523. * Where:
  7524. * A0 = append (a.k.a. append0)
  7525. * A1 = append1
  7526. * TP = MSDU tx power presence
  7527. * A2 = append2
  7528. * A3 = append3
  7529. *
  7530. * The following field definitions describe the format of the TX completion
  7531. * indication sent from the target to the host
  7532. * Header fields:
  7533. * - msg_type
  7534. * Bits 7:0
  7535. * Purpose: identifies this as HTT TX completion indication
  7536. * Value: 0x7
  7537. * - status
  7538. * Bits 10:8
  7539. * Purpose: the TX completion status of payload fragmentations descriptors
  7540. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  7541. * - tid
  7542. * Bits 14:11
  7543. * Purpose: the tid associated with those fragmentation descriptors. It is
  7544. * valid or not, depending on the tid_invalid bit.
  7545. * Value: 0 to 15
  7546. * - tid_invalid
  7547. * Bits 15:15
  7548. * Purpose: this bit indicates whether the tid field is valid or not
  7549. * Value: 0 indicates valid; 1 indicates invalid
  7550. * - num
  7551. * Bits 23:16
  7552. * Purpose: the number of payload in this indication
  7553. * Value: 1 to 255
  7554. * - append (a.k.a. append0)
  7555. * Bits 24:24
  7556. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  7557. * the number of tx retries for one MSDU at the end of this message
  7558. * Value: 0 indicates no appending; 1 indicates appending
  7559. * - append1
  7560. * Bits 25:25
  7561. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  7562. * contains the timestamp info for each TX msdu id in payload.
  7563. * The order of the timestamps matches the order of the MSDU IDs.
  7564. * Note that a big-endian host needs to account for the reordering
  7565. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  7566. * conversion) when determining which tx timestamp corresponds to
  7567. * which MSDU ID.
  7568. * Value: 0 indicates no appending; 1 indicates appending
  7569. * - msdu_tx_power_presence
  7570. * Bits 26:26
  7571. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  7572. * for each MSDU referenced by the TX_COMPL_IND message.
  7573. * The tx power is reported in 0.5 dBm units.
  7574. * The order of the per-MSDU tx power reports matches the order
  7575. * of the MSDU IDs.
  7576. * Note that a big-endian host needs to account for the reordering
  7577. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  7578. * conversion) when determining which Tx Power corresponds to
  7579. * which MSDU ID.
  7580. * Value: 0 indicates MSDU tx power reports are not appended,
  7581. * 1 indicates MSDU tx power reports are appended
  7582. * - append2
  7583. * Bits 27:27
  7584. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  7585. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  7586. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  7587. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  7588. * for each MSDU, for convenience.
  7589. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  7590. * this append2 bit is set).
  7591. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  7592. * dB above the noise floor.
  7593. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  7594. * 1 indicates MSDU ACK RSSI values are appended.
  7595. * - append3
  7596. * Bits 28:28
  7597. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  7598. * contains the tx tsf info based on wlan global TSF for
  7599. * each TX msdu id in payload.
  7600. * The order of the tx tsf matches the order of the MSDU IDs.
  7601. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  7602. * values to indicate the the lower 32 bits and higher 32 bits of
  7603. * the tx tsf.
  7604. * The tx_tsf64 here represents the time MSDU was acked and the
  7605. * tx_tsf64 has microseconds units.
  7606. * Value: 0 indicates no appending; 1 indicates appending
  7607. * Payload fields:
  7608. * - hmsdu_id
  7609. * Bits 15:0
  7610. * Purpose: this ID is used to track the Tx buffer in host
  7611. * Value: 0 to "size of host MSDU descriptor pool - 1"
  7612. */
  7613. #define HTT_TX_COMPL_IND_STATUS_S 8
  7614. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  7615. #define HTT_TX_COMPL_IND_TID_S 11
  7616. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  7617. #define HTT_TX_COMPL_IND_TID_INV_S 15
  7618. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  7619. #define HTT_TX_COMPL_IND_NUM_S 16
  7620. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  7621. #define HTT_TX_COMPL_IND_APPEND_S 24
  7622. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  7623. #define HTT_TX_COMPL_IND_APPEND1_S 25
  7624. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  7625. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  7626. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  7627. #define HTT_TX_COMPL_IND_APPEND2_S 27
  7628. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  7629. #define HTT_TX_COMPL_IND_APPEND3_S 28
  7630. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  7631. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  7632. do { \
  7633. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  7634. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  7635. } while (0)
  7636. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  7637. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  7638. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  7639. do { \
  7640. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  7641. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  7642. } while (0)
  7643. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  7644. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  7645. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  7646. do { \
  7647. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  7648. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  7649. } while (0)
  7650. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  7651. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  7652. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  7653. do { \
  7654. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  7655. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  7656. } while (0)
  7657. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  7658. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  7659. HTT_TX_COMPL_IND_TID_INV_S)
  7660. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  7661. do { \
  7662. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  7663. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  7664. } while (0)
  7665. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  7666. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  7667. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  7668. do { \
  7669. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  7670. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  7671. } while (0)
  7672. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  7673. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  7674. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  7675. do { \
  7676. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  7677. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  7678. } while (0)
  7679. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  7680. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  7681. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  7682. do { \
  7683. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  7684. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  7685. } while (0)
  7686. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  7687. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  7688. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  7689. do { \
  7690. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  7691. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  7692. } while (0)
  7693. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  7694. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  7695. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  7696. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  7697. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  7698. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  7699. #define HTT_TX_COMPL_IND_STAT_OK 0
  7700. /* DISCARD:
  7701. * current meaning:
  7702. * MSDUs were queued for transmission but filtered by HW or SW
  7703. * without any over the air attempts
  7704. * legacy meaning (HL Rome):
  7705. * MSDUs were discarded by the target FW without any over the air
  7706. * attempts due to lack of space
  7707. */
  7708. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  7709. /* NO_ACK:
  7710. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  7711. */
  7712. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  7713. /* POSTPONE:
  7714. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  7715. * be downloaded again later (in the appropriate order), when they are
  7716. * deliverable.
  7717. */
  7718. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  7719. /*
  7720. * The PEER_DEL tx completion status is used for HL cases
  7721. * where the peer the frame is for has been deleted.
  7722. * The host has already discarded its copy of the frame, but
  7723. * it still needs the tx completion to restore its credit.
  7724. */
  7725. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  7726. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  7727. #define HTT_TX_COMPL_IND_STAT_DROP 5
  7728. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  7729. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  7730. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  7731. PREPACK struct htt_tx_compl_ind_base {
  7732. A_UINT32 hdr;
  7733. A_UINT16 payload[1/*or more*/];
  7734. } POSTPACK;
  7735. PREPACK struct htt_tx_compl_ind_append_retries {
  7736. A_UINT16 msdu_id;
  7737. A_UINT8 tx_retries;
  7738. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  7739. 0: this is the last append_retries struct */
  7740. } POSTPACK;
  7741. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  7742. A_UINT32 timestamp[1/*or more*/];
  7743. } POSTPACK;
  7744. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  7745. A_UINT32 tx_tsf64_low;
  7746. A_UINT32 tx_tsf64_high;
  7747. } POSTPACK;
  7748. /**
  7749. * @brief target -> host rate-control update indication message
  7750. *
  7751. * @details
  7752. * The following diagram shows the format of the RC Update message
  7753. * sent from the target to the host, while processing the tx-completion
  7754. * of a transmitted PPDU.
  7755. *
  7756. * |31 24|23 16|15 8|7 0|
  7757. * |-------------------------------------------------------------|
  7758. * | peer ID | vdev ID | msg_type |
  7759. * |-------------------------------------------------------------|
  7760. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  7761. * |-------------------------------------------------------------|
  7762. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  7763. * |-------------------------------------------------------------|
  7764. * | : |
  7765. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  7766. * | : |
  7767. * |-------------------------------------------------------------|
  7768. * | : |
  7769. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  7770. * | : |
  7771. * |-------------------------------------------------------------|
  7772. * : :
  7773. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  7774. *
  7775. */
  7776. typedef struct {
  7777. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  7778. A_UINT32 rate_code_flags;
  7779. A_UINT32 flags; /* Encodes information such as excessive
  7780. retransmission, aggregate, some info
  7781. from .11 frame control,
  7782. STBC, LDPC, (SGI and Tx Chain Mask
  7783. are encoded in ptx_rc->flags field),
  7784. AMPDU truncation (BT/time based etc.),
  7785. RTS/CTS attempt */
  7786. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  7787. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  7788. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  7789. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  7790. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  7791. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  7792. } HTT_RC_TX_DONE_PARAMS;
  7793. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  7794. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  7795. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  7796. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  7797. #define HTT_RC_UPDATE_VDEVID_S 8
  7798. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  7799. #define HTT_RC_UPDATE_PEERID_S 16
  7800. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  7801. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  7802. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  7803. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  7804. do { \
  7805. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  7806. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  7807. } while (0)
  7808. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  7809. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  7810. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  7811. do { \
  7812. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  7813. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  7814. } while (0)
  7815. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  7816. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  7817. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  7818. do { \
  7819. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  7820. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  7821. } while (0)
  7822. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  7823. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  7824. /**
  7825. * @brief target -> host rx fragment indication message definition
  7826. *
  7827. * @details
  7828. * The following field definitions describe the format of the rx fragment
  7829. * indication message sent from the target to the host.
  7830. * The rx fragment indication message shares the format of the
  7831. * rx indication message, but not all fields from the rx indication message
  7832. * are relevant to the rx fragment indication message.
  7833. *
  7834. *
  7835. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  7836. * |-----------+-------------------+---------------------+-------------|
  7837. * | peer ID | |FV| ext TID | msg type |
  7838. * |-------------------------------------------------------------------|
  7839. * | | flush | flush |
  7840. * | | end | start |
  7841. * | | seq num | seq num |
  7842. * |-------------------------------------------------------------------|
  7843. * | reserved | FW rx desc bytes |
  7844. * |-------------------------------------------------------------------|
  7845. * | | FW MSDU Rx |
  7846. * | | desc B0 |
  7847. * |-------------------------------------------------------------------|
  7848. * Header fields:
  7849. * - MSG_TYPE
  7850. * Bits 7:0
  7851. * Purpose: identifies this as an rx fragment indication message
  7852. * Value: 0xa
  7853. * - EXT_TID
  7854. * Bits 12:8
  7855. * Purpose: identify the traffic ID of the rx data, including
  7856. * special "extended" TID values for multicast, broadcast, and
  7857. * non-QoS data frames
  7858. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  7859. * - FLUSH_VALID (FV)
  7860. * Bit 13
  7861. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  7862. * is valid
  7863. * Value:
  7864. * 1 -> flush IE is valid and needs to be processed
  7865. * 0 -> flush IE is not valid and should be ignored
  7866. * - PEER_ID
  7867. * Bits 31:16
  7868. * Purpose: Identify, by ID, which peer sent the rx data
  7869. * Value: ID of the peer who sent the rx data
  7870. * - FLUSH_SEQ_NUM_START
  7871. * Bits 5:0
  7872. * Purpose: Indicate the start of a series of MPDUs to flush
  7873. * Not all MPDUs within this series are necessarily valid - the host
  7874. * must check each sequence number within this range to see if the
  7875. * corresponding MPDU is actually present.
  7876. * This field is only valid if the FV bit is set.
  7877. * Value:
  7878. * The sequence number for the first MPDUs to check to flush.
  7879. * The sequence number is masked by 0x3f.
  7880. * - FLUSH_SEQ_NUM_END
  7881. * Bits 11:6
  7882. * Purpose: Indicate the end of a series of MPDUs to flush
  7883. * Value:
  7884. * The sequence number one larger than the sequence number of the
  7885. * last MPDU to check to flush.
  7886. * The sequence number is masked by 0x3f.
  7887. * Not all MPDUs within this series are necessarily valid - the host
  7888. * must check each sequence number within this range to see if the
  7889. * corresponding MPDU is actually present.
  7890. * This field is only valid if the FV bit is set.
  7891. * Rx descriptor fields:
  7892. * - FW_RX_DESC_BYTES
  7893. * Bits 15:0
  7894. * Purpose: Indicate how many bytes in the Rx indication are used for
  7895. * FW Rx descriptors
  7896. * Value: 1
  7897. */
  7898. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  7899. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  7900. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  7901. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  7902. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  7903. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  7904. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  7905. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  7906. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  7907. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  7908. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  7909. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  7910. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  7911. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  7912. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  7913. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  7914. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  7915. #define HTT_RX_FRAG_IND_BYTES \
  7916. (4 /* msg hdr */ + \
  7917. 4 /* flush spec */ + \
  7918. 4 /* (unused) FW rx desc bytes spec */ + \
  7919. 4 /* FW rx desc */)
  7920. /**
  7921. * @brief target -> host test message definition
  7922. *
  7923. * @details
  7924. * The following field definitions describe the format of the test
  7925. * message sent from the target to the host.
  7926. * The message consists of a 4-octet header, followed by a variable
  7927. * number of 32-bit integer values, followed by a variable number
  7928. * of 8-bit character values.
  7929. *
  7930. * |31 16|15 8|7 0|
  7931. * |-----------------------------------------------------------|
  7932. * | num chars | num ints | msg type |
  7933. * |-----------------------------------------------------------|
  7934. * | int 0 |
  7935. * |-----------------------------------------------------------|
  7936. * | int 1 |
  7937. * |-----------------------------------------------------------|
  7938. * | ... |
  7939. * |-----------------------------------------------------------|
  7940. * | char 3 | char 2 | char 1 | char 0 |
  7941. * |-----------------------------------------------------------|
  7942. * | | | ... | char 4 |
  7943. * |-----------------------------------------------------------|
  7944. * - MSG_TYPE
  7945. * Bits 7:0
  7946. * Purpose: identifies this as a test message
  7947. * Value: HTT_MSG_TYPE_TEST
  7948. * - NUM_INTS
  7949. * Bits 15:8
  7950. * Purpose: indicate how many 32-bit integers follow the message header
  7951. * - NUM_CHARS
  7952. * Bits 31:16
  7953. * Purpose: indicate how many 8-bit charaters follow the series of integers
  7954. */
  7955. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  7956. #define HTT_RX_TEST_NUM_INTS_S 8
  7957. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  7958. #define HTT_RX_TEST_NUM_CHARS_S 16
  7959. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  7960. do { \
  7961. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  7962. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  7963. } while (0)
  7964. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  7965. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  7966. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  7967. do { \
  7968. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  7969. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  7970. } while (0)
  7971. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  7972. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  7973. /**
  7974. * @brief target -> host packet log message
  7975. *
  7976. * @details
  7977. * The following field definitions describe the format of the packet log
  7978. * message sent from the target to the host.
  7979. * The message consists of a 4-octet header,followed by a variable number
  7980. * of 32-bit character values.
  7981. *
  7982. * |31 16|15 12|11 10|9 8|7 0|
  7983. * |------------------------------------------------------------------|
  7984. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  7985. * |------------------------------------------------------------------|
  7986. * | payload |
  7987. * |------------------------------------------------------------------|
  7988. * - MSG_TYPE
  7989. * Bits 7:0
  7990. * Purpose: identifies this as a pktlog message
  7991. * Value: HTT_T2H_MSG_TYPE_PKTLOG
  7992. * - mac_id
  7993. * Bits 9:8
  7994. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  7995. * Value: 0-3
  7996. * - pdev_id
  7997. * Bits 11:10
  7998. * Purpose: pdev_id
  7999. * Value: 0-3
  8000. * 0 (for rings at SOC level),
  8001. * 1/2/3 PDEV -> 0/1/2
  8002. * - payload_size
  8003. * Bits 31:16
  8004. * Purpose: explicitly specify the payload size
  8005. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  8006. */
  8007. PREPACK struct htt_pktlog_msg {
  8008. A_UINT32 header;
  8009. A_UINT32 payload[1/* or more */];
  8010. } POSTPACK;
  8011. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  8012. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  8013. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  8014. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  8015. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  8016. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  8017. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  8018. do { \
  8019. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  8020. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  8021. } while (0)
  8022. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  8023. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  8024. HTT_T2H_PKTLOG_MAC_ID_S)
  8025. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  8026. do { \
  8027. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  8028. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  8029. } while (0)
  8030. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  8031. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  8032. HTT_T2H_PKTLOG_PDEV_ID_S)
  8033. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  8034. do { \
  8035. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  8036. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  8037. } while (0)
  8038. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  8039. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  8040. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  8041. /*
  8042. * Rx reorder statistics
  8043. * NB: all the fields must be defined in 4 octets size.
  8044. */
  8045. struct rx_reorder_stats {
  8046. /* Non QoS MPDUs received */
  8047. A_UINT32 deliver_non_qos;
  8048. /* MPDUs received in-order */
  8049. A_UINT32 deliver_in_order;
  8050. /* Flush due to reorder timer expired */
  8051. A_UINT32 deliver_flush_timeout;
  8052. /* Flush due to move out of window */
  8053. A_UINT32 deliver_flush_oow;
  8054. /* Flush due to DELBA */
  8055. A_UINT32 deliver_flush_delba;
  8056. /* MPDUs dropped due to FCS error */
  8057. A_UINT32 fcs_error;
  8058. /* MPDUs dropped due to monitor mode non-data packet */
  8059. A_UINT32 mgmt_ctrl;
  8060. /* Unicast-data MPDUs dropped due to invalid peer */
  8061. A_UINT32 invalid_peer;
  8062. /* MPDUs dropped due to duplication (non aggregation) */
  8063. A_UINT32 dup_non_aggr;
  8064. /* MPDUs dropped due to processed before */
  8065. A_UINT32 dup_past;
  8066. /* MPDUs dropped due to duplicate in reorder queue */
  8067. A_UINT32 dup_in_reorder;
  8068. /* Reorder timeout happened */
  8069. A_UINT32 reorder_timeout;
  8070. /* invalid bar ssn */
  8071. A_UINT32 invalid_bar_ssn;
  8072. /* reorder reset due to bar ssn */
  8073. A_UINT32 ssn_reset;
  8074. /* Flush due to delete peer */
  8075. A_UINT32 deliver_flush_delpeer;
  8076. /* Flush due to offload*/
  8077. A_UINT32 deliver_flush_offload;
  8078. /* Flush due to out of buffer*/
  8079. A_UINT32 deliver_flush_oob;
  8080. /* MPDUs dropped due to PN check fail */
  8081. A_UINT32 pn_fail;
  8082. /* MPDUs dropped due to unable to allocate memory */
  8083. A_UINT32 store_fail;
  8084. /* Number of times the tid pool alloc succeeded */
  8085. A_UINT32 tid_pool_alloc_succ;
  8086. /* Number of times the MPDU pool alloc succeeded */
  8087. A_UINT32 mpdu_pool_alloc_succ;
  8088. /* Number of times the MSDU pool alloc succeeded */
  8089. A_UINT32 msdu_pool_alloc_succ;
  8090. /* Number of times the tid pool alloc failed */
  8091. A_UINT32 tid_pool_alloc_fail;
  8092. /* Number of times the MPDU pool alloc failed */
  8093. A_UINT32 mpdu_pool_alloc_fail;
  8094. /* Number of times the MSDU pool alloc failed */
  8095. A_UINT32 msdu_pool_alloc_fail;
  8096. /* Number of times the tid pool freed */
  8097. A_UINT32 tid_pool_free;
  8098. /* Number of times the MPDU pool freed */
  8099. A_UINT32 mpdu_pool_free;
  8100. /* Number of times the MSDU pool freed */
  8101. A_UINT32 msdu_pool_free;
  8102. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  8103. A_UINT32 msdu_queued;
  8104. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  8105. A_UINT32 msdu_recycled;
  8106. /* Number of MPDUs with invalid peer but A2 found in AST */
  8107. A_UINT32 invalid_peer_a2_in_ast;
  8108. /* Number of MPDUs with invalid peer but A3 found in AST */
  8109. A_UINT32 invalid_peer_a3_in_ast;
  8110. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  8111. A_UINT32 invalid_peer_bmc_mpdus;
  8112. /* Number of MSDUs with err attention word */
  8113. A_UINT32 rxdesc_err_att;
  8114. /* Number of MSDUs with flag of peer_idx_invalid */
  8115. A_UINT32 rxdesc_err_peer_idx_inv;
  8116. /* Number of MSDUs with flag of peer_idx_timeout */
  8117. A_UINT32 rxdesc_err_peer_idx_to;
  8118. /* Number of MSDUs with flag of overflow */
  8119. A_UINT32 rxdesc_err_ov;
  8120. /* Number of MSDUs with flag of msdu_length_err */
  8121. A_UINT32 rxdesc_err_msdu_len;
  8122. /* Number of MSDUs with flag of mpdu_length_err */
  8123. A_UINT32 rxdesc_err_mpdu_len;
  8124. /* Number of MSDUs with flag of tkip_mic_err */
  8125. A_UINT32 rxdesc_err_tkip_mic;
  8126. /* Number of MSDUs with flag of decrypt_err */
  8127. A_UINT32 rxdesc_err_decrypt;
  8128. /* Number of MSDUs with flag of fcs_err */
  8129. A_UINT32 rxdesc_err_fcs;
  8130. /* Number of Unicast (bc_mc bit is not set in attention word)
  8131. * frames with invalid peer handler
  8132. */
  8133. A_UINT32 rxdesc_uc_msdus_inv_peer;
  8134. /* Number of unicast frame directly (direct bit is set in attention word)
  8135. * to DUT with invalid peer handler
  8136. */
  8137. A_UINT32 rxdesc_direct_msdus_inv_peer;
  8138. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  8139. * frames with invalid peer handler
  8140. */
  8141. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  8142. /* Number of MSDUs dropped due to no first MSDU flag */
  8143. A_UINT32 rxdesc_no_1st_msdu;
  8144. /* Number of MSDUs droped due to ring overflow */
  8145. A_UINT32 msdu_drop_ring_ov;
  8146. /* Number of MSDUs dropped due to FC mismatch */
  8147. A_UINT32 msdu_drop_fc_mismatch;
  8148. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  8149. A_UINT32 msdu_drop_mgmt_remote_ring;
  8150. /* Number of MSDUs dropped due to errors not reported in attention word */
  8151. A_UINT32 msdu_drop_misc;
  8152. /* Number of MSDUs go to offload before reorder */
  8153. A_UINT32 offload_msdu_wal;
  8154. /* Number of data frame dropped by offload after reorder */
  8155. A_UINT32 offload_msdu_reorder;
  8156. /* Number of MPDUs with sequence number in the past and within the BA window */
  8157. A_UINT32 dup_past_within_window;
  8158. /* Number of MPDUs with sequence number in the past and outside the BA window */
  8159. A_UINT32 dup_past_outside_window;
  8160. /* Number of MSDUs with decrypt/MIC error */
  8161. A_UINT32 rxdesc_err_decrypt_mic;
  8162. /* Number of data MSDUs received on both local and remote rings */
  8163. A_UINT32 data_msdus_on_both_rings;
  8164. /* MPDUs never filled */
  8165. A_UINT32 holes_not_filled;
  8166. };
  8167. /*
  8168. * Rx Remote buffer statistics
  8169. * NB: all the fields must be defined in 4 octets size.
  8170. */
  8171. struct rx_remote_buffer_mgmt_stats {
  8172. /* Total number of MSDUs reaped for Rx processing */
  8173. A_UINT32 remote_reaped;
  8174. /* MSDUs recycled within firmware */
  8175. A_UINT32 remote_recycled;
  8176. /* MSDUs stored by Data Rx */
  8177. A_UINT32 data_rx_msdus_stored;
  8178. /* Number of HTT indications from WAL Rx MSDU */
  8179. A_UINT32 wal_rx_ind;
  8180. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  8181. A_UINT32 wal_rx_ind_unconsumed;
  8182. /* Number of HTT indications from Data Rx MSDU */
  8183. A_UINT32 data_rx_ind;
  8184. /* Number of unconsumed HTT indications from Data Rx MSDU */
  8185. A_UINT32 data_rx_ind_unconsumed;
  8186. /* Number of HTT indications from ATHBUF */
  8187. A_UINT32 athbuf_rx_ind;
  8188. /* Number of remote buffers requested for refill */
  8189. A_UINT32 refill_buf_req;
  8190. /* Number of remote buffers filled by the host */
  8191. A_UINT32 refill_buf_rsp;
  8192. /* Number of times MAC hw_index = f/w write_index */
  8193. A_INT32 mac_no_bufs;
  8194. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  8195. A_INT32 fw_indices_equal;
  8196. /* Number of times f/w finds no buffers to post */
  8197. A_INT32 host_no_bufs;
  8198. };
  8199. /*
  8200. * TXBF MU/SU packets and NDPA statistics
  8201. * NB: all the fields must be defined in 4 octets size.
  8202. */
  8203. struct rx_txbf_musu_ndpa_pkts_stats {
  8204. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  8205. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  8206. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  8207. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  8208. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  8209. A_UINT32 reserved[3]; /* must be set to 0x0 */
  8210. };
  8211. /*
  8212. * htt_dbg_stats_status -
  8213. * present - The requested stats have been delivered in full.
  8214. * This indicates that either the stats information was contained
  8215. * in its entirety within this message, or else this message
  8216. * completes the delivery of the requested stats info that was
  8217. * partially delivered through earlier STATS_CONF messages.
  8218. * partial - The requested stats have been delivered in part.
  8219. * One or more subsequent STATS_CONF messages with the same
  8220. * cookie value will be sent to deliver the remainder of the
  8221. * information.
  8222. * error - The requested stats could not be delivered, for example due
  8223. * to a shortage of memory to construct a message holding the
  8224. * requested stats.
  8225. * invalid - The requested stat type is either not recognized, or the
  8226. * target is configured to not gather the stats type in question.
  8227. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  8228. * series_done - This special value indicates that no further stats info
  8229. * elements are present within a series of stats info elems
  8230. * (within a stats upload confirmation message).
  8231. */
  8232. enum htt_dbg_stats_status {
  8233. HTT_DBG_STATS_STATUS_PRESENT = 0,
  8234. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  8235. HTT_DBG_STATS_STATUS_ERROR = 2,
  8236. HTT_DBG_STATS_STATUS_INVALID = 3,
  8237. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  8238. };
  8239. /**
  8240. * @brief target -> host statistics upload
  8241. *
  8242. * @details
  8243. * The following field definitions describe the format of the HTT target
  8244. * to host stats upload confirmation message.
  8245. * The message contains a cookie echoed from the HTT host->target stats
  8246. * upload request, which identifies which request the confirmation is
  8247. * for, and a series of tag-length-value stats information elements.
  8248. * The tag-length header for each stats info element also includes a
  8249. * status field, to indicate whether the request for the stat type in
  8250. * question was fully met, partially met, unable to be met, or invalid
  8251. * (if the stat type in question is disabled in the target).
  8252. * A special value of all 1's in this status field is used to indicate
  8253. * the end of the series of stats info elements.
  8254. *
  8255. *
  8256. * |31 16|15 8|7 5|4 0|
  8257. * |------------------------------------------------------------|
  8258. * | reserved | msg type |
  8259. * |------------------------------------------------------------|
  8260. * | cookie LSBs |
  8261. * |------------------------------------------------------------|
  8262. * | cookie MSBs |
  8263. * |------------------------------------------------------------|
  8264. * | stats entry length | reserved | S |stat type|
  8265. * |------------------------------------------------------------|
  8266. * | |
  8267. * | type-specific stats info |
  8268. * | |
  8269. * |------------------------------------------------------------|
  8270. * | stats entry length | reserved | S |stat type|
  8271. * |------------------------------------------------------------|
  8272. * | |
  8273. * | type-specific stats info |
  8274. * | |
  8275. * |------------------------------------------------------------|
  8276. * | n/a | reserved | 111 | n/a |
  8277. * |------------------------------------------------------------|
  8278. * Header fields:
  8279. * - MSG_TYPE
  8280. * Bits 7:0
  8281. * Purpose: identifies this is a statistics upload confirmation message
  8282. * Value: 0x9
  8283. * - COOKIE_LSBS
  8284. * Bits 31:0
  8285. * Purpose: Provide a mechanism to match a target->host stats confirmation
  8286. * message with its preceding host->target stats request message.
  8287. * Value: LSBs of the opaque cookie specified by the host-side requestor
  8288. * - COOKIE_MSBS
  8289. * Bits 31:0
  8290. * Purpose: Provide a mechanism to match a target->host stats confirmation
  8291. * message with its preceding host->target stats request message.
  8292. * Value: MSBs of the opaque cookie specified by the host-side requestor
  8293. *
  8294. * Stats Information Element tag-length header fields:
  8295. * - STAT_TYPE
  8296. * Bits 4:0
  8297. * Purpose: identifies the type of statistics info held in the
  8298. * following information element
  8299. * Value: htt_dbg_stats_type
  8300. * - STATUS
  8301. * Bits 7:5
  8302. * Purpose: indicate whether the requested stats are present
  8303. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  8304. * the completion of the stats entry series
  8305. * - LENGTH
  8306. * Bits 31:16
  8307. * Purpose: indicate the stats information size
  8308. * Value: This field specifies the number of bytes of stats information
  8309. * that follows the element tag-length header.
  8310. * It is expected but not required that this length is a multiple of
  8311. * 4 bytes. Even if the length is not an integer multiple of 4, the
  8312. * subsequent stats entry header will begin on a 4-byte aligned
  8313. * boundary.
  8314. */
  8315. #define HTT_T2H_STATS_COOKIE_SIZE 8
  8316. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  8317. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  8318. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  8319. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  8320. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  8321. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  8322. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  8323. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  8324. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  8325. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  8326. do { \
  8327. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  8328. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  8329. } while (0)
  8330. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  8331. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  8332. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  8333. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  8334. do { \
  8335. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  8336. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  8337. } while (0)
  8338. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  8339. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  8340. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  8341. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  8342. do { \
  8343. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  8344. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  8345. } while (0)
  8346. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  8347. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  8348. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  8349. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  8350. #define HTT_MAX_AGGR 64
  8351. #define HTT_HL_MAX_AGGR 18
  8352. /**
  8353. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  8354. *
  8355. * @details
  8356. * The following field definitions describe the format of the HTT host
  8357. * to target frag_desc/msdu_ext bank configuration message.
  8358. * The message contains the based address and the min and max id of the
  8359. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  8360. * MSDU_EXT/FRAG_DESC.
  8361. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  8362. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  8363. * the hardware does the mapping/translation.
  8364. *
  8365. * Total banks that can be configured is configured to 16.
  8366. *
  8367. * This should be called before any TX has be initiated by the HTT
  8368. *
  8369. * |31 16|15 8|7 5|4 0|
  8370. * |------------------------------------------------------------|
  8371. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  8372. * |------------------------------------------------------------|
  8373. * | BANK0_BASE_ADDRESS (bits 31:0) |
  8374. #if HTT_PADDR64
  8375. * | BANK0_BASE_ADDRESS (bits 63:32) |
  8376. #endif
  8377. * |------------------------------------------------------------|
  8378. * | ... |
  8379. * |------------------------------------------------------------|
  8380. * | BANK15_BASE_ADDRESS (bits 31:0) |
  8381. #if HTT_PADDR64
  8382. * | BANK15_BASE_ADDRESS (bits 63:32) |
  8383. #endif
  8384. * |------------------------------------------------------------|
  8385. * | BANK0_MAX_ID | BANK0_MIN_ID |
  8386. * |------------------------------------------------------------|
  8387. * | ... |
  8388. * |------------------------------------------------------------|
  8389. * | BANK15_MAX_ID | BANK15_MIN_ID |
  8390. * |------------------------------------------------------------|
  8391. * Header fields:
  8392. * - MSG_TYPE
  8393. * Bits 7:0
  8394. * Value: 0x6
  8395. * for systems with 64-bit format for bus addresses:
  8396. * - BANKx_BASE_ADDRESS_LO
  8397. * Bits 31:0
  8398. * Purpose: Provide a mechanism to specify the base address of the
  8399. * MSDU_EXT bank physical/bus address.
  8400. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  8401. * - BANKx_BASE_ADDRESS_HI
  8402. * Bits 31:0
  8403. * Purpose: Provide a mechanism to specify the base address of the
  8404. * MSDU_EXT bank physical/bus address.
  8405. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  8406. * for systems with 32-bit format for bus addresses:
  8407. * - BANKx_BASE_ADDRESS
  8408. * Bits 31:0
  8409. * Purpose: Provide a mechanism to specify the base address of the
  8410. * MSDU_EXT bank physical/bus address.
  8411. * Value: MSDU_EXT bank physical / bus address
  8412. * - BANKx_MIN_ID
  8413. * Bits 15:0
  8414. * Purpose: Provide a mechanism to specify the min index that needs to
  8415. * mapped.
  8416. * - BANKx_MAX_ID
  8417. * Bits 31:16
  8418. * Purpose: Provide a mechanism to specify the max index that needs to
  8419. * mapped.
  8420. *
  8421. */
  8422. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  8423. * safe value.
  8424. * @note MAX supported banks is 16.
  8425. */
  8426. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  8427. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  8428. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  8429. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  8430. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  8431. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  8432. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  8433. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  8434. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  8435. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  8436. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  8437. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  8438. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  8439. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  8440. do { \
  8441. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  8442. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  8443. } while (0)
  8444. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  8445. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  8446. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  8447. do { \
  8448. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  8449. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  8450. } while (0)
  8451. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  8452. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  8453. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  8454. do { \
  8455. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  8456. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  8457. } while (0)
  8458. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  8459. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  8460. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  8461. do { \
  8462. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  8463. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  8464. } while (0)
  8465. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  8466. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  8467. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  8468. do { \
  8469. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  8470. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  8471. } while (0)
  8472. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  8473. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  8474. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  8475. do { \
  8476. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  8477. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  8478. } while (0)
  8479. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  8480. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  8481. /*
  8482. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  8483. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  8484. * addresses are stored in a XXX-bit field.
  8485. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  8486. * htt_tx_frag_desc64_bank_cfg_t structs.
  8487. */
  8488. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  8489. _paddr_bits_, \
  8490. _paddr__bank_base_address_) \
  8491. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  8492. /** word 0 \
  8493. * msg_type: 8, \
  8494. * pdev_id: 2, \
  8495. * swap: 1, \
  8496. * reserved0: 5, \
  8497. * num_banks: 8, \
  8498. * desc_size: 8; \
  8499. */ \
  8500. A_UINT32 word0; \
  8501. /* \
  8502. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  8503. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  8504. * the second A_UINT32). \
  8505. */ \
  8506. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  8507. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  8508. } POSTPACK
  8509. /* define htt_tx_frag_desc32_bank_cfg_t */
  8510. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  8511. /* define htt_tx_frag_desc64_bank_cfg_t */
  8512. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  8513. /*
  8514. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  8515. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  8516. */
  8517. #if HTT_PADDR64
  8518. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  8519. #else
  8520. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  8521. #endif
  8522. /**
  8523. * @brief target -> host HTT TX Credit total count update message definition
  8524. *
  8525. *|31 16|15|14 9| 8 |7 0 |
  8526. *|---------------------+--+----------+-------+----------|
  8527. *|cur htt credit delta | Q| reserved | sign | msg type |
  8528. *|------------------------------------------------------|
  8529. *
  8530. * Header fields:
  8531. * - MSG_TYPE
  8532. * Bits 7:0
  8533. * Purpose: identifies this as a htt tx credit delta update message
  8534. * Value: 0xe
  8535. * - SIGN
  8536. * Bits 8
  8537. * identifies whether credit delta is positive or negative
  8538. * Value:
  8539. * - 0x0: credit delta is positive, rebalance in some buffers
  8540. * - 0x1: credit delta is negative, rebalance out some buffers
  8541. * - reserved
  8542. * Bits 14:9
  8543. * Value: 0x0
  8544. * - TXQ_GRP
  8545. * Bit 15
  8546. * Purpose: indicates whether any tx queue group information elements
  8547. * are appended to the tx credit update message
  8548. * Value: 0 -> no tx queue group information element is present
  8549. * 1 -> a tx queue group information element immediately follows
  8550. * - DELTA_COUNT
  8551. * Bits 31:16
  8552. * Purpose: Specify current htt credit delta absolute count
  8553. */
  8554. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  8555. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  8556. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  8557. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  8558. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  8559. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  8560. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  8561. do { \
  8562. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  8563. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  8564. } while (0)
  8565. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  8566. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  8567. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  8568. do { \
  8569. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  8570. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  8571. } while (0)
  8572. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  8573. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  8574. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  8575. do { \
  8576. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  8577. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  8578. } while (0)
  8579. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  8580. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  8581. #define HTT_TX_CREDIT_MSG_BYTES 4
  8582. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  8583. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  8584. /**
  8585. * @brief HTT WDI_IPA Operation Response Message
  8586. *
  8587. * @details
  8588. * HTT WDI_IPA Operation Response message is sent by target
  8589. * to host confirming suspend or resume operation.
  8590. * |31 24|23 16|15 8|7 0|
  8591. * |----------------+----------------+----------------+----------------|
  8592. * | op_code | Rsvd | msg_type |
  8593. * |-------------------------------------------------------------------|
  8594. * | Rsvd | Response len |
  8595. * |-------------------------------------------------------------------|
  8596. * | |
  8597. * | Response-type specific info |
  8598. * | |
  8599. * | |
  8600. * |-------------------------------------------------------------------|
  8601. * Header fields:
  8602. * - MSG_TYPE
  8603. * Bits 7:0
  8604. * Purpose: Identifies this as WDI_IPA Operation Response message
  8605. * value: = 0x13
  8606. * - OP_CODE
  8607. * Bits 31:16
  8608. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  8609. * value: = enum htt_wdi_ipa_op_code
  8610. * - RSP_LEN
  8611. * Bits 16:0
  8612. * Purpose: length for the response-type specific info
  8613. * value: = length in bytes for response-type specific info
  8614. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  8615. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  8616. */
  8617. PREPACK struct htt_wdi_ipa_op_response_t
  8618. {
  8619. /* DWORD 0: flags and meta-data */
  8620. A_UINT32
  8621. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  8622. reserved1: 8,
  8623. op_code: 16;
  8624. A_UINT32
  8625. rsp_len: 16,
  8626. reserved2: 16;
  8627. } POSTPACK;
  8628. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  8629. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  8630. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  8631. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  8632. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  8633. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  8634. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  8635. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  8636. do { \
  8637. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  8638. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  8639. } while (0)
  8640. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  8641. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  8642. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  8643. do { \
  8644. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  8645. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  8646. } while (0)
  8647. enum htt_phy_mode {
  8648. htt_phy_mode_11a = 0,
  8649. htt_phy_mode_11g = 1,
  8650. htt_phy_mode_11b = 2,
  8651. htt_phy_mode_11g_only = 3,
  8652. htt_phy_mode_11na_ht20 = 4,
  8653. htt_phy_mode_11ng_ht20 = 5,
  8654. htt_phy_mode_11na_ht40 = 6,
  8655. htt_phy_mode_11ng_ht40 = 7,
  8656. htt_phy_mode_11ac_vht20 = 8,
  8657. htt_phy_mode_11ac_vht40 = 9,
  8658. htt_phy_mode_11ac_vht80 = 10,
  8659. htt_phy_mode_11ac_vht20_2g = 11,
  8660. htt_phy_mode_11ac_vht40_2g = 12,
  8661. htt_phy_mode_11ac_vht80_2g = 13,
  8662. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  8663. htt_phy_mode_11ac_vht160 = 15,
  8664. htt_phy_mode_max,
  8665. };
  8666. /**
  8667. * @brief target -> host HTT channel change indication
  8668. * @details
  8669. * Specify when a channel change occurs.
  8670. * This allows the host to precisely determine which rx frames arrived
  8671. * on the old channel and which rx frames arrived on the new channel.
  8672. *
  8673. *|31 |7 0 |
  8674. *|-------------------------------------------+----------|
  8675. *| reserved | msg type |
  8676. *|------------------------------------------------------|
  8677. *| primary_chan_center_freq_mhz |
  8678. *|------------------------------------------------------|
  8679. *| contiguous_chan1_center_freq_mhz |
  8680. *|------------------------------------------------------|
  8681. *| contiguous_chan2_center_freq_mhz |
  8682. *|------------------------------------------------------|
  8683. *| phy_mode |
  8684. *|------------------------------------------------------|
  8685. *
  8686. * Header fields:
  8687. * - MSG_TYPE
  8688. * Bits 7:0
  8689. * Purpose: identifies this as a htt channel change indication message
  8690. * Value: 0x15
  8691. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  8692. * Bits 31:0
  8693. * Purpose: identify the (center of the) new 20 MHz primary channel
  8694. * Value: center frequency of the 20 MHz primary channel, in MHz units
  8695. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  8696. * Bits 31:0
  8697. * Purpose: identify the (center of the) contiguous frequency range
  8698. * comprising the new channel.
  8699. * For example, if the new channel is a 80 MHz channel extending
  8700. * 60 MHz beyond the primary channel, this field would be 30 larger
  8701. * than the primary channel center frequency field.
  8702. * Value: center frequency of the contiguous frequency range comprising
  8703. * the full channel in MHz units
  8704. * (80+80 channels also use the CONTIG_CHAN2 field)
  8705. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  8706. * Bits 31:0
  8707. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  8708. * within a VHT 80+80 channel.
  8709. * This field is only relevant for VHT 80+80 channels.
  8710. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  8711. * channel (arbitrary value for cases besides VHT 80+80)
  8712. * - PHY_MODE
  8713. * Bits 31:0
  8714. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  8715. * and band
  8716. * Value: htt_phy_mode enum value
  8717. */
  8718. PREPACK struct htt_chan_change_t
  8719. {
  8720. /* DWORD 0: flags and meta-data */
  8721. A_UINT32
  8722. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  8723. reserved1: 24;
  8724. A_UINT32 primary_chan_center_freq_mhz;
  8725. A_UINT32 contig_chan1_center_freq_mhz;
  8726. A_UINT32 contig_chan2_center_freq_mhz;
  8727. A_UINT32 phy_mode;
  8728. } POSTPACK;
  8729. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  8730. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  8731. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  8732. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  8733. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  8734. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  8735. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  8736. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  8737. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  8738. do { \
  8739. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  8740. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  8741. } while (0)
  8742. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  8743. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  8744. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  8745. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  8746. do { \
  8747. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  8748. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  8749. } while (0)
  8750. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  8751. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  8752. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  8753. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  8754. do { \
  8755. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  8756. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  8757. } while (0)
  8758. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  8759. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  8760. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  8761. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  8762. do { \
  8763. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  8764. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  8765. } while (0)
  8766. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  8767. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  8768. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  8769. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  8770. /**
  8771. * @brief rx offload packet error message
  8772. *
  8773. * @details
  8774. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  8775. * of target payload like mic err.
  8776. *
  8777. * |31 24|23 16|15 8|7 0|
  8778. * |----------------+----------------+----------------+----------------|
  8779. * | tid | vdev_id | msg_sub_type | msg_type |
  8780. * |-------------------------------------------------------------------|
  8781. * : (sub-type dependent content) :
  8782. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  8783. * Header fields:
  8784. * - msg_type
  8785. * Bits 7:0
  8786. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  8787. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  8788. * - msg_sub_type
  8789. * Bits 15:8
  8790. * Purpose: Identifies which type of rx error is reported by this message
  8791. * value: htt_rx_ofld_pkt_err_type
  8792. * - vdev_id
  8793. * Bits 23:16
  8794. * Purpose: Identifies which vdev received the erroneous rx frame
  8795. * value:
  8796. * - tid
  8797. * Bits 31:24
  8798. * Purpose: Identifies the traffic type of the rx frame
  8799. * value:
  8800. *
  8801. * - The payload fields used if the sub-type == MIC error are shown below.
  8802. * Note - MIC err is per MSDU, while PN is per MPDU.
  8803. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  8804. * with MIC err in A-MSDU case, so FW will send only one HTT message
  8805. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  8806. * instead of sending separate HTT messages for each wrong MSDU within
  8807. * the MPDU.
  8808. *
  8809. * |31 24|23 16|15 8|7 0|
  8810. * |----------------+----------------+----------------+----------------|
  8811. * | Rsvd | key_id | peer_id |
  8812. * |-------------------------------------------------------------------|
  8813. * | receiver MAC addr 31:0 |
  8814. * |-------------------------------------------------------------------|
  8815. * | Rsvd | receiver MAC addr 47:32 |
  8816. * |-------------------------------------------------------------------|
  8817. * | transmitter MAC addr 31:0 |
  8818. * |-------------------------------------------------------------------|
  8819. * | Rsvd | transmitter MAC addr 47:32 |
  8820. * |-------------------------------------------------------------------|
  8821. * | PN 31:0 |
  8822. * |-------------------------------------------------------------------|
  8823. * | Rsvd | PN 47:32 |
  8824. * |-------------------------------------------------------------------|
  8825. * - peer_id
  8826. * Bits 15:0
  8827. * Purpose: identifies which peer is frame is from
  8828. * value:
  8829. * - key_id
  8830. * Bits 23:16
  8831. * Purpose: identifies key_id of rx frame
  8832. * value:
  8833. * - RA_31_0 (receiver MAC addr 31:0)
  8834. * Bits 31:0
  8835. * Purpose: identifies by MAC address which vdev received the frame
  8836. * value: MAC address lower 4 bytes
  8837. * - RA_47_32 (receiver MAC addr 47:32)
  8838. * Bits 15:0
  8839. * Purpose: identifies by MAC address which vdev received the frame
  8840. * value: MAC address upper 2 bytes
  8841. * - TA_31_0 (transmitter MAC addr 31:0)
  8842. * Bits 31:0
  8843. * Purpose: identifies by MAC address which peer transmitted the frame
  8844. * value: MAC address lower 4 bytes
  8845. * - TA_47_32 (transmitter MAC addr 47:32)
  8846. * Bits 15:0
  8847. * Purpose: identifies by MAC address which peer transmitted the frame
  8848. * value: MAC address upper 2 bytes
  8849. * - PN_31_0
  8850. * Bits 31:0
  8851. * Purpose: Identifies pn of rx frame
  8852. * value: PN lower 4 bytes
  8853. * - PN_47_32
  8854. * Bits 15:0
  8855. * Purpose: Identifies pn of rx frame
  8856. * value:
  8857. * TKIP or CCMP: PN upper 2 bytes
  8858. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  8859. */
  8860. enum htt_rx_ofld_pkt_err_type {
  8861. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  8862. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  8863. };
  8864. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  8865. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  8866. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  8867. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  8868. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  8869. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  8870. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  8871. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  8872. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  8873. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  8874. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  8875. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  8876. do { \
  8877. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  8878. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  8879. } while (0)
  8880. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  8881. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  8882. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  8883. do { \
  8884. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  8885. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  8886. } while (0)
  8887. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  8888. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  8889. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  8890. do { \
  8891. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  8892. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  8893. } while (0)
  8894. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  8895. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  8896. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  8897. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  8898. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  8899. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  8900. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  8901. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  8902. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  8903. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  8904. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  8905. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  8906. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  8907. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  8908. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  8909. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  8910. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  8911. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  8912. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  8913. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  8914. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  8915. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  8916. do { \
  8917. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  8918. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  8919. } while (0)
  8920. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  8921. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  8922. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  8923. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  8924. do { \
  8925. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  8926. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  8927. } while (0)
  8928. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  8929. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  8930. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  8931. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  8932. do { \
  8933. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  8934. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  8935. } while (0)
  8936. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  8937. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  8938. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  8939. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  8940. do { \
  8941. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  8942. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  8943. } while (0)
  8944. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  8945. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  8946. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  8947. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  8948. do { \
  8949. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  8950. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  8951. } while (0)
  8952. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  8953. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  8954. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  8955. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  8956. do { \
  8957. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  8958. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  8959. } while (0)
  8960. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  8961. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  8962. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  8963. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  8964. do { \
  8965. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  8966. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  8967. } while (0)
  8968. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  8969. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  8970. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  8971. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  8972. do { \
  8973. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  8974. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  8975. } while (0)
  8976. /**
  8977. * @brief peer rate report message
  8978. *
  8979. * @details
  8980. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  8981. * justified rate of all the peers.
  8982. *
  8983. * |31 24|23 16|15 8|7 0|
  8984. * |----------------+----------------+----------------+----------------|
  8985. * | peer_count | | msg_type |
  8986. * |-------------------------------------------------------------------|
  8987. * : Payload (variant number of peer rate report) :
  8988. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  8989. * Header fields:
  8990. * - msg_type
  8991. * Bits 7:0
  8992. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  8993. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  8994. * - reserved
  8995. * Bits 15:8
  8996. * Purpose:
  8997. * value:
  8998. * - peer_count
  8999. * Bits 31:16
  9000. * Purpose: Specify how many peer rate report elements are present in the payload.
  9001. * value:
  9002. *
  9003. * Payload:
  9004. * There are variant number of peer rate report follow the first 32 bits.
  9005. * The peer rate report is defined as follows.
  9006. *
  9007. * |31 20|19 16|15 0|
  9008. * |-----------------------+---------+---------------------------------|-
  9009. * | reserved | phy | peer_id | \
  9010. * |-------------------------------------------------------------------| -> report #0
  9011. * | rate | /
  9012. * |-----------------------+---------+---------------------------------|-
  9013. * | reserved | phy | peer_id | \
  9014. * |-------------------------------------------------------------------| -> report #1
  9015. * | rate | /
  9016. * |-----------------------+---------+---------------------------------|-
  9017. * | reserved | phy | peer_id | \
  9018. * |-------------------------------------------------------------------| -> report #2
  9019. * | rate | /
  9020. * |-------------------------------------------------------------------|-
  9021. * : :
  9022. * : :
  9023. * : :
  9024. * :-------------------------------------------------------------------:
  9025. *
  9026. * - peer_id
  9027. * Bits 15:0
  9028. * Purpose: identify the peer
  9029. * value:
  9030. * - phy
  9031. * Bits 19:16
  9032. * Purpose: identify which phy is in use
  9033. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  9034. * Please see enum htt_peer_report_phy_type for detail.
  9035. * - reserved
  9036. * Bits 31:20
  9037. * Purpose:
  9038. * value:
  9039. * - rate
  9040. * Bits 31:0
  9041. * Purpose: represent the justified rate of the peer specified by peer_id
  9042. * value:
  9043. */
  9044. enum htt_peer_rate_report_phy_type {
  9045. HTT_PEER_RATE_REPORT_11B = 0,
  9046. HTT_PEER_RATE_REPORT_11A_G,
  9047. HTT_PEER_RATE_REPORT_11N,
  9048. HTT_PEER_RATE_REPORT_11AC,
  9049. };
  9050. #define HTT_PEER_RATE_REPORT_SIZE 8
  9051. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  9052. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  9053. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  9054. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  9055. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  9056. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  9057. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  9058. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  9059. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  9060. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  9061. do { \
  9062. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  9063. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  9064. } while (0)
  9065. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  9066. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  9067. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  9068. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  9069. do { \
  9070. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  9071. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  9072. } while (0)
  9073. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  9074. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  9075. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  9076. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  9077. do { \
  9078. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  9079. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  9080. } while (0)
  9081. /**
  9082. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_MAP Message
  9083. *
  9084. * @details
  9085. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  9086. * a flow of descriptors.
  9087. *
  9088. * This message is in TLV format and indicates the parameters to be setup a
  9089. * flow in the host. Each entry indicates that a particular flow ID is ready to
  9090. * receive descriptors from a specified pool.
  9091. *
  9092. * The message would appear as follows:
  9093. *
  9094. * |31 24|23 16|15 8|7 0|
  9095. * |----------------+----------------+----------------+----------------|
  9096. * header | reserved | num_flows | msg_type |
  9097. * |-------------------------------------------------------------------|
  9098. * | |
  9099. * : payload :
  9100. * | |
  9101. * |-------------------------------------------------------------------|
  9102. *
  9103. * The header field is one DWORD long and is interpreted as follows:
  9104. * b'0:7 - msg_type: This will be set to HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  9105. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  9106. * this message
  9107. * b'16-31 - reserved: These bits are reserved for future use
  9108. *
  9109. * Payload:
  9110. * The payload would contain multiple objects of the following structure. Each
  9111. * object represents a flow.
  9112. *
  9113. * |31 24|23 16|15 8|7 0|
  9114. * |----------------+----------------+----------------+----------------|
  9115. * header | reserved | num_flows | msg_type |
  9116. * |-------------------------------------------------------------------|
  9117. * payload0| flow_type |
  9118. * |-------------------------------------------------------------------|
  9119. * | flow_id |
  9120. * |-------------------------------------------------------------------|
  9121. * | reserved0 | flow_pool_id |
  9122. * |-------------------------------------------------------------------|
  9123. * | reserved1 | flow_pool_size |
  9124. * |-------------------------------------------------------------------|
  9125. * | reserved2 |
  9126. * |-------------------------------------------------------------------|
  9127. * payload1| flow_type |
  9128. * |-------------------------------------------------------------------|
  9129. * | flow_id |
  9130. * |-------------------------------------------------------------------|
  9131. * | reserved0 | flow_pool_id |
  9132. * |-------------------------------------------------------------------|
  9133. * | reserved1 | flow_pool_size |
  9134. * |-------------------------------------------------------------------|
  9135. * | reserved2 |
  9136. * |-------------------------------------------------------------------|
  9137. * | . |
  9138. * | . |
  9139. * | . |
  9140. * |-------------------------------------------------------------------|
  9141. *
  9142. * Each payload is 5 DWORDS long and is interpreted as follows:
  9143. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  9144. * this flow is associated. It can be VDEV, peer,
  9145. * or tid (AC). Based on enum htt_flow_type.
  9146. *
  9147. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  9148. * object. For flow_type vdev it is set to the
  9149. * vdevid, for peer it is peerid and for tid, it is
  9150. * tid_num.
  9151. *
  9152. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  9153. * in the host for this flow
  9154. * b'16:31 - reserved0: This field in reserved for the future. In case
  9155. * we have a hierarchical implementation (HCM) of
  9156. * pools, it can be used to indicate the ID of the
  9157. * parent-pool.
  9158. *
  9159. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  9160. * Descriptors for this flow will be
  9161. * allocated from this pool in the host.
  9162. * b'16:31 - reserved1: This field in reserved for the future. In case
  9163. * we have a hierarchical implementation of pools,
  9164. * it can be used to indicate the max number of
  9165. * descriptors in the pool. The b'0:15 can be used
  9166. * to indicate min number of descriptors in the
  9167. * HCM scheme.
  9168. *
  9169. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  9170. * we have a hierarchical implementation of pools,
  9171. * b'0:15 can be used to indicate the
  9172. * priority-based borrowing (PBB) threshold of
  9173. * the flow's pool. The b'16:31 are still left
  9174. * reserved.
  9175. */
  9176. enum htt_flow_type {
  9177. FLOW_TYPE_VDEV = 0,
  9178. /* Insert new flow types above this line */
  9179. };
  9180. PREPACK struct htt_flow_pool_map_payload_t {
  9181. A_UINT32 flow_type;
  9182. A_UINT32 flow_id;
  9183. A_UINT32 flow_pool_id:16,
  9184. reserved0:16;
  9185. A_UINT32 flow_pool_size:16,
  9186. reserved1:16;
  9187. A_UINT32 reserved2;
  9188. } POSTPACK;
  9189. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  9190. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  9191. (sizeof(struct htt_flow_pool_map_payload_t))
  9192. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  9193. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  9194. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  9195. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  9196. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  9197. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  9198. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  9199. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  9200. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  9201. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  9202. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  9203. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  9204. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  9205. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  9206. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  9207. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  9208. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  9209. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  9210. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  9211. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  9212. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  9213. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  9214. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  9215. do { \
  9216. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  9217. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  9218. } while (0)
  9219. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  9220. do { \
  9221. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  9222. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  9223. } while (0)
  9224. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  9225. do { \
  9226. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  9227. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  9228. } while (0)
  9229. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  9230. do { \
  9231. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  9232. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  9233. } while (0)
  9234. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  9235. do { \
  9236. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  9237. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  9238. } while (0)
  9239. /**
  9240. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP Message
  9241. *
  9242. * @details
  9243. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  9244. * down a flow of descriptors.
  9245. * This message indicates that for the flow (whose ID is provided) is wanting
  9246. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  9247. * pool of descriptors from where descriptors are being allocated for this
  9248. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  9249. * be unmapped by the host.
  9250. *
  9251. * The message would appear as follows:
  9252. *
  9253. * |31 24|23 16|15 8|7 0|
  9254. * |----------------+----------------+----------------+----------------|
  9255. * | reserved0 | msg_type |
  9256. * |-------------------------------------------------------------------|
  9257. * | flow_type |
  9258. * |-------------------------------------------------------------------|
  9259. * | flow_id |
  9260. * |-------------------------------------------------------------------|
  9261. * | reserved1 | flow_pool_id |
  9262. * |-------------------------------------------------------------------|
  9263. *
  9264. * The message is interpreted as follows:
  9265. * dword0 - b'0:7 - msg_type: This will be set to
  9266. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  9267. * b'8:31 - reserved0: Reserved for future use
  9268. *
  9269. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  9270. * this flow is associated. It can be VDEV, peer,
  9271. * or tid (AC). Based on enum htt_flow_type.
  9272. *
  9273. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  9274. * object. For flow_type vdev it is set to the
  9275. * vdevid, for peer it is peerid and for tid, it is
  9276. * tid_num.
  9277. *
  9278. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  9279. * used in the host for this flow
  9280. * b'16:31 - reserved0: This field in reserved for the future.
  9281. *
  9282. */
  9283. PREPACK struct htt_flow_pool_unmap_t {
  9284. A_UINT32 msg_type:8,
  9285. reserved0:24;
  9286. A_UINT32 flow_type;
  9287. A_UINT32 flow_id;
  9288. A_UINT32 flow_pool_id:16,
  9289. reserved1:16;
  9290. } POSTPACK;
  9291. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  9292. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  9293. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  9294. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  9295. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  9296. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  9297. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  9298. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  9299. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  9300. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  9301. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  9302. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  9303. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  9304. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  9305. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  9306. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  9307. do { \
  9308. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  9309. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  9310. } while (0)
  9311. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  9312. do { \
  9313. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  9314. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  9315. } while (0)
  9316. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  9317. do { \
  9318. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  9319. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  9320. } while (0)
  9321. /**
  9322. * @brief HTT_T2H_MSG_TYPE_SRING_SETUP_DONE Message
  9323. *
  9324. * @details
  9325. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  9326. * SRNG ring setup is done
  9327. *
  9328. * This message indicates whether the last setup operation is successful.
  9329. * It will be sent to host when host set respose_required bit in
  9330. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  9331. * The message would appear as follows:
  9332. *
  9333. * |31 24|23 16|15 8|7 0|
  9334. * |--------------- +----------------+----------------+----------------|
  9335. * | setup_status | ring_id | pdev_id | msg_type |
  9336. * |-------------------------------------------------------------------|
  9337. *
  9338. * The message is interpreted as follows:
  9339. * dword0 - b'0:7 - msg_type: This will be set to
  9340. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  9341. * b'8:15 - pdev_id:
  9342. * 0 (for rings at SOC/UMAC level),
  9343. * 1/2/3 mac id (for rings at LMAC level)
  9344. * b'16:23 - ring_id: Identify the ring which is set up
  9345. * More details can be got from enum htt_srng_ring_id
  9346. * b'24:31 - setup_status: Indicate status of setup operation
  9347. * Refer to htt_ring_setup_status
  9348. */
  9349. PREPACK struct htt_sring_setup_done_t {
  9350. A_UINT32 msg_type: 8,
  9351. pdev_id: 8,
  9352. ring_id: 8,
  9353. setup_status: 8;
  9354. } POSTPACK;
  9355. enum htt_ring_setup_status {
  9356. htt_ring_setup_status_ok = 0,
  9357. htt_ring_setup_status_error,
  9358. };
  9359. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  9360. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  9361. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  9362. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  9363. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  9364. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  9365. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  9366. do { \
  9367. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  9368. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  9369. } while (0)
  9370. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  9371. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  9372. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  9373. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  9374. HTT_SRING_SETUP_DONE_RING_ID_S)
  9375. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  9376. do { \
  9377. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  9378. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  9379. } while (0)
  9380. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  9381. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  9382. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  9383. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  9384. HTT_SRING_SETUP_DONE_STATUS_S)
  9385. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  9386. do { \
  9387. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  9388. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  9389. } while (0)
  9390. /**
  9391. * @brief HTT_T2H_MSG_TYPE_MAP_FLOW_INFO Message
  9392. *
  9393. * @details
  9394. * HTT TX map flow entry with tqm flow pointer
  9395. * Sent from firmware to host to add tqm flow pointer in corresponding
  9396. * flow search entry. Flow metadata is replayed back to host as part of this
  9397. * struct to enable host to find the specific flow search entry
  9398. *
  9399. * The message would appear as follows:
  9400. *
  9401. * |31 28|27 18|17 14|13 8|7 0|
  9402. * |-------+------------------------------------------+----------------|
  9403. * | rsvd0 | fse_hsh_idx | msg_type |
  9404. * |-------------------------------------------------------------------|
  9405. * | rsvd1 | tid | peer_id |
  9406. * |-------------------------------------------------------------------|
  9407. * | tqm_flow_pntr_lo |
  9408. * |-------------------------------------------------------------------|
  9409. * | tqm_flow_pntr_hi |
  9410. * |-------------------------------------------------------------------|
  9411. * | fse_meta_data |
  9412. * |-------------------------------------------------------------------|
  9413. *
  9414. * The message is interpreted as follows:
  9415. *
  9416. * dword0 - b'0:7 - msg_type: This will be set to
  9417. * HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  9418. *
  9419. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  9420. * for this flow entry
  9421. *
  9422. * dword0 - b'28:31 - rsvd0: Reserved for future use
  9423. *
  9424. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  9425. *
  9426. * dword1 - b'14:17 - tid
  9427. *
  9428. * dword1 - b'18:31 - rsvd1: Reserved for future use
  9429. *
  9430. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  9431. *
  9432. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  9433. *
  9434. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  9435. * given by host
  9436. */
  9437. PREPACK struct htt_tx_map_flow_info {
  9438. A_UINT32
  9439. msg_type: 8,
  9440. fse_hsh_idx: 20,
  9441. rsvd0: 4;
  9442. A_UINT32
  9443. peer_id: 14,
  9444. tid: 4,
  9445. rsvd1: 14;
  9446. A_UINT32 tqm_flow_pntr_lo;
  9447. A_UINT32 tqm_flow_pntr_hi;
  9448. struct htt_tx_flow_metadata fse_meta_data;
  9449. } POSTPACK;
  9450. /* DWORD 0 */
  9451. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  9452. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  9453. /* DWORD 1 */
  9454. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  9455. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  9456. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  9457. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  9458. /* DWORD 0 */
  9459. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  9460. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  9461. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  9462. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  9463. do { \
  9464. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  9465. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  9466. } while (0)
  9467. /* DWORD 1 */
  9468. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  9469. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  9470. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  9471. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  9472. do { \
  9473. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  9474. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  9475. } while (0)
  9476. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  9477. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  9478. HTT_TX_MAP_FLOW_INFO_TID_S)
  9479. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  9480. do { \
  9481. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  9482. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  9483. } while (0)
  9484. /*
  9485. * htt_dbg_ext_stats_status -
  9486. * present - The requested stats have been delivered in full.
  9487. * This indicates that either the stats information was contained
  9488. * in its entirety within this message, or else this message
  9489. * completes the delivery of the requested stats info that was
  9490. * partially delivered through earlier STATS_CONF messages.
  9491. * partial - The requested stats have been delivered in part.
  9492. * One or more subsequent STATS_CONF messages with the same
  9493. * cookie value will be sent to deliver the remainder of the
  9494. * information.
  9495. * error - The requested stats could not be delivered, for example due
  9496. * to a shortage of memory to construct a message holding the
  9497. * requested stats.
  9498. * invalid - The requested stat type is either not recognized, or the
  9499. * target is configured to not gather the stats type in question.
  9500. */
  9501. enum htt_dbg_ext_stats_status {
  9502. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  9503. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  9504. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  9505. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  9506. };
  9507. /**
  9508. * @brief target -> host ppdu stats upload
  9509. *
  9510. * @details
  9511. * The following field definitions describe the format of the HTT target
  9512. * to host ppdu stats indication message.
  9513. *
  9514. *
  9515. * |31 16|15 12|11 10|9 8|7 0 |
  9516. * |----------------------------------------------------------------------|
  9517. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  9518. * |----------------------------------------------------------------------|
  9519. * | ppdu_id |
  9520. * |----------------------------------------------------------------------|
  9521. * | Timestamp in us |
  9522. * |----------------------------------------------------------------------|
  9523. * | reserved |
  9524. * |----------------------------------------------------------------------|
  9525. * | type-specific stats info |
  9526. * | (see htt_ppdu_stats.h) |
  9527. * |----------------------------------------------------------------------|
  9528. * Header fields:
  9529. * - MSG_TYPE
  9530. * Bits 7:0
  9531. * Purpose: Identifies this is a PPDU STATS indication
  9532. * message.
  9533. * Value: 0x1d
  9534. * - mac_id
  9535. * Bits 9:8
  9536. * Purpose: mac_id of this ppdu_id
  9537. * Value: 0-3
  9538. * - pdev_id
  9539. * Bits 11:10
  9540. * Purpose: pdev_id of this ppdu_id
  9541. * Value: 0-3
  9542. * 0 (for rings at SOC level),
  9543. * 1/2/3 PDEV -> 0/1/2
  9544. * - payload_size
  9545. * Bits 31:16
  9546. * Purpose: total tlv size
  9547. * Value: payload_size in bytes
  9548. */
  9549. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  9550. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  9551. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  9552. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  9553. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  9554. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  9555. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  9556. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  9557. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  9558. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  9559. do { \
  9560. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  9561. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  9562. } while (0)
  9563. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  9564. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  9565. HTT_T2H_PPDU_STATS_MAC_ID_S)
  9566. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  9567. do { \
  9568. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  9569. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  9570. } while (0)
  9571. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  9572. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  9573. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  9574. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  9575. do { \
  9576. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  9577. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  9578. } while (0)
  9579. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  9580. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  9581. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  9582. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  9583. do { \
  9584. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  9585. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  9586. } while (0)
  9587. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  9588. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  9589. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  9590. /* htt_t2h_ppdu_stats_ind_hdr_t
  9591. * This struct contains the fields within the header of the
  9592. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  9593. * stats info.
  9594. * This struct assumes little-endian layout, and thus is only
  9595. * suitable for use within processors known to be little-endian
  9596. * (such as the target).
  9597. * In contrast, the above macros provide endian-portable methods
  9598. * to get and set the bitfields within this PPDU_STATS_IND header.
  9599. */
  9600. typedef struct {
  9601. A_UINT32 msg_type: 8, /* bits 7:0 */
  9602. mac_id: 2, /* bits 9:8 */
  9603. pdev_id: 2, /* bits 11:10 */
  9604. reserved1: 4, /* bits 15:12 */
  9605. payload_size: 16; /* bits 31:16 */
  9606. A_UINT32 ppdu_id;
  9607. A_UINT32 timestamp_us;
  9608. A_UINT32 reserved2;
  9609. } htt_t2h_ppdu_stats_ind_hdr_t;
  9610. /**
  9611. * @brief target -> host extended statistics upload
  9612. *
  9613. * @details
  9614. * The following field definitions describe the format of the HTT target
  9615. * to host stats upload confirmation message.
  9616. * The message contains a cookie echoed from the HTT host->target stats
  9617. * upload request, which identifies which request the confirmation is
  9618. * for, and a single stats can span over multiple HTT stats indication
  9619. * due to the HTT message size limitation so every HTT ext stats indication
  9620. * will have tag-length-value stats information elements.
  9621. * The tag-length header for each HTT stats IND message also includes a
  9622. * status field, to indicate whether the request for the stat type in
  9623. * question was fully met, partially met, unable to be met, or invalid
  9624. * (if the stat type in question is disabled in the target).
  9625. * A Done bit 1's indicate the end of the of stats info elements.
  9626. *
  9627. *
  9628. * |31 16|15 12|11|10 8|7 5|4 0|
  9629. * |--------------------------------------------------------------|
  9630. * | reserved | msg type |
  9631. * |--------------------------------------------------------------|
  9632. * | cookie LSBs |
  9633. * |--------------------------------------------------------------|
  9634. * | cookie MSBs |
  9635. * |--------------------------------------------------------------|
  9636. * | stats entry length | rsvd | D| S | stat type |
  9637. * |--------------------------------------------------------------|
  9638. * | type-specific stats info |
  9639. * | (see htt_stats.h) |
  9640. * |--------------------------------------------------------------|
  9641. * Header fields:
  9642. * - MSG_TYPE
  9643. * Bits 7:0
  9644. * Purpose: Identifies this is a extended statistics upload confirmation
  9645. * message.
  9646. * Value: 0x1c
  9647. * - COOKIE_LSBS
  9648. * Bits 31:0
  9649. * Purpose: Provide a mechanism to match a target->host stats confirmation
  9650. * message with its preceding host->target stats request message.
  9651. * Value: LSBs of the opaque cookie specified by the host-side requestor
  9652. * - COOKIE_MSBS
  9653. * Bits 31:0
  9654. * Purpose: Provide a mechanism to match a target->host stats confirmation
  9655. * message with its preceding host->target stats request message.
  9656. * Value: MSBs of the opaque cookie specified by the host-side requestor
  9657. *
  9658. * Stats Information Element tag-length header fields:
  9659. * - STAT_TYPE
  9660. * Bits 7:0
  9661. * Purpose: identifies the type of statistics info held in the
  9662. * following information element
  9663. * Value: htt_dbg_ext_stats_type
  9664. * - STATUS
  9665. * Bits 10:8
  9666. * Purpose: indicate whether the requested stats are present
  9667. * Value: htt_dbg_ext_stats_status
  9668. * - DONE
  9669. * Bits 11
  9670. * Purpose:
  9671. * Indicates the completion of the stats entry, this will be the last
  9672. * stats conf HTT segment for the requested stats type.
  9673. * Value:
  9674. * 0 -> the stats retrieval is ongoing
  9675. * 1 -> the stats retrieval is complete
  9676. * - LENGTH
  9677. * Bits 31:16
  9678. * Purpose: indicate the stats information size
  9679. * Value: This field specifies the number of bytes of stats information
  9680. * that follows the element tag-length header.
  9681. * It is expected but not required that this length is a multiple of
  9682. * 4 bytes.
  9683. */
  9684. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  9685. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  9686. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  9687. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  9688. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  9689. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  9690. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  9691. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  9692. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  9693. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  9694. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  9695. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  9696. do { \
  9697. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  9698. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  9699. } while (0)
  9700. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  9701. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  9702. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  9703. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  9704. do { \
  9705. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  9706. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  9707. } while (0)
  9708. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  9709. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  9710. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  9711. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  9712. do { \
  9713. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  9714. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  9715. } while (0)
  9716. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  9717. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  9718. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  9719. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  9720. do { \
  9721. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  9722. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  9723. } while (0)
  9724. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  9725. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  9726. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  9727. typedef enum {
  9728. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  9729. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  9730. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  9731. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  9732. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  9733. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  9734. /* Reserved from 128 - 255 for target internal use.*/
  9735. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  9736. } HTT_PEER_TYPE;
  9737. /** 2 word representation of MAC addr */
  9738. typedef struct {
  9739. /** upper 4 bytes of MAC address */
  9740. A_UINT32 mac_addr31to0;
  9741. /** lower 2 bytes of MAC address */
  9742. A_UINT32 mac_addr47to32;
  9743. } htt_mac_addr;
  9744. /** macro to convert MAC address from char array to HTT word format */
  9745. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  9746. (phtt_mac_addr)->mac_addr31to0 = \
  9747. (((c_macaddr)[0] << 0) | \
  9748. ((c_macaddr)[1] << 8) | \
  9749. ((c_macaddr)[2] << 16) | \
  9750. ((c_macaddr)[3] << 24)); \
  9751. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  9752. } while (0)
  9753. /**
  9754. * @brief target -> host monitor mac header indication message
  9755. *
  9756. * @details
  9757. * The following diagram shows the format of the monitor mac header message
  9758. * sent from the target to the host.
  9759. * This message is primarily sent when promiscuous rx mode is enabled.
  9760. * One message is sent per rx PPDU.
  9761. *
  9762. * |31 24|23 16|15 8|7 0|
  9763. * |-------------------------------------------------------------|
  9764. * | peer_id | reserved0 | msg_type |
  9765. * |-------------------------------------------------------------|
  9766. * | reserved1 | num_mpdu |
  9767. * |-------------------------------------------------------------|
  9768. * | struct hw_rx_desc |
  9769. * | (see wal_rx_desc.h) |
  9770. * |-------------------------------------------------------------|
  9771. * | struct ieee80211_frame_addr4 |
  9772. * | (see ieee80211_defs.h) |
  9773. * |-------------------------------------------------------------|
  9774. * | struct ieee80211_frame_addr4 |
  9775. * | (see ieee80211_defs.h) |
  9776. * |-------------------------------------------------------------|
  9777. * | ...... |
  9778. * |-------------------------------------------------------------|
  9779. *
  9780. * Header fields:
  9781. * - msg_type
  9782. * Bits 7:0
  9783. * Purpose: Identifies this is a monitor mac header indication message.
  9784. * Value: 0x20
  9785. * - peer_id
  9786. * Bits 31:16
  9787. * Purpose: Software peer id given by host during association,
  9788. * During promiscuous mode, the peer ID will be invalid (0xFF)
  9789. * for rx PPDUs received from unassociated peers.
  9790. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  9791. * - num_mpdu
  9792. * Bits 15:0
  9793. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  9794. * delivered within the message.
  9795. * Value: 1 to 32
  9796. * num_mpdu is limited to a maximum value of 32, due to buffer
  9797. * size limits. For PPDUs with more than 32 MPDUs, only the
  9798. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  9799. * the PPDU will be provided.
  9800. */
  9801. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  9802. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  9803. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  9804. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  9805. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  9806. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  9807. do { \
  9808. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  9809. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  9810. } while (0)
  9811. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  9812. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  9813. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  9814. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  9815. do { \
  9816. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  9817. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  9818. } while (0)
  9819. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  9820. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  9821. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  9822. /**
  9823. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE Message
  9824. *
  9825. * @details
  9826. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  9827. * the flow pool associated with the specified ID is resized
  9828. *
  9829. * The message would appear as follows:
  9830. *
  9831. * |31 16|15 8|7 0|
  9832. * |---------------------------------+----------------+----------------|
  9833. * | reserved0 | Msg type |
  9834. * |-------------------------------------------------------------------|
  9835. * | flow pool new size | flow pool ID |
  9836. * |-------------------------------------------------------------------|
  9837. *
  9838. * The message is interpreted as follows:
  9839. * b'0:7 - msg_type: This will be set to
  9840. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  9841. *
  9842. * b'0:15 - flow pool ID: Existing flow pool ID
  9843. *
  9844. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  9845. *
  9846. */
  9847. PREPACK struct htt_flow_pool_resize_t {
  9848. A_UINT32 msg_type:8,
  9849. reserved0:24;
  9850. A_UINT32 flow_pool_id:16,
  9851. flow_pool_new_size:16;
  9852. } POSTPACK;
  9853. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  9854. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  9855. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  9856. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  9857. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  9858. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  9859. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  9860. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  9861. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  9862. do { \
  9863. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  9864. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  9865. } while (0)
  9866. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  9867. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  9868. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  9869. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  9870. do { \
  9871. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  9872. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  9873. } while (0)
  9874. /**
  9875. * @brief host -> target channel change message
  9876. *
  9877. * @details
  9878. * the meesage is generated by FW every time FW changes channel. This will be used by host mainly
  9879. * to associate RX frames to correct channel they were received on.
  9880. * The following field definitions describe the format of the HTT target
  9881. * to host channel change message.
  9882. * |31 16|15 8|7 5|4 0|
  9883. * |------------------------------------------------------------|
  9884. * | reserved | MSG_TYPE |
  9885. * |------------------------------------------------------------|
  9886. * | CHAN_MHZ |
  9887. * |------------------------------------------------------------|
  9888. * | BAND_CENTER_FREQ1 |
  9889. * |------------------------------------------------------------|
  9890. * | BAND_CENTER_FREQ2 |
  9891. * |------------------------------------------------------------|
  9892. * | CHAN_PHY_MODE |
  9893. * |------------------------------------------------------------|
  9894. * Header fields:
  9895. * - MSG_TYPE
  9896. * Bits 7:0
  9897. * Value: 0xf
  9898. * - CHAN_MHZ
  9899. * Bits 31:0
  9900. * Purpose: frequency of the primary 20mhz channel.
  9901. * - BAND_CENTER_FREQ1
  9902. * Bits 31:0
  9903. * Purpose: centre frequency of the full channel.
  9904. * - BAND_CENTER_FREQ2
  9905. * Bits 31:0
  9906. * Purpose: centre frequency2 of the channel. is only valid for 11acvht 80plus80.
  9907. * - CHAN_PHY_MODE
  9908. * Bits 31:0
  9909. * Purpose: phy mode of the channel.
  9910. */
  9911. PREPACK struct htt_chan_change_msg {
  9912. A_UINT32 chan_mhz; /* frequency in mhz */
  9913. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz*/
  9914. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  9915. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  9916. } POSTPACK;
  9917. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  9918. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  9919. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  9920. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  9921. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  9922. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  9923. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  9924. /*
  9925. * The read and write indices point to the data within the host buffer.
  9926. * Because the first 4 bytes of the host buffer is used for the read index and
  9927. * the next 4 bytes for the write index, the data itself starts at offset 8.
  9928. * The read index and write index are the byte offsets from the base of the
  9929. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  9930. * Refer the ASCII text picture below.
  9931. */
  9932. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  9933. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  9934. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  9935. /*
  9936. ***************************************************************************
  9937. *
  9938. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  9939. *
  9940. ***************************************************************************
  9941. *
  9942. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  9943. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  9944. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  9945. * written into the Host memory region mentioned below.
  9946. *
  9947. * Read index is updated by the Host. At any point of time, the read index will
  9948. * indicate the index that will next be read by the Host. The read index is
  9949. * in units of bytes offset from the base of the meta-data buffer.
  9950. *
  9951. * Write index is updated by the FW. At any point of time, the write index will
  9952. * indicate from where the FW can start writing any new data. The write index is
  9953. * in units of bytes offset from the base of the meta-data buffer.
  9954. *
  9955. * If the Host is not fast enough in reading the CFR data, any new capture data
  9956. * would be dropped if there is no space left to write the new captures.
  9957. *
  9958. * The last 4 bytes of the memory region will have the magic pattern
  9959. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  9960. * not overrun the host buffer.
  9961. *
  9962. * ,--------------------. read and write indices store the
  9963. * | | byte offset from the base of the
  9964. * | ,--------+--------. meta-data buffer to the next
  9965. * | | | | location within the data buffer
  9966. * | | v v that will be read / written
  9967. * ************************************************************************
  9968. * * Read * Write * * Magic *
  9969. * * index * index * CFR data1 ...... CFR data N * pattern *
  9970. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  9971. * ************************************************************************
  9972. * |<---------- data buffer ---------->|
  9973. *
  9974. * |<----------------- meta-data buffer allocated in Host ----------------|
  9975. *
  9976. * Note:
  9977. * - Considering the 4 bytes needed to store the Read index (R) and the
  9978. * Write index (W), the initial value is as follows:
  9979. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  9980. * - Buffer empty condition:
  9981. * R = W
  9982. *
  9983. * Regarding CFR data format:
  9984. * --------------------------
  9985. *
  9986. * Each CFR tone is stored in HW as 16-bits with the following format:
  9987. * {bits[15:12], bits[11:6], bits[5:0]} =
  9988. * {unsigned exponent (4 bits),
  9989. * signed mantissa_real (6 bits),
  9990. * signed mantissa_imag (6 bits)}
  9991. *
  9992. * CFR_real = mantissa_real * 2^(exponent-5)
  9993. * CFR_imag = mantissa_imag * 2^(exponent-5)
  9994. *
  9995. *
  9996. * The CFR data is written to the 16-bit unsigned output array (buff) in
  9997. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  9998. *
  9999. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  10000. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  10001. * .
  10002. * .
  10003. * .
  10004. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  10005. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  10006. */
  10007. /* Bandwidth of peer CFR captures */
  10008. typedef enum {
  10009. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  10010. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  10011. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  10012. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  10013. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  10014. HTT_PEER_CFR_CAPTURE_BW_MAX,
  10015. } HTT_PEER_CFR_CAPTURE_BW;
  10016. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  10017. * was captured
  10018. */
  10019. typedef enum {
  10020. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  10021. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  10022. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  10023. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  10024. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  10025. } HTT_PEER_CFR_CAPTURE_MODE;
  10026. typedef enum {
  10027. /* This message type is currently used for the below purpose:
  10028. *
  10029. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  10030. * wmi_peer_cfr_capture_cmd.
  10031. * If payload_present bit is set to 0 then the associated memory region
  10032. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  10033. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  10034. * message; the CFR dump will be present at the end of the message,
  10035. * after the chan_phy_mode.
  10036. */
  10037. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  10038. /* Always keep this last */
  10039. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  10040. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  10041. /**
  10042. * @brief target -> host CFR dump completion indication message definition
  10043. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  10044. *
  10045. * @details
  10046. * The following diagram shows the format of the Channel Frequency Response
  10047. * (CFR) dump completion indication. This inidcation is sent to the Host when
  10048. * the channel capture of a peer is copied by Firmware into the Host memory
  10049. *
  10050. * **************************************************************************
  10051. *
  10052. * Message format when the CFR capture message type is
  10053. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  10054. *
  10055. * **************************************************************************
  10056. *
  10057. * |31 16|15 |8|7 0|
  10058. * |----------------------------------------------------------------|
  10059. * header: | reserved |P| msg_type |
  10060. * word 0 | | | |
  10061. * |----------------------------------------------------------------|
  10062. * payload: | cfr_capture_msg_type |
  10063. * word 1 | |
  10064. * |----------------------------------------------------------------|
  10065. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  10066. * word 2 | | | | | | | | |
  10067. * |----------------------------------------------------------------|
  10068. * | mac_addr31to0 |
  10069. * word 3 | |
  10070. * |----------------------------------------------------------------|
  10071. * | unused / reserved | mac_addr47to32 |
  10072. * word 4 | | |
  10073. * |----------------------------------------------------------------|
  10074. * | index |
  10075. * word 5 | |
  10076. * |----------------------------------------------------------------|
  10077. * | length |
  10078. * word 6 | |
  10079. * |----------------------------------------------------------------|
  10080. * | timestamp |
  10081. * word 7 | |
  10082. * |----------------------------------------------------------------|
  10083. * | counter |
  10084. * word 8 | |
  10085. * |----------------------------------------------------------------|
  10086. * | chan_mhz |
  10087. * word 9 | |
  10088. * |----------------------------------------------------------------|
  10089. * | band_center_freq1 |
  10090. * word 10 | |
  10091. * |----------------------------------------------------------------|
  10092. * | band_center_freq2 |
  10093. * word 11 | |
  10094. * |----------------------------------------------------------------|
  10095. * | chan_phy_mode |
  10096. * word 12 | |
  10097. * |----------------------------------------------------------------|
  10098. * where,
  10099. * P - payload present bit (payload_present explained below)
  10100. * req_id - memory request id (mem_req_id explained below)
  10101. * S - status field (status explained below)
  10102. * capbw - capture bandwidth (capture_bw explained below)
  10103. * mode - mode of capture (mode explained below)
  10104. * sts - space time streams (sts_count explained below)
  10105. * chbw - channel bandwidth (channel_bw explained below)
  10106. * captype - capture type (cap_type explained below)
  10107. *
  10108. * The following field definitions describe the format of the CFR dump
  10109. * completion indication sent from the target to the host
  10110. *
  10111. * Header fields:
  10112. *
  10113. * Word 0
  10114. * - msg_type
  10115. * Bits 7:0
  10116. * Purpose: Identifies this as CFR TX completion indication
  10117. * Value: HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  10118. * - payload_present
  10119. * Bit 8
  10120. * Purpose: Identifies how CFR data is sent to host
  10121. * Value: 0 - If CFR Payload is written to host memory
  10122. * 1 - If CFR Payload is sent as part of HTT message
  10123. * (This is the requirement for SDIO/USB where it is
  10124. * not possible to write CFR data to host memory)
  10125. * - reserved
  10126. * Bits 31:9
  10127. * Purpose: Reserved
  10128. * Value: 0
  10129. *
  10130. * Payload fields:
  10131. *
  10132. * Word 1
  10133. * - cfr_capture_msg_type
  10134. * Bits 31:0
  10135. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  10136. * to specify the format used for the remainder of the message
  10137. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  10138. * (currently only MSG_TYPE_1 is defined)
  10139. *
  10140. * Word 2
  10141. * - mem_req_id
  10142. * Bits 6:0
  10143. * Purpose: Contain the mem request id of the region where the CFR capture
  10144. * has been stored - of type WMI_HOST_MEM_REQ_ID
  10145. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  10146. this value is invalid)
  10147. * - status
  10148. * Bit 7
  10149. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  10150. * Value: 1 (True) - Successful; 0 (False) - Not successful
  10151. * - capture_bw
  10152. * Bits 10:8
  10153. * Purpose: Carry the bandwidth of the CFR capture
  10154. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  10155. * - mode
  10156. * Bits 13:11
  10157. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  10158. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  10159. * - sts_count
  10160. * Bits 16:14
  10161. * Purpose: Carry the number of space time streams
  10162. * Value: Number of space time streams
  10163. * - channel_bw
  10164. * Bits 19:17
  10165. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  10166. * measurement
  10167. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  10168. * - cap_type
  10169. * Bits 23:20
  10170. * Purpose: Carry the type of the capture
  10171. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  10172. * - vdev_id
  10173. * Bits 31:24
  10174. * Purpose: Carry the virtual device id
  10175. * Value: vdev ID
  10176. *
  10177. * Word 3
  10178. * - mac_addr31to0
  10179. * Bits 31:0
  10180. * Purpose: Contain the bits 31:0 of the peer MAC address
  10181. * Value: Bits 31:0 of the peer MAC address
  10182. *
  10183. * Word 4
  10184. * - mac_addr47to32
  10185. * Bits 15:0
  10186. * Purpose: Contain the bits 47:32 of the peer MAC address
  10187. * Value: Bits 47:32 of the peer MAC address
  10188. *
  10189. * Word 5
  10190. * - index
  10191. * Bits 31:0
  10192. * Purpose: Contain the index at which this CFR dump was written in the Host
  10193. * allocated memory. This index is the number of bytes from the base address.
  10194. * Value: Index position
  10195. *
  10196. * Word 6
  10197. * - length
  10198. * Bits 31:0
  10199. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  10200. * Value: Length of the CFR capture of the peer
  10201. *
  10202. * Word 7
  10203. * - timestamp
  10204. * Bits 31:0
  10205. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  10206. * clock used for this timestamp is private to the target and not visible to
  10207. * the host i.e., Host can interpret only the relative timestamp deltas from
  10208. * one message to the next, but can't interpret the absolute timestamp from a
  10209. * single message.
  10210. * Value: Timestamp in microseconds
  10211. *
  10212. * Word 8
  10213. * - counter
  10214. * Bits 31:0
  10215. * Purpose: Carry the count of the current CFR capture from FW. This is
  10216. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  10217. * in host memory)
  10218. * Value: Count of the current CFR capture
  10219. *
  10220. * Word 9
  10221. * - chan_mhz
  10222. * Bits 31:0
  10223. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  10224. * Value: Primary 20 channel frequency
  10225. *
  10226. * Word 10
  10227. * - band_center_freq1
  10228. * Bits 31:0
  10229. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  10230. * Value: Center frequency 1 in MHz
  10231. *
  10232. * Word 11
  10233. * - band_center_freq2
  10234. * Bits 31:0
  10235. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  10236. * the VDEV
  10237. * 80plus80 mode
  10238. * Value: Center frequency 2 in MHz
  10239. *
  10240. * Word 12
  10241. * - chan_phy_mode
  10242. * Bits 31:0
  10243. * Purpose: Carry the phy mode of the channel, of the VDEV
  10244. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  10245. */
  10246. PREPACK struct htt_cfr_dump_ind_type_1 {
  10247. A_UINT32 mem_req_id:7,
  10248. status:1,
  10249. capture_bw:3,
  10250. mode:3,
  10251. sts_count:3,
  10252. channel_bw:3,
  10253. cap_type:4,
  10254. vdev_id:8;
  10255. htt_mac_addr addr;
  10256. A_UINT32 index;
  10257. A_UINT32 length;
  10258. A_UINT32 timestamp;
  10259. A_UINT32 counter;
  10260. struct htt_chan_change_msg chan;
  10261. } POSTPACK;
  10262. PREPACK struct htt_cfr_dump_compl_ind {
  10263. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  10264. union {
  10265. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  10266. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  10267. /* If there is a need to change the memory layout and its associated
  10268. * HTT indication format, a new CFR capture message type can be
  10269. * introduced and added into this union.
  10270. */
  10271. };
  10272. } POSTPACK;
  10273. /*
  10274. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  10275. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  10276. */
  10277. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  10278. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  10279. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  10280. do { \
  10281. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  10282. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  10283. } while(0)
  10284. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  10285. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  10286. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  10287. /*
  10288. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  10289. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  10290. */
  10291. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  10292. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  10293. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  10294. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  10295. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  10296. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  10297. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  10298. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  10299. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  10300. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  10301. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  10302. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  10303. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  10304. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  10305. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  10306. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  10307. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  10308. do { \
  10309. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  10310. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  10311. } while (0)
  10312. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  10313. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  10314. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  10315. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  10316. do { \
  10317. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  10318. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  10319. } while (0)
  10320. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  10321. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  10322. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  10323. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  10324. do { \
  10325. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  10326. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  10327. } while (0)
  10328. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  10329. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  10330. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  10331. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  10332. do { \
  10333. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  10334. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  10335. } while (0)
  10336. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  10337. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  10338. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  10339. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  10340. do { \
  10341. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  10342. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  10343. } while (0)
  10344. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  10345. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  10346. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  10347. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  10348. do { \
  10349. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  10350. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  10351. } while (0)
  10352. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  10353. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  10354. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  10355. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  10356. do { \
  10357. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  10358. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  10359. } while (0)
  10360. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  10361. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  10362. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  10363. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  10364. do { \
  10365. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  10366. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  10367. } while (0)
  10368. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  10369. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  10370. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  10371. /**
  10372. * @brief target -> host peer (PPDU) stats message
  10373. * HTT_T2H_MSG_TYPE_PEER_STATS_IND
  10374. * @details
  10375. * This message is generated by FW when FW is sending stats to host
  10376. * about one or more PPDUs that the FW has transmitted to one or more peers.
  10377. * This message is sent autonomously by the target rather than upon request
  10378. * by the host.
  10379. * The following field definitions describe the format of the HTT target
  10380. * to host peer stats indication message.
  10381. *
  10382. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  10383. * or more PPDU stats records.
  10384. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  10385. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  10386. * then the message would start with the
  10387. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  10388. * below.
  10389. *
  10390. * |31 16|15|14|13 11|10 9|8|7 0|
  10391. * |-------------------------------------------------------------|
  10392. * | reserved |MSG_TYPE |
  10393. * |-------------------------------------------------------------|
  10394. * rec 0 | TLV header |
  10395. * rec 0 |-------------------------------------------------------------|
  10396. * rec 0 | ppdu successful bytes |
  10397. * rec 0 |-------------------------------------------------------------|
  10398. * rec 0 | ppdu retry bytes |
  10399. * rec 0 |-------------------------------------------------------------|
  10400. * rec 0 | ppdu failed bytes |
  10401. * rec 0 |-------------------------------------------------------------|
  10402. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  10403. * rec 0 |-------------------------------------------------------------|
  10404. * rec 0 | retried MSDUs | successful MSDUs |
  10405. * rec 0 |-------------------------------------------------------------|
  10406. * rec 0 | TX duration | failed MSDUs |
  10407. * rec 0 |-------------------------------------------------------------|
  10408. * ...
  10409. * |-------------------------------------------------------------|
  10410. * rec N | TLV header |
  10411. * rec N |-------------------------------------------------------------|
  10412. * rec N | ppdu successful bytes |
  10413. * rec N |-------------------------------------------------------------|
  10414. * rec N | ppdu retry bytes |
  10415. * rec N |-------------------------------------------------------------|
  10416. * rec N | ppdu failed bytes |
  10417. * rec N |-------------------------------------------------------------|
  10418. * rec N | peer id | S|SG| BW | BA |A|rate code|
  10419. * rec N |-------------------------------------------------------------|
  10420. * rec N | retried MSDUs | successful MSDUs |
  10421. * rec N |-------------------------------------------------------------|
  10422. * rec N | TX duration | failed MSDUs |
  10423. * rec N |-------------------------------------------------------------|
  10424. *
  10425. * where:
  10426. * A = is A-MPDU flag
  10427. * BA = block-ack failure flags
  10428. * BW = bandwidth spec
  10429. * SG = SGI enabled spec
  10430. * S = skipped rate ctrl
  10431. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  10432. *
  10433. * Header
  10434. * ------
  10435. * dword0 - b'0:7 - msg_type : HTT_T2H_MSG_TYPE_PEER_STATS_IND
  10436. * dword0 - b'8:31 - reserved : Reserved for future use
  10437. *
  10438. * payload include below peer_stats information
  10439. * --------------------------------------------
  10440. * @TLV : HTT_PPDU_STATS_INFO_TLV
  10441. * @tx_success_bytes : total successful bytes in the PPDU.
  10442. * @tx_retry_bytes : total retried bytes in the PPDU.
  10443. * @tx_failed_bytes : total failed bytes in the PPDU.
  10444. * @tx_ratecode : rate code used for the PPDU.
  10445. * @is_ampdu : Indicates PPDU is AMPDU or not.
  10446. * @ba_ack_failed : BA/ACK failed for this PPDU
  10447. * b00 -> BA received
  10448. * b01 -> BA failed once
  10449. * b10 -> BA failed twice, when HW retry is enabled.
  10450. * @bw : BW
  10451. * b00 -> 20 MHz
  10452. * b01 -> 40 MHz
  10453. * b10 -> 80 MHz
  10454. * b11 -> 160 MHz (or 80+80)
  10455. * @sg : SGI enabled
  10456. * @s : skipped ratectrl
  10457. * @peer_id : peer id
  10458. * @tx_success_msdus : successful MSDUs
  10459. * @tx_retry_msdus : retried MSDUs
  10460. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  10461. * @tx_duration : Tx duration for the PPDU (microsecond units)
  10462. */
  10463. /**
  10464. * @brief HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID Message
  10465. *
  10466. * @details
  10467. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  10468. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  10469. * This message will only be sent if the backpressure condition has existed
  10470. * continuously for an initial period (100 ms).
  10471. * Repeat messages with updated information will be sent after each
  10472. * subsequent period (100 ms) as long as the backpressure remains unabated.
  10473. * This message indicates the ring id along with current head and tail index
  10474. * locations (i.e. write and read indices).
  10475. * The backpressure time indicates the time in ms for which continous
  10476. * backpressure has been observed in the ring.
  10477. *
  10478. * The message format is as follows:
  10479. *
  10480. * |31 24|23 16|15 8|7 0|
  10481. * |----------------+----------------+----------------+----------------|
  10482. * | ring_id | ring_type | pdev_id | msg_type |
  10483. * |-------------------------------------------------------------------|
  10484. * | tail_idx | head_idx |
  10485. * |-------------------------------------------------------------------|
  10486. * | backpressure_time_ms |
  10487. * |-------------------------------------------------------------------|
  10488. *
  10489. * The message is interpreted as follows:
  10490. * dword0 - b'0:7 - msg_type: This will be set to
  10491. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  10492. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  10493. * 1, 2, 3 indicates pdev_id 0,1,2 and
  10494. the msg is for LMAC ring.
  10495. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  10496. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  10497. * htt_backpressure_lmac_ring_id. This represents
  10498. * the ring id for which continous backpressure is seen
  10499. *
  10500. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  10501. * the ring indicated by the ring_id
  10502. *
  10503. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  10504. * the ring indicated by the ring id
  10505. *
  10506. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  10507. * backpressure has been seen in the ring
  10508. * indicated by the ring_id.
  10509. * Units = milliseconds
  10510. */
  10511. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  10512. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  10513. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  10514. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  10515. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  10516. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  10517. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  10518. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  10519. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  10520. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  10521. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  10522. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  10523. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  10524. do { \
  10525. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  10526. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  10527. } while (0)
  10528. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  10529. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  10530. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  10531. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  10532. do { \
  10533. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  10534. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  10535. } while (0)
  10536. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  10537. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  10538. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  10539. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  10540. do { \
  10541. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  10542. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  10543. } while (0)
  10544. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  10545. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  10546. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  10547. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  10548. do { \
  10549. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  10550. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  10551. } while (0)
  10552. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  10553. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  10554. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  10555. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  10556. do { \
  10557. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  10558. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  10559. } while (0)
  10560. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  10561. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  10562. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  10563. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  10564. do { \
  10565. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  10566. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  10567. } while (0)
  10568. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  10569. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  10570. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  10571. enum htt_backpressure_ring_type {
  10572. HTT_SW_RING_TYPE_UMAC,
  10573. HTT_SW_RING_TYPE_LMAC,
  10574. HTT_SW_RING_TYPE_MAX,
  10575. };
  10576. /* Ring id for which the message is sent to host */
  10577. enum htt_backpressure_umac_ringid {
  10578. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  10579. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  10580. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  10581. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  10582. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  10583. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  10584. HTT_SW_RING_IDX_REO_REO2FW_RING,
  10585. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  10586. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  10587. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  10588. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  10589. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  10590. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  10591. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  10592. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  10593. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  10594. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  10595. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  10596. HTT_SW_UMAC_RING_IDX_MAX,
  10597. };
  10598. enum htt_backpressure_lmac_ringid {
  10599. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  10600. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  10601. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  10602. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  10603. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  10604. HTT_SW_RING_IDX_RXDMA2FW_RING,
  10605. HTT_SW_RING_IDX_RXDMA2SW_RING,
  10606. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  10607. HTT_SW_RING_IDX_RXDMA2REO_RING,
  10608. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  10609. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  10610. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  10611. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  10612. HTT_SW_LMAC_RING_IDX_MAX,
  10613. };
  10614. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  10615. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  10616. pdev_id: 8,
  10617. ring_type: 8, /* htt_backpressure_ring_type */
  10618. /*
  10619. * ring_id holds an enum value from either
  10620. * htt_backpressure_umac_ringid or
  10621. * htt_backpressure_lmac_ringid, based on
  10622. * the ring_type setting.
  10623. */
  10624. ring_id: 8;
  10625. A_UINT16 head_idx;
  10626. A_UINT16 tail_idx;
  10627. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  10628. } POSTPACK;
  10629. #endif