htt.h 556 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322
  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. * 3.66 Add HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND msg.
  180. * Add PKT_CAPTURE_MODE flag within HTT_T2H TX_I_ORD_PADDR_IND msg.
  181. * 3.67 Add drop threshold field to HTT_H2T RX_RING_SELECTION_CFG msg.
  182. */
  183. #define HTT_CURRENT_VERSION_MAJOR 3
  184. #define HTT_CURRENT_VERSION_MINOR 67
  185. #define HTT_NUM_TX_FRAG_DESC 1024
  186. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  187. #define HTT_CHECK_SET_VAL(field, val) \
  188. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  189. /* macros to assist in sign-extending fields from HTT messages */
  190. #define HTT_SIGN_BIT_MASK(field) \
  191. ((field ## _M + (1 << field ## _S)) >> 1)
  192. #define HTT_SIGN_BIT(_val, field) \
  193. (_val & HTT_SIGN_BIT_MASK(field))
  194. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  195. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  196. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  197. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  198. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  199. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  200. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  201. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  202. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  203. /*
  204. * TEMPORARY:
  205. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  206. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  207. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  208. * updated.
  209. */
  210. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  211. /*
  212. * TEMPORARY:
  213. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  214. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  215. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  216. * updated.
  217. */
  218. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  219. /* HTT Access Category values */
  220. enum HTT_AC_WMM {
  221. /* WMM Access Categories */
  222. HTT_AC_WMM_BE = 0x0,
  223. HTT_AC_WMM_BK = 0x1,
  224. HTT_AC_WMM_VI = 0x2,
  225. HTT_AC_WMM_VO = 0x3,
  226. /* extension Access Categories */
  227. HTT_AC_EXT_NON_QOS = 0x4,
  228. HTT_AC_EXT_UCAST_MGMT = 0x5,
  229. HTT_AC_EXT_MCAST_DATA = 0x6,
  230. HTT_AC_EXT_MCAST_MGMT = 0x7,
  231. };
  232. enum HTT_AC_WMM_MASK {
  233. /* WMM Access Categories */
  234. HTT_AC_WMM_BE_MASK = (1 << HTT_AC_WMM_BE),
  235. HTT_AC_WMM_BK_MASK = (1 << HTT_AC_WMM_BK),
  236. HTT_AC_WMM_VI_MASK = (1 << HTT_AC_WMM_VI),
  237. HTT_AC_WMM_VO_MASK = (1 << HTT_AC_WMM_VO),
  238. /* extension Access Categories */
  239. HTT_AC_EXT_NON_QOS_MASK = (1 << HTT_AC_EXT_NON_QOS),
  240. HTT_AC_EXT_UCAST_MGMT_MASK = (1 << HTT_AC_EXT_UCAST_MGMT),
  241. HTT_AC_EXT_MCAST_DATA_MASK = (1 << HTT_AC_EXT_MCAST_DATA),
  242. HTT_AC_EXT_MCAST_MGMT_MASK = (1 << HTT_AC_EXT_MCAST_MGMT),
  243. };
  244. #define HTT_AC_MASK_WMM \
  245. (HTT_AC_WMM_BE_MASK | HTT_AC_WMM_BK_MASK | \
  246. HTT_AC_WMM_VI_MASK | HTT_AC_WMM_VO_MASK)
  247. #define HTT_AC_MASK_EXT \
  248. (HTT_AC_EXT_NON_QOS_MASK | HTT_AC_EXT_UCAST_MGMT_MASK | \
  249. HTT_AC_EXT_MCAST_DATA_MASK | HTT_AC_EXT_MCAST_MGMT_MASK)
  250. #define HTT_AC_MASK_ALL (HTT_AC_MASK_WMM | HTT_AC_MASK_EXT)
  251. /*
  252. * htt_dbg_stats_type -
  253. * bit positions for each stats type within a stats type bitmask
  254. * The bitmask contains 24 bits.
  255. */
  256. enum htt_dbg_stats_type {
  257. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  258. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  259. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  260. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  261. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  262. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  263. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  264. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  265. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  266. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  267. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  268. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  269. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  270. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  271. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  272. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  273. /* bits 16-23 currently reserved */
  274. /* keep this last */
  275. HTT_DBG_NUM_STATS
  276. };
  277. /*=== HTT option selection TLVs ===
  278. * Certain HTT messages have alternatives or options.
  279. * For such cases, the host and target need to agree on which option to use.
  280. * Option specification TLVs can be appended to the VERSION_REQ and
  281. * VERSION_CONF messages to select options other than the default.
  282. * These TLVs are entirely optional - if they are not provided, there is a
  283. * well-defined default for each option. If they are provided, they can be
  284. * provided in any order. Each TLV can be present or absent independent of
  285. * the presence / absence of other TLVs.
  286. *
  287. * The HTT option selection TLVs use the following format:
  288. * |31 16|15 8|7 0|
  289. * |---------------------------------+----------------+----------------|
  290. * | value (payload) | length | tag |
  291. * |-------------------------------------------------------------------|
  292. * The value portion need not be only 2 bytes; it can be extended by any
  293. * integer number of 4-byte units. The total length of the TLV, including
  294. * the tag and length fields, must be a multiple of 4 bytes. The length
  295. * field specifies the total TLV size in 4-byte units. Thus, the typical
  296. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  297. * field, would store 0x1 in its length field, to show that the TLV occupies
  298. * a single 4-byte unit.
  299. */
  300. /*--- TLV header format - applies to all HTT option TLVs ---*/
  301. enum HTT_OPTION_TLV_TAGS {
  302. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  303. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  304. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  305. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  306. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  307. };
  308. PREPACK struct htt_option_tlv_header_t {
  309. A_UINT8 tag;
  310. A_UINT8 length;
  311. } POSTPACK;
  312. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  313. #define HTT_OPTION_TLV_TAG_S 0
  314. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  315. #define HTT_OPTION_TLV_LENGTH_S 8
  316. /*
  317. * value0 - 16 bit value field stored in word0
  318. * The TLV's value field may be longer than 2 bytes, in which case
  319. * the remainder of the value is stored in word1, word2, etc.
  320. */
  321. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  322. #define HTT_OPTION_TLV_VALUE0_S 16
  323. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  324. do { \
  325. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  326. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  327. } while (0)
  328. #define HTT_OPTION_TLV_TAG_GET(word) \
  329. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  330. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  331. do { \
  332. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  333. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  334. } while (0)
  335. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  336. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  337. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  338. do { \
  339. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  340. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  341. } while (0)
  342. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  343. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  344. /*--- format of specific HTT option TLVs ---*/
  345. /*
  346. * HTT option TLV for specifying LL bus address size
  347. * Some chips require bus addresses used by the target to access buffers
  348. * within the host's memory to be 32 bits; others require bus addresses
  349. * used by the target to access buffers within the host's memory to be
  350. * 64 bits.
  351. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  352. * a suffix to the VERSION_CONF message to specify which bus address format
  353. * the target requires.
  354. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  355. * default to providing bus addresses to the target in 32-bit format.
  356. */
  357. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  358. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  359. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  360. };
  361. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  362. struct htt_option_tlv_header_t hdr;
  363. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  364. } POSTPACK;
  365. /*
  366. * HTT option TLV for specifying whether HL systems should indicate
  367. * over-the-air tx completion for individual frames, or should instead
  368. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  369. * requests an OTA tx completion for a particular tx frame.
  370. * This option does not apply to LL systems, where the TX_COMPL_IND
  371. * is mandatory.
  372. * This option is primarily intended for HL systems in which the tx frame
  373. * downloads over the host --> target bus are as slow as or slower than
  374. * the transmissions over the WLAN PHY. For cases where the bus is faster
  375. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  376. * and consquently will send one TX_COMPL_IND message that covers several
  377. * tx frames. For cases where the WLAN PHY is faster than the bus,
  378. * the target will end up transmitting very short A-MPDUs, and consequently
  379. * sending many TX_COMPL_IND messages, which each cover a very small number
  380. * of tx frames.
  381. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  382. * a suffix to the VERSION_REQ message to request whether the host desires to
  383. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  384. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  385. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  386. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  387. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  388. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  389. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  390. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  391. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  392. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  393. * TLV.
  394. */
  395. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  396. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  397. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  398. };
  399. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  400. struct htt_option_tlv_header_t hdr;
  401. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  402. } POSTPACK;
  403. /*
  404. * HTT option TLV for specifying how many tx queue groups the target
  405. * may establish.
  406. * This TLV specifies the maximum value the target may send in the
  407. * txq_group_id field of any TXQ_GROUP information elements sent by
  408. * the target to the host. This allows the host to pre-allocate an
  409. * appropriate number of tx queue group structs.
  410. *
  411. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  412. * a suffix to the VERSION_REQ message to specify whether the host supports
  413. * tx queue groups at all, and if so if there is any limit on the number of
  414. * tx queue groups that the host supports.
  415. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  416. * a suffix to the VERSION_CONF message. If the host has specified in the
  417. * VER_REQ message a limit on the number of tx queue groups the host can
  418. * supprt, the target shall limit its specification of the maximum tx groups
  419. * to be no larger than this host-specified limit.
  420. *
  421. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  422. * shall preallocate 4 tx queue group structs, and the target shall not
  423. * specify a txq_group_id larger than 3.
  424. */
  425. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  426. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  427. /*
  428. * values 1 through N specify the max number of tx queue groups
  429. * the sender supports
  430. */
  431. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  432. };
  433. /* TEMPORARY backwards-compatibility alias for a typo fix -
  434. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  435. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  436. * to support the old name (with the typo) until all references to the
  437. * old name are replaced with the new name.
  438. */
  439. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  440. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  441. struct htt_option_tlv_header_t hdr;
  442. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  443. } POSTPACK;
  444. /*
  445. * HTT option TLV for specifying whether the target supports an extended
  446. * version of the HTT tx descriptor. If the target provides this TLV
  447. * and specifies in the TLV that the target supports an extended version
  448. * of the HTT tx descriptor, the target must check the "extension" bit in
  449. * the HTT tx descriptor, and if the extension bit is set, to expect a
  450. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  451. * descriptor. Furthermore, the target must provide room for the HTT
  452. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  453. * This option is intended for systems where the host needs to explicitly
  454. * control the transmission parameters such as tx power for individual
  455. * tx frames.
  456. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  457. * as a suffix to the VERSION_CONF message to explicitly specify whether
  458. * the target supports the HTT tx MSDU extension descriptor.
  459. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  460. * by the host as lack of target support for the HTT tx MSDU extension
  461. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  462. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  463. * the HTT tx MSDU extension descriptor.
  464. * The host is not required to provide the HTT tx MSDU extension descriptor
  465. * just because the target supports it; the target must check the
  466. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  467. * extension descriptor is present.
  468. */
  469. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  470. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  471. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  472. };
  473. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  474. struct htt_option_tlv_header_t hdr;
  475. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  476. } POSTPACK;
  477. /*=== host -> target messages ===============================================*/
  478. enum htt_h2t_msg_type {
  479. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  480. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  481. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  482. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  483. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  484. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  485. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  486. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  487. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  488. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  489. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  490. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  491. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  492. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  493. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  494. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  495. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  496. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  497. /* keep this last */
  498. HTT_H2T_NUM_MSGS
  499. };
  500. /*
  501. * HTT host to target message type -
  502. * stored in bits 7:0 of the first word of the message
  503. */
  504. #define HTT_H2T_MSG_TYPE_M 0xff
  505. #define HTT_H2T_MSG_TYPE_S 0
  506. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  507. do { \
  508. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  509. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  510. } while (0)
  511. #define HTT_H2T_MSG_TYPE_GET(word) \
  512. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  513. /**
  514. * @brief host -> target version number request message definition
  515. *
  516. * |31 24|23 16|15 8|7 0|
  517. * |----------------+----------------+----------------+----------------|
  518. * | reserved | msg type |
  519. * |-------------------------------------------------------------------|
  520. * : option request TLV (optional) |
  521. * :...................................................................:
  522. *
  523. * The VER_REQ message may consist of a single 4-byte word, or may be
  524. * extended with TLVs that specify which HTT options the host is requesting
  525. * from the target.
  526. * The following option TLVs may be appended to the VER_REQ message:
  527. * - HL_SUPPRESS_TX_COMPL_IND
  528. * - HL_MAX_TX_QUEUE_GROUPS
  529. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  530. * may be appended to the VER_REQ message (but only one TLV of each type).
  531. *
  532. * Header fields:
  533. * - MSG_TYPE
  534. * Bits 7:0
  535. * Purpose: identifies this as a version number request message
  536. * Value: 0x0
  537. */
  538. #define HTT_VER_REQ_BYTES 4
  539. /* TBDXXX: figure out a reasonable number */
  540. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  541. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  542. /**
  543. * @brief HTT tx MSDU descriptor
  544. *
  545. * @details
  546. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  547. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  548. * the target firmware needs for the FW's tx processing, particularly
  549. * for creating the HW msdu descriptor.
  550. * The same HTT tx descriptor is used for HL and LL systems, though
  551. * a few fields within the tx descriptor are used only by LL or
  552. * only by HL.
  553. * The HTT tx descriptor is defined in two manners: by a struct with
  554. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  555. * definitions.
  556. * The target should use the struct def, for simplicitly and clarity,
  557. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  558. * neutral. Specifically, the host shall use the get/set macros built
  559. * around the mask + shift defs.
  560. */
  561. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  562. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  563. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  564. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  565. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  566. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  567. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  568. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  569. #define HTT_TX_VDEV_ID_WORD 0
  570. #define HTT_TX_VDEV_ID_MASK 0x3f
  571. #define HTT_TX_VDEV_ID_SHIFT 16
  572. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  573. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  574. #define HTT_TX_MSDU_LEN_DWORD 1
  575. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  576. /*
  577. * HTT_VAR_PADDR macros
  578. * Allow physical / bus addresses to be either a single 32-bit value,
  579. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  580. */
  581. #define HTT_VAR_PADDR32(var_name) \
  582. A_UINT32 var_name
  583. #define HTT_VAR_PADDR64_LE(var_name) \
  584. struct { \
  585. /* little-endian: lo precedes hi */ \
  586. A_UINT32 lo; \
  587. A_UINT32 hi; \
  588. } var_name
  589. /*
  590. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  591. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  592. * addresses are stored in a XXX-bit field.
  593. * This macro is used to define both htt_tx_msdu_desc32_t and
  594. * htt_tx_msdu_desc64_t structs.
  595. */
  596. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  597. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  598. { \
  599. /* DWORD 0: flags and meta-data */ \
  600. A_UINT32 \
  601. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  602. \
  603. /* pkt_subtype - \
  604. * Detailed specification of the tx frame contents, extending the \
  605. * general specification provided by pkt_type. \
  606. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  607. * pkt_type | pkt_subtype \
  608. * ============================================================== \
  609. * 802.3 | bit 0:3 - Reserved \
  610. * | bit 4: 0x0 - Copy-Engine Classification Results \
  611. * | not appended to the HTT message \
  612. * | 0x1 - Copy-Engine Classification Results \
  613. * | appended to the HTT message in the \
  614. * | format: \
  615. * | [HTT tx desc, frame header, \
  616. * | CE classification results] \
  617. * | The CE classification results begin \
  618. * | at the next 4-byte boundary after \
  619. * | the frame header. \
  620. * ------------+------------------------------------------------- \
  621. * Eth2 | bit 0:3 - Reserved \
  622. * | bit 4: 0x0 - Copy-Engine Classification Results \
  623. * | not appended to the HTT message \
  624. * | 0x1 - Copy-Engine Classification Results \
  625. * | appended to the HTT message. \
  626. * | See the above specification of the \
  627. * | CE classification results location. \
  628. * ------------+------------------------------------------------- \
  629. * native WiFi | bit 0:3 - Reserved \
  630. * | bit 4: 0x0 - Copy-Engine Classification Results \
  631. * | not appended to the HTT message \
  632. * | 0x1 - Copy-Engine Classification Results \
  633. * | appended to the HTT message. \
  634. * | See the above specification of the \
  635. * | CE classification results location. \
  636. * ------------+------------------------------------------------- \
  637. * mgmt | 0x0 - 802.11 MAC header absent \
  638. * | 0x1 - 802.11 MAC header present \
  639. * ------------+------------------------------------------------- \
  640. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  641. * | 0x1 - 802.11 MAC header present \
  642. * | bit 1: 0x0 - allow aggregation \
  643. * | 0x1 - don't allow aggregation \
  644. * | bit 2: 0x0 - perform encryption \
  645. * | 0x1 - don't perform encryption \
  646. * | bit 3: 0x0 - perform tx classification / queuing \
  647. * | 0x1 - don't perform tx classification; \
  648. * | insert the frame into the "misc" \
  649. * | tx queue \
  650. * | bit 4: 0x0 - Copy-Engine Classification Results \
  651. * | not appended to the HTT message \
  652. * | 0x1 - Copy-Engine Classification Results \
  653. * | appended to the HTT message. \
  654. * | See the above specification of the \
  655. * | CE classification results location. \
  656. */ \
  657. pkt_subtype: 5, \
  658. \
  659. /* pkt_type - \
  660. * General specification of the tx frame contents. \
  661. * The htt_pkt_type enum should be used to specify and check the \
  662. * value of this field. \
  663. */ \
  664. pkt_type: 3, \
  665. \
  666. /* vdev_id - \
  667. * ID for the vdev that is sending this tx frame. \
  668. * For certain non-standard packet types, e.g. pkt_type == raw \
  669. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  670. * This field is used primarily for determining where to queue \
  671. * broadcast and multicast frames. \
  672. */ \
  673. vdev_id: 6, \
  674. /* ext_tid - \
  675. * The extended traffic ID. \
  676. * If the TID is unknown, the extended TID is set to \
  677. * HTT_TX_EXT_TID_INVALID. \
  678. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  679. * value of the QoS TID. \
  680. * If the tx frame is non-QoS data, then the extended TID is set to \
  681. * HTT_TX_EXT_TID_NON_QOS. \
  682. * If the tx frame is multicast or broadcast, then the extended TID \
  683. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  684. */ \
  685. ext_tid: 5, \
  686. \
  687. /* postponed - \
  688. * This flag indicates whether the tx frame has been downloaded to \
  689. * the target before but discarded by the target, and now is being \
  690. * downloaded again; or if this is a new frame that is being \
  691. * downloaded for the first time. \
  692. * This flag allows the target to determine the correct order for \
  693. * transmitting new vs. old frames. \
  694. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  695. * This flag only applies to HL systems, since in LL systems, \
  696. * the tx flow control is handled entirely within the target. \
  697. */ \
  698. postponed: 1, \
  699. \
  700. /* extension - \
  701. * This flag indicates whether a HTT tx MSDU extension descriptor \
  702. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  703. * \
  704. * 0x0 - no extension MSDU descriptor is present \
  705. * 0x1 - an extension MSDU descriptor immediately follows the \
  706. * regular MSDU descriptor \
  707. */ \
  708. extension: 1, \
  709. \
  710. /* cksum_offload - \
  711. * This flag indicates whether checksum offload is enabled or not \
  712. * for this frame. Target FW use this flag to turn on HW checksumming \
  713. * 0x0 - No checksum offload \
  714. * 0x1 - L3 header checksum only \
  715. * 0x2 - L4 checksum only \
  716. * 0x3 - L3 header checksum + L4 checksum \
  717. */ \
  718. cksum_offload: 2, \
  719. \
  720. /* tx_comp_req - \
  721. * This flag indicates whether Tx Completion \
  722. * from fw is required or not. \
  723. * This flag is only relevant if tx completion is not \
  724. * universally enabled. \
  725. * For all LL systems, tx completion is mandatory, \
  726. * so this flag will be irrelevant. \
  727. * For HL systems tx completion is optional, but HL systems in which \
  728. * the bus throughput exceeds the WLAN throughput will \
  729. * probably want to always use tx completion, and thus \
  730. * would not check this flag. \
  731. * This flag is required when tx completions are not used universally, \
  732. * but are still required for certain tx frames for which \
  733. * an OTA delivery acknowledgment is needed by the host. \
  734. * In practice, this would be for HL systems in which the \
  735. * bus throughput is less than the WLAN throughput. \
  736. * \
  737. * 0x0 - Tx Completion Indication from Fw not required \
  738. * 0x1 - Tx Completion Indication from Fw is required \
  739. */ \
  740. tx_compl_req: 1; \
  741. \
  742. \
  743. /* DWORD 1: MSDU length and ID */ \
  744. A_UINT32 \
  745. len: 16, /* MSDU length, in bytes */ \
  746. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  747. * and this id is used to calculate fragmentation \
  748. * descriptor pointer inside the target based on \
  749. * the base address, configured inside the target. \
  750. */ \
  751. \
  752. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  753. /* frags_desc_ptr - \
  754. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  755. * where the tx frame's fragments reside in memory. \
  756. * This field only applies to LL systems, since in HL systems the \
  757. * (degenerate single-fragment) fragmentation descriptor is created \
  758. * within the target. \
  759. */ \
  760. _paddr__frags_desc_ptr_; \
  761. \
  762. /* DWORD 3 (or 4): peerid, chanfreq */ \
  763. /* \
  764. * Peer ID : Target can use this value to know which peer-id packet \
  765. * destined to. \
  766. * It's intended to be specified by host in case of NAWDS. \
  767. */ \
  768. A_UINT16 peerid; \
  769. \
  770. /* \
  771. * Channel frequency: This identifies the desired channel \
  772. * frequency (in mhz) for tx frames. This is used by FW to help \
  773. * determine when it is safe to transmit or drop frames for \
  774. * off-channel operation. \
  775. * The default value of zero indicates to FW that the corresponding \
  776. * VDEV's home channel (if there is one) is the desired channel \
  777. * frequency. \
  778. */ \
  779. A_UINT16 chanfreq; \
  780. \
  781. /* Reason reserved is commented is increasing the htt structure size \
  782. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  783. * A_UINT32 reserved_dword3_bits0_31; \
  784. */ \
  785. } POSTPACK
  786. /* define a htt_tx_msdu_desc32_t type */
  787. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  788. /* define a htt_tx_msdu_desc64_t type */
  789. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  790. /*
  791. * Make htt_tx_msdu_desc_t be an alias for either
  792. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  793. */
  794. #if HTT_PADDR64
  795. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  796. #else
  797. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  798. #endif
  799. /* decriptor information for Management frame*/
  800. /*
  801. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  802. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  803. */
  804. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  805. extern A_UINT32 mgmt_hdr_len;
  806. PREPACK struct htt_mgmt_tx_desc_t {
  807. A_UINT32 msg_type;
  808. #if HTT_PADDR64
  809. A_UINT64 frag_paddr; /* DMAble address of the data */
  810. #else
  811. A_UINT32 frag_paddr; /* DMAble address of the data */
  812. #endif
  813. A_UINT32 desc_id; /* returned to host during completion
  814. * to free the meory*/
  815. A_UINT32 len; /* Fragment length */
  816. A_UINT32 vdev_id; /* virtual device ID*/
  817. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  818. } POSTPACK;
  819. PREPACK struct htt_mgmt_tx_compl_ind {
  820. A_UINT32 desc_id;
  821. A_UINT32 status;
  822. } POSTPACK;
  823. /*
  824. * This SDU header size comes from the summation of the following:
  825. * 1. Max of:
  826. * a. Native WiFi header, for native WiFi frames: 24 bytes
  827. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  828. * b. 802.11 header, for raw frames: 36 bytes
  829. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  830. * QoS header, HT header)
  831. * c. 802.3 header, for ethernet frames: 14 bytes
  832. * (destination address, source address, ethertype / length)
  833. * 2. Max of:
  834. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  835. * b. IPv6 header, up through the Traffic Class: 2 bytes
  836. * 3. 802.1Q VLAN header: 4 bytes
  837. * 4. LLC/SNAP header: 8 bytes
  838. */
  839. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  840. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  841. #define HTT_TX_HDR_SIZE_ETHERNET 14
  842. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  843. A_COMPILE_TIME_ASSERT(
  844. htt_encap_hdr_size_max_check_nwifi,
  845. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  846. A_COMPILE_TIME_ASSERT(
  847. htt_encap_hdr_size_max_check_enet,
  848. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  849. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  850. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  851. #define HTT_TX_HDR_SIZE_802_1Q 4
  852. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  853. #define HTT_COMMON_TX_FRM_HDR_LEN \
  854. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  855. HTT_TX_HDR_SIZE_802_1Q + \
  856. HTT_TX_HDR_SIZE_LLC_SNAP)
  857. #define HTT_HL_TX_FRM_HDR_LEN \
  858. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  859. #define HTT_LL_TX_FRM_HDR_LEN \
  860. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  861. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  862. /* dword 0 */
  863. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  864. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  865. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  866. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  867. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  868. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  869. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  870. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  871. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  872. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  873. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  874. #define HTT_TX_DESC_PKT_TYPE_S 13
  875. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  876. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  877. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  878. #define HTT_TX_DESC_VDEV_ID_S 16
  879. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  880. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  881. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  882. #define HTT_TX_DESC_EXT_TID_S 22
  883. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  884. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  885. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  886. #define HTT_TX_DESC_POSTPONED_S 27
  887. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  888. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  889. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  890. #define HTT_TX_DESC_EXTENSION_S 28
  891. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  892. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  893. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  894. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  895. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  896. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  897. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  898. #define HTT_TX_DESC_TX_COMP_S 31
  899. /* dword 1 */
  900. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  901. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  902. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  903. #define HTT_TX_DESC_FRM_LEN_S 0
  904. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  905. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  906. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  907. #define HTT_TX_DESC_FRM_ID_S 16
  908. /* dword 2 */
  909. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  910. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  911. /* for systems using 64-bit format for bus addresses */
  912. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  913. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  914. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  915. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  916. /* for systems using 32-bit format for bus addresses */
  917. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  918. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  919. /* dword 3 */
  920. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  921. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  922. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  923. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  924. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  925. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  926. #if HTT_PADDR64
  927. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  928. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  929. #else
  930. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  931. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  932. #endif
  933. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  934. #define HTT_TX_DESC_PEER_ID_S 0
  935. /*
  936. * TEMPORARY:
  937. * The original definitions for the PEER_ID fields contained typos
  938. * (with _DESC_PADDR appended to this PEER_ID field name).
  939. * Retain deprecated original names for PEER_ID fields until all code that
  940. * refers to them has been updated.
  941. */
  942. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  943. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  944. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  945. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  946. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  947. HTT_TX_DESC_PEER_ID_M
  948. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  949. HTT_TX_DESC_PEER_ID_S
  950. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  951. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  952. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  953. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  954. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  955. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  956. #if HTT_PADDR64
  957. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  958. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  959. #else
  960. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  961. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  962. #endif
  963. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  964. #define HTT_TX_DESC_CHAN_FREQ_S 16
  965. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  966. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  967. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  968. do { \
  969. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  970. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  971. } while (0)
  972. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  973. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  974. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  975. do { \
  976. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  977. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  978. } while (0)
  979. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  980. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  981. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  982. do { \
  983. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  984. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  985. } while (0)
  986. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  987. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  988. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  989. do { \
  990. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  991. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  992. } while (0)
  993. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  994. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  995. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  996. do { \
  997. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  998. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  999. } while (0)
  1000. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1001. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1002. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1003. do { \
  1004. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1005. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1006. } while (0)
  1007. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1008. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1009. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1010. do { \
  1011. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1012. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1013. } while (0)
  1014. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1015. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1016. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1017. do { \
  1018. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1019. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1020. } while (0)
  1021. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1022. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1023. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1024. do { \
  1025. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1026. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1027. } while (0)
  1028. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1029. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1030. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1031. do { \
  1032. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1033. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1034. } while (0)
  1035. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1036. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1037. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1038. do { \
  1039. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1040. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1041. } while (0)
  1042. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1043. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1044. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1045. do { \
  1046. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1047. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1048. } while (0)
  1049. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1050. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1051. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1052. do { \
  1053. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1054. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1055. } while (0)
  1056. /* enums used in the HTT tx MSDU extension descriptor */
  1057. enum {
  1058. htt_tx_guard_interval_regular = 0,
  1059. htt_tx_guard_interval_short = 1,
  1060. };
  1061. enum {
  1062. htt_tx_preamble_type_ofdm = 0,
  1063. htt_tx_preamble_type_cck = 1,
  1064. htt_tx_preamble_type_ht = 2,
  1065. htt_tx_preamble_type_vht = 3,
  1066. };
  1067. enum {
  1068. htt_tx_bandwidth_5MHz = 0,
  1069. htt_tx_bandwidth_10MHz = 1,
  1070. htt_tx_bandwidth_20MHz = 2,
  1071. htt_tx_bandwidth_40MHz = 3,
  1072. htt_tx_bandwidth_80MHz = 4,
  1073. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1074. };
  1075. /**
  1076. * @brief HTT tx MSDU extension descriptor
  1077. * @details
  1078. * If the target supports HTT tx MSDU extension descriptors, the host has
  1079. * the option of appending the following struct following the regular
  1080. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1081. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1082. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1083. * tx specs for each frame.
  1084. */
  1085. PREPACK struct htt_tx_msdu_desc_ext_t {
  1086. /* DWORD 0: flags */
  1087. A_UINT32
  1088. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1089. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1090. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1091. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1092. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1093. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1094. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1095. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1096. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1097. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1098. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1099. /* DWORD 1: tx power, tx rate, tx BW */
  1100. A_UINT32
  1101. /* pwr -
  1102. * Specify what power the tx frame needs to be transmitted at.
  1103. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1104. * The value needs to be appropriately sign-extended when extracting
  1105. * the value from the message and storing it in a variable that is
  1106. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1107. * automatically handles this sign-extension.)
  1108. * If the transmission uses multiple tx chains, this power spec is
  1109. * the total transmit power, assuming incoherent combination of
  1110. * per-chain power to produce the total power.
  1111. */
  1112. pwr: 8,
  1113. /* mcs_mask -
  1114. * Specify the allowable values for MCS index (modulation and coding)
  1115. * to use for transmitting the frame.
  1116. *
  1117. * For HT / VHT preamble types, this mask directly corresponds to
  1118. * the HT or VHT MCS indices that are allowed. For each bit N set
  1119. * within the mask, MCS index N is allowed for transmitting the frame.
  1120. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1121. * rates versus OFDM rates, so the host has the option of specifying
  1122. * that the target must transmit the frame with CCK or OFDM rates
  1123. * (not HT or VHT), but leaving the decision to the target whether
  1124. * to use CCK or OFDM.
  1125. *
  1126. * For CCK and OFDM, the bits within this mask are interpreted as
  1127. * follows:
  1128. * bit 0 -> CCK 1 Mbps rate is allowed
  1129. * bit 1 -> CCK 2 Mbps rate is allowed
  1130. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1131. * bit 3 -> CCK 11 Mbps rate is allowed
  1132. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1133. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1134. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1135. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1136. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1137. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1138. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1139. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1140. *
  1141. * The MCS index specification needs to be compatible with the
  1142. * bandwidth mask specification. For example, a MCS index == 9
  1143. * specification is inconsistent with a preamble type == VHT,
  1144. * Nss == 1, and channel bandwidth == 20 MHz.
  1145. *
  1146. * Furthermore, the host has only a limited ability to specify to
  1147. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1148. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1149. */
  1150. mcs_mask: 12,
  1151. /* nss_mask -
  1152. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1153. * Each bit in this mask corresponds to a Nss value:
  1154. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1155. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1156. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1157. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1158. * The values in the Nss mask must be suitable for the recipient, e.g.
  1159. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1160. * recipient which only supports 2x2 MIMO.
  1161. */
  1162. nss_mask: 4,
  1163. /* guard_interval -
  1164. * Specify a htt_tx_guard_interval enum value to indicate whether
  1165. * the transmission should use a regular guard interval or a
  1166. * short guard interval.
  1167. */
  1168. guard_interval: 1,
  1169. /* preamble_type_mask -
  1170. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1171. * may choose from for transmitting this frame.
  1172. * The bits in this mask correspond to the values in the
  1173. * htt_tx_preamble_type enum. For example, to allow the target
  1174. * to transmit the frame as either CCK or OFDM, this field would
  1175. * be set to
  1176. * (1 << htt_tx_preamble_type_ofdm) |
  1177. * (1 << htt_tx_preamble_type_cck)
  1178. */
  1179. preamble_type_mask: 4,
  1180. reserved1_31_29: 3; /* unused, set to 0x0 */
  1181. /* DWORD 2: tx chain mask, tx retries */
  1182. A_UINT32
  1183. /* chain_mask - specify which chains to transmit from */
  1184. chain_mask: 4,
  1185. /* retry_limit -
  1186. * Specify the maximum number of transmissions, including the
  1187. * initial transmission, to attempt before giving up if no ack
  1188. * is received.
  1189. * If the tx rate is specified, then all retries shall use the
  1190. * same rate as the initial transmission.
  1191. * If no tx rate is specified, the target can choose whether to
  1192. * retain the original rate during the retransmissions, or to
  1193. * fall back to a more robust rate.
  1194. */
  1195. retry_limit: 4,
  1196. /* bandwidth_mask -
  1197. * Specify what channel widths may be used for the transmission.
  1198. * A value of zero indicates "don't care" - the target may choose
  1199. * the transmission bandwidth.
  1200. * The bits within this mask correspond to the htt_tx_bandwidth
  1201. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1202. * The bandwidth_mask must be consistent with the preamble_type_mask
  1203. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1204. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1205. */
  1206. bandwidth_mask: 6,
  1207. reserved2_31_14: 18; /* unused, set to 0x0 */
  1208. /* DWORD 3: tx expiry time (TSF) LSBs */
  1209. A_UINT32 expire_tsf_lo;
  1210. /* DWORD 4: tx expiry time (TSF) MSBs */
  1211. A_UINT32 expire_tsf_hi;
  1212. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1213. } POSTPACK;
  1214. /* DWORD 0 */
  1215. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1216. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1217. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1218. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1219. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1220. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1221. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1222. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1223. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1224. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1225. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1226. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1227. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1228. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1229. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1230. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1231. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1232. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1233. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1234. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1235. /* DWORD 1 */
  1236. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1237. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1238. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1239. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1240. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1241. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1242. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1243. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1244. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1245. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1246. /* DWORD 2 */
  1247. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1248. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1249. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1250. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1251. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1252. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1253. /* DWORD 0 */
  1254. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1255. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1256. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1257. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1258. do { \
  1259. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1260. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1261. } while (0)
  1262. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1263. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1264. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1265. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1266. do { \
  1267. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1268. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1269. } while (0)
  1270. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1271. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1272. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1273. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1274. do { \
  1275. HTT_CHECK_SET_VAL( \
  1276. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1277. ((_var) |= ((_val) \
  1278. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1279. } while (0)
  1280. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1281. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1282. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1283. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1284. do { \
  1285. HTT_CHECK_SET_VAL( \
  1286. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1287. ((_var) |= ((_val) \
  1288. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1289. } while (0)
  1290. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1291. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1292. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1293. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1294. do { \
  1295. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1296. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1297. } while (0)
  1298. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1299. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1300. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1301. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1302. do { \
  1303. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1304. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1305. } while (0)
  1306. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1307. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1308. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1309. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1310. do { \
  1311. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1312. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1313. } while (0)
  1314. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1315. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1316. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1317. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1318. do { \
  1319. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1320. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1321. } while (0)
  1322. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1323. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1324. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1325. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1326. do { \
  1327. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1328. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1329. } while (0)
  1330. /* DWORD 1 */
  1331. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1332. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1333. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1334. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1335. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1336. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1337. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1338. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1339. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1340. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1341. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1342. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1343. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1344. do { \
  1345. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1346. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1347. } while (0)
  1348. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1349. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1350. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1351. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1352. do { \
  1353. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1354. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1355. } while (0)
  1356. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1357. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1358. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1359. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1360. do { \
  1361. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1362. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1363. } while (0)
  1364. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1365. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1366. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1367. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1368. do { \
  1369. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1370. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1371. } while (0)
  1372. /* DWORD 2 */
  1373. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1374. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1375. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1376. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1377. do { \
  1378. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1379. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1380. } while (0)
  1381. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1382. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1383. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1384. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1385. do { \
  1386. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1387. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1388. } while (0)
  1389. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1390. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1391. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1392. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1393. do { \
  1394. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1395. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1396. } while (0)
  1397. typedef enum {
  1398. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1399. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1400. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1401. } htt_11ax_ltf_subtype_t;
  1402. typedef enum {
  1403. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1404. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1405. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1406. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1407. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1408. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1409. } htt_tx_ext2_preamble_type_t;
  1410. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1411. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1412. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1413. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1414. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1415. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1416. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1417. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1418. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1419. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1420. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1421. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1422. /**
  1423. * @brief HTT tx MSDU extension descriptor v2
  1424. * @details
  1425. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1426. * is received as tcl_exit_base->host_meta_info in firmware.
  1427. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1428. * are already part of tcl_exit_base.
  1429. */
  1430. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1431. /* DWORD 0: flags */
  1432. A_UINT32
  1433. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1434. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1435. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1436. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1437. valid_retries : 1, /* if set, tx retries spec is valid */
  1438. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1439. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1440. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1441. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1442. valid_key_flags : 1, /* if set, key flags is valid */
  1443. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1444. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1445. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1446. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1447. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1448. 1 = ENCRYPT,
  1449. 2 ~ 3 - Reserved */
  1450. /* retry_limit -
  1451. * Specify the maximum number of transmissions, including the
  1452. * initial transmission, to attempt before giving up if no ack
  1453. * is received.
  1454. * If the tx rate is specified, then all retries shall use the
  1455. * same rate as the initial transmission.
  1456. * If no tx rate is specified, the target can choose whether to
  1457. * retain the original rate during the retransmissions, or to
  1458. * fall back to a more robust rate.
  1459. */
  1460. retry_limit : 4,
  1461. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1462. * Valid only for 11ax preamble types HE_SU
  1463. * and HE_EXT_SU
  1464. */
  1465. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1466. * Valid only for 11ax preamble types HE_SU
  1467. * and HE_EXT_SU
  1468. */
  1469. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1470. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1471. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1472. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1473. */
  1474. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1475. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1476. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1477. * Use cases:
  1478. * Any time firmware uses TQM-BYPASS for Data
  1479. * TID, firmware expect host to set this bit.
  1480. */
  1481. /* DWORD 1: tx power, tx rate */
  1482. A_UINT32
  1483. power : 8, /* unit of the power field is 0.5 dbm
  1484. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1485. * signed value ranging from -64dbm to 63.5 dbm
  1486. */
  1487. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1488. * Setting more than one MCS isn't currently
  1489. * supported by the target (but is supported
  1490. * in the interface in case in the future
  1491. * the target supports specifications of
  1492. * a limited set of MCS values.
  1493. */
  1494. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1495. * Setting more than one Nss isn't currently
  1496. * supported by the target (but is supported
  1497. * in the interface in case in the future
  1498. * the target supports specifications of
  1499. * a limited set of Nss values.
  1500. */
  1501. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1502. update_peer_cache : 1; /* When set these custom values will be
  1503. * used for all packets, until the next
  1504. * update via this ext header.
  1505. * This is to make sure not all packets
  1506. * need to include this header.
  1507. */
  1508. /* DWORD 2: tx chain mask, tx retries */
  1509. A_UINT32
  1510. /* chain_mask - specify which chains to transmit from */
  1511. chain_mask : 8,
  1512. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1513. * TODO: Update Enum values for key_flags
  1514. */
  1515. /*
  1516. * Channel frequency: This identifies the desired channel
  1517. * frequency (in MHz) for tx frames. This is used by FW to help
  1518. * determine when it is safe to transmit or drop frames for
  1519. * off-channel operation.
  1520. * The default value of zero indicates to FW that the corresponding
  1521. * VDEV's home channel (if there is one) is the desired channel
  1522. * frequency.
  1523. */
  1524. chanfreq : 16;
  1525. /* DWORD 3: tx expiry time (TSF) LSBs */
  1526. A_UINT32 expire_tsf_lo;
  1527. /* DWORD 4: tx expiry time (TSF) MSBs */
  1528. A_UINT32 expire_tsf_hi;
  1529. /* DWORD 5: flags to control routing / processing of the MSDU */
  1530. A_UINT32
  1531. /* learning_frame
  1532. * When this flag is set, this frame will be dropped by FW
  1533. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1534. */
  1535. learning_frame : 1,
  1536. /* send_as_standalone
  1537. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1538. * i.e. with no A-MSDU or A-MPDU aggregation.
  1539. * The scope is extended to other use-cases.
  1540. */
  1541. send_as_standalone : 1,
  1542. /* is_host_opaque_valid
  1543. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1544. * with valid information.
  1545. */
  1546. is_host_opaque_valid : 1,
  1547. rsvd0 : 29;
  1548. /* DWORD 6 : Host opaque cookie for special frames */
  1549. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1550. rsvd1 : 16;
  1551. /*
  1552. * This structure can be expanded further up to 40 bytes
  1553. * by adding further DWORDs as needed.
  1554. */
  1555. } POSTPACK;
  1556. /* DWORD 0 */
  1557. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1558. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1559. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1560. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1561. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1562. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1563. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1564. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1565. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1566. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1567. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1568. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1569. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1570. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1571. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1572. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1573. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1574. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1575. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1576. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1577. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1578. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1579. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1580. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1581. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1582. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1583. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1584. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1585. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1586. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1587. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1588. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1589. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1590. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1591. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1592. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1593. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1594. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1595. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1596. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1597. /* DWORD 1 */
  1598. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1599. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1600. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1601. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1602. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1603. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1604. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1605. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1606. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1607. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1608. /* DWORD 2 */
  1609. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1610. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1611. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1612. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1613. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1614. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1615. /* DWORD 5 */
  1616. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1617. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1618. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1619. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1620. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1621. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1622. /* DWORD 6 */
  1623. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1624. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1625. /* DWORD 0 */
  1626. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1627. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1628. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1629. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1630. do { \
  1631. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1632. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1633. } while (0)
  1634. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1635. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1636. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1637. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1638. do { \
  1639. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1640. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1641. } while (0)
  1642. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1643. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1644. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1645. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1646. do { \
  1647. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1648. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1649. } while (0)
  1650. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1651. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1652. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1653. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1654. do { \
  1655. HTT_CHECK_SET_VAL( \
  1656. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1657. ((_var) |= ((_val) \
  1658. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1659. } while (0)
  1660. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1661. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1662. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1663. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1664. do { \
  1665. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1666. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1667. } while (0)
  1668. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1669. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1670. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1671. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1672. do { \
  1673. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1674. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1675. } while (0)
  1676. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1677. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1678. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1679. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1680. do { \
  1681. HTT_CHECK_SET_VAL( \
  1682. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1683. ((_var) |= ((_val) \
  1684. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1685. } while (0)
  1686. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1687. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1688. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1689. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1690. do { \
  1691. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1692. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1693. } while (0)
  1694. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1695. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1696. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1697. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1698. do { \
  1699. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1700. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1701. } while (0)
  1702. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1703. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1704. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1705. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1706. do { \
  1707. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1708. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1709. } while (0)
  1710. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1711. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1712. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1713. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1714. do { \
  1715. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1716. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1717. } while (0)
  1718. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1719. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1720. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1721. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1722. do { \
  1723. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1724. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1725. } while (0)
  1726. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1727. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1728. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1729. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1730. do { \
  1731. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1732. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1733. } while (0)
  1734. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1735. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1736. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1737. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1738. do { \
  1739. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1740. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1741. } while (0)
  1742. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1743. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1744. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1745. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1746. do { \
  1747. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1748. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1749. } while (0)
  1750. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1751. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1752. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1753. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1754. do { \
  1755. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  1756. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  1757. } while (0)
  1758. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1759. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1760. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1761. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1762. do { \
  1763. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  1764. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  1765. } while (0)
  1766. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1767. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1768. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1769. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1770. do { \
  1771. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  1772. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1773. } while (0)
  1774. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1775. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1776. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1777. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1778. do { \
  1779. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1780. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  1781. } while (0)
  1782. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1783. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1784. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1785. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1786. do { \
  1787. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  1788. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1789. } while (0)
  1790. /* DWORD 1 */
  1791. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1792. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1793. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1794. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1795. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1796. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1797. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1798. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1799. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  1800. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  1801. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  1802. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  1803. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  1804. do { \
  1805. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  1806. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  1807. } while (0)
  1808. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  1809. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  1810. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  1811. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  1812. do { \
  1813. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  1814. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  1815. } while (0)
  1816. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  1817. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  1818. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  1819. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  1820. do { \
  1821. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  1822. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  1823. } while (0)
  1824. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  1825. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  1826. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  1827. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  1828. do { \
  1829. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  1830. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  1831. } while (0)
  1832. /* DWORD 2 */
  1833. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  1834. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  1835. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  1836. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  1837. do { \
  1838. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  1839. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  1840. } while (0)
  1841. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  1842. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  1843. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  1844. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  1845. do { \
  1846. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  1847. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  1848. } while (0)
  1849. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  1850. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  1851. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  1852. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  1853. do { \
  1854. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  1855. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  1856. } while (0)
  1857. /* DWORD 5 */
  1858. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  1859. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  1860. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  1861. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  1862. do { \
  1863. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  1864. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  1865. } while (0)
  1866. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  1867. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  1868. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  1869. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  1870. do { \
  1871. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  1872. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  1873. } while (0)
  1874. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  1875. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  1876. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  1877. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  1878. do { \
  1879. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  1880. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  1881. } while (0)
  1882. /* DWORD 6 */
  1883. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  1884. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  1885. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  1886. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  1887. do { \
  1888. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  1889. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  1890. } while (0)
  1891. typedef enum {
  1892. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  1893. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  1894. } htt_tcl_metadata_type;
  1895. /**
  1896. * @brief HTT TCL command number format
  1897. * @details
  1898. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  1899. * available to firmware as tcl_exit_base->tcl_status_number.
  1900. * For regular / multicast packets host will send vdev and mac id and for
  1901. * NAWDS packets, host will send peer id.
  1902. * A_UINT32 is used to avoid endianness conversion problems.
  1903. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  1904. */
  1905. typedef struct {
  1906. A_UINT32
  1907. type: 1, /* vdev_id based or peer_id based */
  1908. rsvd: 31;
  1909. } htt_tx_tcl_vdev_or_peer_t;
  1910. typedef struct {
  1911. A_UINT32
  1912. type: 1, /* vdev_id based or peer_id based */
  1913. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1914. vdev_id: 8,
  1915. pdev_id: 2,
  1916. host_inspected:1,
  1917. rsvd: 19;
  1918. } htt_tx_tcl_vdev_metadata;
  1919. typedef struct {
  1920. A_UINT32
  1921. type: 1, /* vdev_id based or peer_id based */
  1922. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1923. peer_id: 14,
  1924. rsvd: 16;
  1925. } htt_tx_tcl_peer_metadata;
  1926. PREPACK struct htt_tx_tcl_metadata {
  1927. union {
  1928. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  1929. htt_tx_tcl_vdev_metadata vdev_meta;
  1930. htt_tx_tcl_peer_metadata peer_meta;
  1931. };
  1932. } POSTPACK;
  1933. /* DWORD 0 */
  1934. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  1935. #define HTT_TX_TCL_METADATA_TYPE_S 0
  1936. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  1937. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  1938. /* VDEV metadata */
  1939. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  1940. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  1941. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  1942. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  1943. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  1944. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  1945. /* PEER metadata */
  1946. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  1947. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  1948. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  1949. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  1950. HTT_TX_TCL_METADATA_TYPE_S)
  1951. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  1952. do { \
  1953. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  1954. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  1955. } while (0)
  1956. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  1957. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  1958. HTT_TX_TCL_METADATA_VALID_HTT_S)
  1959. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  1960. do { \
  1961. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  1962. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  1963. } while (0)
  1964. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  1965. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  1966. HTT_TX_TCL_METADATA_VDEV_ID_S)
  1967. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  1968. do { \
  1969. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  1970. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  1971. } while (0)
  1972. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  1973. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  1974. HTT_TX_TCL_METADATA_PDEV_ID_S)
  1975. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  1976. do { \
  1977. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  1978. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  1979. } while (0)
  1980. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  1981. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  1982. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  1983. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  1984. do { \
  1985. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  1986. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  1987. } while (0)
  1988. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  1989. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  1990. HTT_TX_TCL_METADATA_PEER_ID_S)
  1991. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  1992. do { \
  1993. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  1994. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  1995. } while (0)
  1996. typedef enum {
  1997. HTT_TX_FW2WBM_TX_STATUS_OK,
  1998. HTT_TX_FW2WBM_TX_STATUS_DROP,
  1999. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2000. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2001. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2002. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2003. HTT_TX_FW2WBM_TX_STATUS_MAX
  2004. } htt_tx_fw2wbm_tx_status_t;
  2005. typedef enum {
  2006. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2007. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2008. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2009. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2010. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2011. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2012. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2013. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2014. } htt_tx_fw2wbm_reinject_reason_t;
  2015. /**
  2016. * @brief HTT TX WBM Completion from firmware to host
  2017. * @details
  2018. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2019. * DWORD 3 and 4 for software based completions (Exception frames and
  2020. * TQM bypass frames)
  2021. * For software based completions, wbm_release_ring->release_source_module will
  2022. * be set to release_source_fw
  2023. */
  2024. PREPACK struct htt_tx_wbm_completion {
  2025. A_UINT32
  2026. sch_cmd_id: 24,
  2027. exception_frame: 1, /* If set, this packet was queued via exception path */
  2028. rsvd0_31_25: 7;
  2029. A_UINT32
  2030. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2031. * reception of an ACK or BA, this field indicates
  2032. * the RSSI of the received ACK or BA frame.
  2033. * When the frame is removed as result of a direct
  2034. * remove command from the SW, this field is set
  2035. * to 0x0 (which is never a valid value when real
  2036. * RSSI is available).
  2037. * Units: dB w.r.t noise floor
  2038. */
  2039. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2040. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2041. rsvd1_31_16: 16;
  2042. } POSTPACK;
  2043. /* DWORD 0 */
  2044. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2045. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2046. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2047. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2048. /* DWORD 1 */
  2049. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2050. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2051. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2052. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2053. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2054. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2055. /* DWORD 0 */
  2056. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2057. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2058. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2059. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2060. do { \
  2061. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2062. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2063. } while (0)
  2064. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2065. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2066. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2067. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2068. do { \
  2069. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2070. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2071. } while (0)
  2072. /* DWORD 1 */
  2073. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2074. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2075. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2076. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2077. do { \
  2078. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2079. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2080. } while (0)
  2081. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2082. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2083. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2084. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2085. do { \
  2086. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2087. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2088. } while (0)
  2089. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2090. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2091. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2092. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2093. do { \
  2094. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2095. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2096. } while (0)
  2097. /**
  2098. * @brief HTT TX WBM Completion from firmware to host
  2099. * @details
  2100. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2101. * (WBM) offload HW.
  2102. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2103. * For software based completions, release_source_module will
  2104. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2105. * struct wbm_release_ring and then switch to this after looking at
  2106. * release_source_module.
  2107. */
  2108. PREPACK struct htt_tx_wbm_completion_v2 {
  2109. A_UINT32
  2110. used_by_hw0; /* Refer to struct wbm_release_ring */
  2111. A_UINT32
  2112. used_by_hw1; /* Refer to struct wbm_release_ring */
  2113. A_UINT32
  2114. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2115. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2116. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2117. exception_frame: 1,
  2118. rsvd0: 12, /* For future use */
  2119. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2120. rsvd1: 1; /* For future use */
  2121. A_UINT32
  2122. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2123. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2124. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2125. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2126. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2127. */
  2128. A_UINT32
  2129. data1: 32;
  2130. A_UINT32
  2131. data2: 32;
  2132. A_UINT32
  2133. used_by_hw3; /* Refer to struct wbm_release_ring */
  2134. } POSTPACK;
  2135. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2136. /* DWORD 3 */
  2137. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2138. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2139. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2140. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2141. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2142. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2143. /* DWORD 3 */
  2144. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2145. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2146. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2147. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2148. do { \
  2149. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2150. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2151. } while (0)
  2152. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2153. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2154. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2155. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2156. do { \
  2157. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2158. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2159. } while (0)
  2160. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2161. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2162. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2163. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2164. do { \
  2165. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2166. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2167. } while (0)
  2168. /**
  2169. * @brief HTT TX WBM transmit status from firmware to host
  2170. * @details
  2171. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2172. * (WBM) offload HW.
  2173. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2174. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2175. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2176. */
  2177. PREPACK struct htt_tx_wbm_transmit_status {
  2178. A_UINT32
  2179. sch_cmd_id: 24,
  2180. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2181. * reception of an ACK or BA, this field indicates
  2182. * the RSSI of the received ACK or BA frame.
  2183. * When the frame is removed as result of a direct
  2184. * remove command from the SW, this field is set
  2185. * to 0x0 (which is never a valid value when real
  2186. * RSSI is available).
  2187. * Units: dB w.r.t noise floor
  2188. */
  2189. A_UINT32
  2190. sw_peer_id: 16,
  2191. tid_num: 5,
  2192. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2193. * and tid_num fields contain valid data.
  2194. * If this "valid" flag is not set, the
  2195. * sw_peer_id and tid_num fields must be ignored.
  2196. */
  2197. mcast: 1,
  2198. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2199. * contains valid data.
  2200. */
  2201. reserved0: 8;
  2202. A_UINT32
  2203. reserved1: 32;
  2204. } POSTPACK;
  2205. /* DWORD 4 */
  2206. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2207. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2208. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2209. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2210. /* DWORD 5 */
  2211. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2212. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2213. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2214. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2215. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2216. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2217. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2218. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2219. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2220. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2221. /* DWORD 4 */
  2222. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2223. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2224. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2225. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2226. do { \
  2227. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2228. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2229. } while (0)
  2230. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2231. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2232. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2233. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2234. do { \
  2235. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2236. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2237. } while (0)
  2238. /* DWORD 5 */
  2239. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2240. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2241. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2242. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2243. do { \
  2244. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2245. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2246. } while (0)
  2247. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2248. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2249. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2250. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2251. do { \
  2252. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2253. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2254. } while (0)
  2255. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2256. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2257. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2258. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2259. do { \
  2260. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2261. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2262. } while (0)
  2263. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2264. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2265. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2266. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2267. do { \
  2268. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2269. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2270. } while (0)
  2271. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2272. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2273. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2274. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2275. do { \
  2276. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2277. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2278. } while (0)
  2279. /**
  2280. * @brief HTT TX WBM reinject status from firmware to host
  2281. * @details
  2282. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2283. * (WBM) offload HW.
  2284. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2285. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2286. */
  2287. PREPACK struct htt_tx_wbm_reinject_status {
  2288. A_UINT32
  2289. reserved0: 32;
  2290. A_UINT32
  2291. reserved1: 32;
  2292. A_UINT32
  2293. reserved2: 32;
  2294. } POSTPACK;
  2295. /**
  2296. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2297. * @details
  2298. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2299. * (WBM) offload HW.
  2300. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2301. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2302. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2303. * STA side.
  2304. */
  2305. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2306. A_UINT32
  2307. mec_sa_addr_31_0;
  2308. A_UINT32
  2309. mec_sa_addr_47_32: 16,
  2310. sa_ast_index: 16;
  2311. A_UINT32
  2312. vdev_id: 8,
  2313. reserved0: 24;
  2314. } POSTPACK;
  2315. /* DWORD 4 - mec_sa_addr_31_0 */
  2316. /* DWORD 5 */
  2317. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2318. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2319. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2320. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2321. /* DWORD 6 */
  2322. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2323. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2324. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2325. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2326. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2327. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2328. do { \
  2329. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2330. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2331. } while (0)
  2332. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2333. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2334. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2335. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2336. do { \
  2337. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2338. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2339. } while (0)
  2340. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2341. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2342. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2343. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2344. do { \
  2345. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2346. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2347. } while (0)
  2348. typedef enum {
  2349. TX_FLOW_PRIORITY_BE,
  2350. TX_FLOW_PRIORITY_HIGH,
  2351. TX_FLOW_PRIORITY_LOW,
  2352. } htt_tx_flow_priority_t;
  2353. typedef enum {
  2354. TX_FLOW_LATENCY_SENSITIVE,
  2355. TX_FLOW_LATENCY_INSENSITIVE,
  2356. } htt_tx_flow_latency_t;
  2357. typedef enum {
  2358. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2359. TX_FLOW_INTERACTIVE_TRAFFIC,
  2360. TX_FLOW_PERIODIC_TRAFFIC,
  2361. TX_FLOW_BURSTY_TRAFFIC,
  2362. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2363. } htt_tx_flow_traffic_pattern_t;
  2364. /**
  2365. * @brief HTT TX Flow search metadata format
  2366. * @details
  2367. * Host will set this metadata in flow table's flow search entry along with
  2368. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2369. * firmware and TQM ring if the flow search entry wins.
  2370. * This metadata is available to firmware in that first MSDU's
  2371. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2372. * to one of the available flows for specific tid and returns the tqm flow
  2373. * pointer as part of htt_tx_map_flow_info message.
  2374. */
  2375. PREPACK struct htt_tx_flow_metadata {
  2376. A_UINT32
  2377. rsvd0_1_0: 2,
  2378. tid: 4,
  2379. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2380. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2381. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2382. * Else choose final tid based on latency, priority.
  2383. */
  2384. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2385. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2386. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2387. } POSTPACK;
  2388. /* DWORD 0 */
  2389. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2390. #define HTT_TX_FLOW_METADATA_TID_S 2
  2391. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2392. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2393. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2394. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2395. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2396. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2397. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2398. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2399. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2400. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2401. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2402. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2403. /* DWORD 0 */
  2404. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2405. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2406. HTT_TX_FLOW_METADATA_TID_S)
  2407. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2408. do { \
  2409. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2410. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2411. } while (0)
  2412. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2413. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2414. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2415. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2416. do { \
  2417. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2418. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2419. } while (0)
  2420. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2421. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2422. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2423. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2424. do { \
  2425. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2426. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2427. } while (0)
  2428. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2429. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2430. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2431. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2432. do { \
  2433. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2434. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2435. } while (0)
  2436. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2437. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2438. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2439. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2440. do { \
  2441. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2442. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2443. } while (0)
  2444. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2445. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2446. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2447. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2448. do { \
  2449. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2450. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2451. } while (0)
  2452. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2453. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2454. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2455. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2456. do { \
  2457. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2458. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2459. } while (0)
  2460. /**
  2461. * @brief Used in HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY and HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY messages
  2462. *
  2463. * @details
  2464. * HTT wds entry from source port learning
  2465. * Host will learn wds entries from rx and send this message to firmware
  2466. * to enable firmware to configure/delete AST entries for wds clients.
  2467. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2468. * and when SA's entry is deleted, firmware removes this AST entry
  2469. *
  2470. * The message would appear as follows:
  2471. *
  2472. * |31 30|29 |17 16|15 8|7 0|
  2473. * |----------------+----------------+----------------+----------------|
  2474. * | rsvd0 |PDVID| vdev_id | msg_type |
  2475. * |-------------------------------------------------------------------|
  2476. * | sa_addr_31_0 |
  2477. * |-------------------------------------------------------------------|
  2478. * | | ta_peer_id | sa_addr_47_32 |
  2479. * |-------------------------------------------------------------------|
  2480. * Where PDVID = pdev_id
  2481. *
  2482. * The message is interpreted as follows:
  2483. *
  2484. * dword0 - b'0:7 - msg_type: This will be set to
  2485. * HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY or
  2486. * HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2487. *
  2488. * dword0 - b'8:15 - vdev_id
  2489. *
  2490. * dword0 - b'16:17 - pdev_id
  2491. *
  2492. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2493. *
  2494. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2495. *
  2496. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2497. *
  2498. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2499. */
  2500. PREPACK struct htt_wds_entry {
  2501. A_UINT32
  2502. msg_type: 8,
  2503. vdev_id: 8,
  2504. pdev_id: 2,
  2505. rsvd0: 14;
  2506. A_UINT32 sa_addr_31_0;
  2507. A_UINT32
  2508. sa_addr_47_32: 16,
  2509. ta_peer_id: 14,
  2510. rsvd2: 2;
  2511. } POSTPACK;
  2512. /* DWORD 0 */
  2513. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2514. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2515. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2516. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2517. /* DWORD 2 */
  2518. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2519. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2520. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2521. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2522. /* DWORD 0 */
  2523. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2524. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2525. HTT_WDS_ENTRY_VDEV_ID_S)
  2526. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2527. do { \
  2528. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2529. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2530. } while (0)
  2531. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2532. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2533. HTT_WDS_ENTRY_PDEV_ID_S)
  2534. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2535. do { \
  2536. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2537. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2538. } while (0)
  2539. /* DWORD 2 */
  2540. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2541. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2542. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2543. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2544. do { \
  2545. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2546. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2547. } while (0)
  2548. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2549. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2550. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2551. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2552. do { \
  2553. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2554. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2555. } while (0)
  2556. /**
  2557. * @brief MAC DMA rx ring setup specification
  2558. * @details
  2559. * To allow for dynamic rx ring reconfiguration and to avoid race
  2560. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2561. * it uses. Instead, it sends this message to the target, indicating how
  2562. * the rx ring used by the host should be set up and maintained.
  2563. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2564. * specifications.
  2565. *
  2566. * |31 16|15 8|7 0|
  2567. * |---------------------------------------------------------------|
  2568. * header: | reserved | num rings | msg type |
  2569. * |---------------------------------------------------------------|
  2570. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2571. #if HTT_PADDR64
  2572. * | FW_IDX shadow register physical address (bits 63:32) |
  2573. #endif
  2574. * |---------------------------------------------------------------|
  2575. * | rx ring base physical address (bits 31:0) |
  2576. #if HTT_PADDR64
  2577. * | rx ring base physical address (bits 63:32) |
  2578. #endif
  2579. * |---------------------------------------------------------------|
  2580. * | rx ring buffer size | rx ring length |
  2581. * |---------------------------------------------------------------|
  2582. * | FW_IDX initial value | enabled flags |
  2583. * |---------------------------------------------------------------|
  2584. * | MSDU payload offset | 802.11 header offset |
  2585. * |---------------------------------------------------------------|
  2586. * | PPDU end offset | PPDU start offset |
  2587. * |---------------------------------------------------------------|
  2588. * | MPDU end offset | MPDU start offset |
  2589. * |---------------------------------------------------------------|
  2590. * | MSDU end offset | MSDU start offset |
  2591. * |---------------------------------------------------------------|
  2592. * | frag info offset | rx attention offset |
  2593. * |---------------------------------------------------------------|
  2594. * payload 2, if present, has the same format as payload 1
  2595. * Header fields:
  2596. * - MSG_TYPE
  2597. * Bits 7:0
  2598. * Purpose: identifies this as an rx ring configuration message
  2599. * Value: 0x2
  2600. * - NUM_RINGS
  2601. * Bits 15:8
  2602. * Purpose: indicates whether the host is setting up one rx ring or two
  2603. * Value: 1 or 2
  2604. * Payload:
  2605. * for systems using 64-bit format for bus addresses:
  2606. * - IDX_SHADOW_REG_PADDR_LO
  2607. * Bits 31:0
  2608. * Value: lower 4 bytes of physical address of the host's
  2609. * FW_IDX shadow register
  2610. * - IDX_SHADOW_REG_PADDR_HI
  2611. * Bits 31:0
  2612. * Value: upper 4 bytes of physical address of the host's
  2613. * FW_IDX shadow register
  2614. * - RING_BASE_PADDR_LO
  2615. * Bits 31:0
  2616. * Value: lower 4 bytes of physical address of the host's rx ring
  2617. * - RING_BASE_PADDR_HI
  2618. * Bits 31:0
  2619. * Value: uppper 4 bytes of physical address of the host's rx ring
  2620. * for systems using 32-bit format for bus addresses:
  2621. * - IDX_SHADOW_REG_PADDR
  2622. * Bits 31:0
  2623. * Value: physical address of the host's FW_IDX shadow register
  2624. * - RING_BASE_PADDR
  2625. * Bits 31:0
  2626. * Value: physical address of the host's rx ring
  2627. * - RING_LEN
  2628. * Bits 15:0
  2629. * Value: number of elements in the rx ring
  2630. * - RING_BUF_SZ
  2631. * Bits 31:16
  2632. * Value: size of the buffers referenced by the rx ring, in byte units
  2633. * - ENABLED_FLAGS
  2634. * Bits 15:0
  2635. * Value: 1-bit flags to show whether different rx fields are enabled
  2636. * bit 0: 802.11 header enabled (1) or disabled (0)
  2637. * bit 1: MSDU payload enabled (1) or disabled (0)
  2638. * bit 2: PPDU start enabled (1) or disabled (0)
  2639. * bit 3: PPDU end enabled (1) or disabled (0)
  2640. * bit 4: MPDU start enabled (1) or disabled (0)
  2641. * bit 5: MPDU end enabled (1) or disabled (0)
  2642. * bit 6: MSDU start enabled (1) or disabled (0)
  2643. * bit 7: MSDU end enabled (1) or disabled (0)
  2644. * bit 8: rx attention enabled (1) or disabled (0)
  2645. * bit 9: frag info enabled (1) or disabled (0)
  2646. * bit 10: unicast rx enabled (1) or disabled (0)
  2647. * bit 11: multicast rx enabled (1) or disabled (0)
  2648. * bit 12: ctrl rx enabled (1) or disabled (0)
  2649. * bit 13: mgmt rx enabled (1) or disabled (0)
  2650. * bit 14: null rx enabled (1) or disabled (0)
  2651. * bit 15: phy data rx enabled (1) or disabled (0)
  2652. * - IDX_INIT_VAL
  2653. * Bits 31:16
  2654. * Purpose: Specify the initial value for the FW_IDX.
  2655. * Value: the number of buffers initially present in the host's rx ring
  2656. * - OFFSET_802_11_HDR
  2657. * Bits 15:0
  2658. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2659. * - OFFSET_MSDU_PAYLOAD
  2660. * Bits 31:16
  2661. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2662. * - OFFSET_PPDU_START
  2663. * Bits 15:0
  2664. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2665. * - OFFSET_PPDU_END
  2666. * Bits 31:16
  2667. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2668. * - OFFSET_MPDU_START
  2669. * Bits 15:0
  2670. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2671. * - OFFSET_MPDU_END
  2672. * Bits 31:16
  2673. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2674. * - OFFSET_MSDU_START
  2675. * Bits 15:0
  2676. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2677. * - OFFSET_MSDU_END
  2678. * Bits 31:16
  2679. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2680. * - OFFSET_RX_ATTN
  2681. * Bits 15:0
  2682. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2683. * - OFFSET_FRAG_INFO
  2684. * Bits 31:16
  2685. * Value: offset in QUAD-bytes of frag info table
  2686. */
  2687. /* header fields */
  2688. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2689. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2690. /* payload fields */
  2691. /* for systems using a 64-bit format for bus addresses */
  2692. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2693. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2694. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2695. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2696. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2697. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2698. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2699. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2700. /* for systems using a 32-bit format for bus addresses */
  2701. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2702. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2703. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2704. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2705. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2706. #define HTT_RX_RING_CFG_LEN_S 0
  2707. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2708. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2709. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2710. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2711. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2712. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2713. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2714. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2715. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2716. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2717. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2718. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2719. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2720. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2721. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2722. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2723. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2724. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2725. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2726. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2727. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2728. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2729. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2730. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2731. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2732. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2733. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2734. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2735. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2736. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2737. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2738. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2739. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2740. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2741. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2742. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2743. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2744. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2745. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2746. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2747. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2748. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2749. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2750. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2751. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2752. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2753. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2754. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2755. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2756. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2757. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2758. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2759. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2760. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2761. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2762. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2763. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2764. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2765. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2766. #if HTT_PADDR64
  2767. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2768. #else
  2769. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2770. #endif
  2771. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2772. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2773. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2774. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2775. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2776. do { \
  2777. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2778. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2779. } while (0)
  2780. /* degenerate case for 32-bit fields */
  2781. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  2782. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  2783. ((_var) = (_val))
  2784. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  2785. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  2786. ((_var) = (_val))
  2787. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  2788. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  2789. ((_var) = (_val))
  2790. /* degenerate case for 32-bit fields */
  2791. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  2792. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  2793. ((_var) = (_val))
  2794. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  2795. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  2796. ((_var) = (_val))
  2797. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  2798. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  2799. ((_var) = (_val))
  2800. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  2801. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  2802. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  2803. do { \
  2804. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  2805. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  2806. } while (0)
  2807. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  2808. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  2809. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  2810. do { \
  2811. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  2812. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  2813. } while (0)
  2814. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  2815. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  2816. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  2817. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  2818. do { \
  2819. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  2820. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  2821. } while (0)
  2822. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  2823. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  2824. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  2825. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  2826. do { \
  2827. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  2828. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  2829. } while (0)
  2830. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  2831. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  2832. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  2833. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  2834. do { \
  2835. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  2836. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  2837. } while (0)
  2838. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  2839. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  2840. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  2841. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  2842. do { \
  2843. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  2844. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  2845. } while (0)
  2846. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  2847. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  2848. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  2849. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  2850. do { \
  2851. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  2852. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  2853. } while (0)
  2854. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  2855. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  2856. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  2857. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  2858. do { \
  2859. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  2860. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  2861. } while (0)
  2862. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  2863. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  2864. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  2865. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  2866. do { \
  2867. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  2868. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  2869. } while (0)
  2870. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  2871. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  2872. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  2873. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  2874. do { \
  2875. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  2876. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  2877. } while (0)
  2878. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  2879. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  2880. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  2881. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  2882. do { \
  2883. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  2884. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  2885. } while (0)
  2886. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  2887. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  2888. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  2889. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  2890. do { \
  2891. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  2892. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  2893. } while (0)
  2894. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  2895. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  2896. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  2897. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  2898. do { \
  2899. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  2900. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  2901. } while (0)
  2902. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  2903. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  2904. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  2905. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  2906. do { \
  2907. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  2908. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  2909. } while (0)
  2910. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  2911. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  2912. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  2913. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  2914. do { \
  2915. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  2916. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  2917. } while (0)
  2918. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  2919. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  2920. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  2921. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  2922. do { \
  2923. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  2924. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  2925. } while (0)
  2926. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  2927. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  2928. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  2929. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  2930. do { \
  2931. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  2932. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  2933. } while (0)
  2934. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  2935. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  2936. HTT_RX_RING_CFG_ENABLED_NULL_S)
  2937. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  2938. do { \
  2939. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  2940. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  2941. } while (0)
  2942. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  2943. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  2944. HTT_RX_RING_CFG_ENABLED_PHY_S)
  2945. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  2946. do { \
  2947. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  2948. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  2949. } while (0)
  2950. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  2951. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  2952. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  2953. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  2954. do { \
  2955. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  2956. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  2957. } while (0)
  2958. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  2959. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  2960. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  2961. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  2962. do { \
  2963. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  2964. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  2965. } while (0)
  2966. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  2967. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  2968. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  2969. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  2970. do { \
  2971. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  2972. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  2973. } while (0)
  2974. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  2975. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  2976. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  2977. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  2978. do { \
  2979. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  2980. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  2981. } while (0)
  2982. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  2983. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  2984. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  2985. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  2986. do { \
  2987. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  2988. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  2989. } while (0)
  2990. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  2991. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  2992. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  2993. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  2994. do { \
  2995. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  2996. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  2997. } while (0)
  2998. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  2999. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3000. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3001. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3002. do { \
  3003. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3004. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3005. } while (0)
  3006. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3007. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3008. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3009. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3010. do { \
  3011. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3012. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3013. } while (0)
  3014. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3015. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3016. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3017. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3018. do { \
  3019. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3020. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3021. } while (0)
  3022. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3023. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3024. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3025. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3026. do { \
  3027. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3028. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3029. } while (0)
  3030. /**
  3031. * @brief host -> target FW statistics retrieve
  3032. *
  3033. * @details
  3034. * The following field definitions describe the format of the HTT host
  3035. * to target FW stats retrieve message. The message specifies the type of
  3036. * stats host wants to retrieve.
  3037. *
  3038. * |31 24|23 16|15 8|7 0|
  3039. * |-----------------------------------------------------------|
  3040. * | stats types request bitmask | msg type |
  3041. * |-----------------------------------------------------------|
  3042. * | stats types reset bitmask | reserved |
  3043. * |-----------------------------------------------------------|
  3044. * | stats type | config value |
  3045. * |-----------------------------------------------------------|
  3046. * | cookie LSBs |
  3047. * |-----------------------------------------------------------|
  3048. * | cookie MSBs |
  3049. * |-----------------------------------------------------------|
  3050. * Header fields:
  3051. * - MSG_TYPE
  3052. * Bits 7:0
  3053. * Purpose: identifies this is a stats upload request message
  3054. * Value: 0x3
  3055. * - UPLOAD_TYPES
  3056. * Bits 31:8
  3057. * Purpose: identifies which types of FW statistics to upload
  3058. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3059. * - RESET_TYPES
  3060. * Bits 31:8
  3061. * Purpose: identifies which types of FW statistics to reset
  3062. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3063. * - CFG_VAL
  3064. * Bits 23:0
  3065. * Purpose: give an opaque configuration value to the specified stats type
  3066. * Value: stats-type specific configuration value
  3067. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3068. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3069. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3070. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3071. * - CFG_STAT_TYPE
  3072. * Bits 31:24
  3073. * Purpose: specify which stats type (if any) the config value applies to
  3074. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3075. * a valid configuration specification
  3076. * - COOKIE_LSBS
  3077. * Bits 31:0
  3078. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3079. * message with its preceding host->target stats request message.
  3080. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3081. * - COOKIE_MSBS
  3082. * Bits 31:0
  3083. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3084. * message with its preceding host->target stats request message.
  3085. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3086. */
  3087. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3088. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3089. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3090. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3091. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3092. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3093. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3094. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3095. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3096. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3097. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3098. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3099. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3100. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3101. do { \
  3102. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3103. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3104. } while (0)
  3105. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3106. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3107. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3108. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3109. do { \
  3110. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3111. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3112. } while (0)
  3113. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3114. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3115. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3116. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3117. do { \
  3118. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3119. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3120. } while (0)
  3121. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3122. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3123. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3124. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3125. do { \
  3126. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3127. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3128. } while (0)
  3129. /**
  3130. * @brief host -> target HTT out-of-band sync request
  3131. *
  3132. * @details
  3133. * The HTT SYNC tells the target to suspend processing of subsequent
  3134. * HTT host-to-target messages until some other target agent locally
  3135. * informs the target HTT FW that the current sync counter is equal to
  3136. * or greater than (in a modulo sense) the sync counter specified in
  3137. * the SYNC message.
  3138. * This allows other host-target components to synchronize their operation
  3139. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3140. * security key has been downloaded to and activated by the target.
  3141. * In the absence of any explicit synchronization counter value
  3142. * specification, the target HTT FW will use zero as the default current
  3143. * sync value.
  3144. *
  3145. * |31 24|23 16|15 8|7 0|
  3146. * |-----------------------------------------------------------|
  3147. * | reserved | sync count | msg type |
  3148. * |-----------------------------------------------------------|
  3149. * Header fields:
  3150. * - MSG_TYPE
  3151. * Bits 7:0
  3152. * Purpose: identifies this as a sync message
  3153. * Value: 0x4
  3154. * - SYNC_COUNT
  3155. * Bits 15:8
  3156. * Purpose: specifies what sync value the HTT FW will wait for from
  3157. * an out-of-band specification to resume its operation
  3158. * Value: in-band sync counter value to compare against the out-of-band
  3159. * counter spec.
  3160. * The HTT target FW will suspend its host->target message processing
  3161. * as long as
  3162. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3163. */
  3164. #define HTT_H2T_SYNC_MSG_SZ 4
  3165. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3166. #define HTT_H2T_SYNC_COUNT_S 8
  3167. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3168. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3169. HTT_H2T_SYNC_COUNT_S)
  3170. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3171. do { \
  3172. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3173. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3174. } while (0)
  3175. /**
  3176. * @brief HTT aggregation configuration
  3177. */
  3178. #define HTT_AGGR_CFG_MSG_SZ 4
  3179. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3180. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3181. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3182. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3183. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3184. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3185. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3186. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3187. do { \
  3188. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3189. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3190. } while (0)
  3191. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3192. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3193. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3194. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3195. do { \
  3196. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3197. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3198. } while (0)
  3199. /**
  3200. * @brief host -> target HTT configure max amsdu info per vdev
  3201. *
  3202. * @details
  3203. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3204. *
  3205. * |31 21|20 16|15 8|7 0|
  3206. * |-----------------------------------------------------------|
  3207. * | reserved | vdev id | max amsdu | msg type |
  3208. * |-----------------------------------------------------------|
  3209. * Header fields:
  3210. * - MSG_TYPE
  3211. * Bits 7:0
  3212. * Purpose: identifies this as a aggr cfg ex message
  3213. * Value: 0xa
  3214. * - MAX_NUM_AMSDU_SUBFRM
  3215. * Bits 15:8
  3216. * Purpose: max MSDUs per A-MSDU
  3217. * - VDEV_ID
  3218. * Bits 20:16
  3219. * Purpose: ID of the vdev to which this limit is applied
  3220. */
  3221. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3222. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3223. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3224. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3225. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3226. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3227. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3228. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3229. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3230. do { \
  3231. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3232. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3233. } while (0)
  3234. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3235. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3236. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3237. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3238. do { \
  3239. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3240. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3241. } while (0)
  3242. /**
  3243. * @brief HTT WDI_IPA Config Message
  3244. *
  3245. * @details
  3246. * The HTT WDI_IPA config message is created/sent by host at driver
  3247. * init time. It contains information about data structures used on
  3248. * WDI_IPA TX and RX path.
  3249. * TX CE ring is used for pushing packet metadata from IPA uC
  3250. * to WLAN FW
  3251. * TX Completion ring is used for generating TX completions from
  3252. * WLAN FW to IPA uC
  3253. * RX Indication ring is used for indicating RX packets from FW
  3254. * to IPA uC
  3255. * RX Ring2 is used as either completion ring or as second
  3256. * indication ring. when Ring2 is used as completion ring, IPA uC
  3257. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3258. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3259. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3260. * indicated in RX Indication ring. Please see WDI_IPA specification
  3261. * for more details.
  3262. * |31 24|23 16|15 8|7 0|
  3263. * |----------------+----------------+----------------+----------------|
  3264. * | tx pkt pool size | Rsvd | msg_type |
  3265. * |-------------------------------------------------------------------|
  3266. * | tx comp ring base (bits 31:0) |
  3267. #if HTT_PADDR64
  3268. * | tx comp ring base (bits 63:32) |
  3269. #endif
  3270. * |-------------------------------------------------------------------|
  3271. * | tx comp ring size |
  3272. * |-------------------------------------------------------------------|
  3273. * | tx comp WR_IDX physical address (bits 31:0) |
  3274. #if HTT_PADDR64
  3275. * | tx comp WR_IDX physical address (bits 63:32) |
  3276. #endif
  3277. * |-------------------------------------------------------------------|
  3278. * | tx CE WR_IDX physical address (bits 31:0) |
  3279. #if HTT_PADDR64
  3280. * | tx CE WR_IDX physical address (bits 63:32) |
  3281. #endif
  3282. * |-------------------------------------------------------------------|
  3283. * | rx indication ring base (bits 31:0) |
  3284. #if HTT_PADDR64
  3285. * | rx indication ring base (bits 63:32) |
  3286. #endif
  3287. * |-------------------------------------------------------------------|
  3288. * | rx indication ring size |
  3289. * |-------------------------------------------------------------------|
  3290. * | rx ind RD_IDX physical address (bits 31:0) |
  3291. #if HTT_PADDR64
  3292. * | rx ind RD_IDX physical address (bits 63:32) |
  3293. #endif
  3294. * |-------------------------------------------------------------------|
  3295. * | rx ind WR_IDX physical address (bits 31:0) |
  3296. #if HTT_PADDR64
  3297. * | rx ind WR_IDX physical address (bits 63:32) |
  3298. #endif
  3299. * |-------------------------------------------------------------------|
  3300. * |-------------------------------------------------------------------|
  3301. * | rx ring2 base (bits 31:0) |
  3302. #if HTT_PADDR64
  3303. * | rx ring2 base (bits 63:32) |
  3304. #endif
  3305. * |-------------------------------------------------------------------|
  3306. * | rx ring2 size |
  3307. * |-------------------------------------------------------------------|
  3308. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3309. #if HTT_PADDR64
  3310. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3311. #endif
  3312. * |-------------------------------------------------------------------|
  3313. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3314. #if HTT_PADDR64
  3315. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3316. #endif
  3317. * |-------------------------------------------------------------------|
  3318. *
  3319. * Header fields:
  3320. * Header fields:
  3321. * - MSG_TYPE
  3322. * Bits 7:0
  3323. * Purpose: Identifies this as WDI_IPA config message
  3324. * value: = 0x8
  3325. * - TX_PKT_POOL_SIZE
  3326. * Bits 15:0
  3327. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3328. * WDI_IPA TX path
  3329. * For systems using 32-bit format for bus addresses:
  3330. * - TX_COMP_RING_BASE_ADDR
  3331. * Bits 31:0
  3332. * Purpose: TX Completion Ring base address in DDR
  3333. * - TX_COMP_RING_SIZE
  3334. * Bits 31:0
  3335. * Purpose: TX Completion Ring size (must be power of 2)
  3336. * - TX_COMP_WR_IDX_ADDR
  3337. * Bits 31:0
  3338. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3339. * updates the Write Index for WDI_IPA TX completion ring
  3340. * - TX_CE_WR_IDX_ADDR
  3341. * Bits 31:0
  3342. * Purpose: DDR address where IPA uC
  3343. * updates the WR Index for TX CE ring
  3344. * (needed for fusion platforms)
  3345. * - RX_IND_RING_BASE_ADDR
  3346. * Bits 31:0
  3347. * Purpose: RX Indication Ring base address in DDR
  3348. * - RX_IND_RING_SIZE
  3349. * Bits 31:0
  3350. * Purpose: RX Indication Ring size
  3351. * - RX_IND_RD_IDX_ADDR
  3352. * Bits 31:0
  3353. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3354. * RX indication ring
  3355. * - RX_IND_WR_IDX_ADDR
  3356. * Bits 31:0
  3357. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3358. * updates the Write Index for WDI_IPA RX indication ring
  3359. * - RX_RING2_BASE_ADDR
  3360. * Bits 31:0
  3361. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3362. * - RX_RING2_SIZE
  3363. * Bits 31:0
  3364. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3365. * - RX_RING2_RD_IDX_ADDR
  3366. * Bits 31:0
  3367. * Purpose: If Second RX ring is Indication ring, DDR address where
  3368. * IPA uC updates the Read Index for Ring2.
  3369. * If Second RX ring is completion ring, this is NOT used
  3370. * - RX_RING2_WR_IDX_ADDR
  3371. * Bits 31:0
  3372. * Purpose: If Second RX ring is Indication ring, DDR address where
  3373. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3374. * If second RX ring is completion ring, DDR address where
  3375. * IPA uC updates the Write Index for Ring 2.
  3376. * For systems using 64-bit format for bus addresses:
  3377. * - TX_COMP_RING_BASE_ADDR_LO
  3378. * Bits 31:0
  3379. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3380. * - TX_COMP_RING_BASE_ADDR_HI
  3381. * Bits 31:0
  3382. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3383. * - TX_COMP_RING_SIZE
  3384. * Bits 31:0
  3385. * Purpose: TX Completion Ring size (must be power of 2)
  3386. * - TX_COMP_WR_IDX_ADDR_LO
  3387. * Bits 31:0
  3388. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3389. * Lower 4 bytes of DDR address where WIFI FW
  3390. * updates the Write Index for WDI_IPA TX completion ring
  3391. * - TX_COMP_WR_IDX_ADDR_HI
  3392. * Bits 31:0
  3393. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3394. * Higher 4 bytes of DDR address where WIFI FW
  3395. * updates the Write Index for WDI_IPA TX completion ring
  3396. * - TX_CE_WR_IDX_ADDR_LO
  3397. * Bits 31:0
  3398. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3399. * updates the WR Index for TX CE ring
  3400. * (needed for fusion platforms)
  3401. * - TX_CE_WR_IDX_ADDR_HI
  3402. * Bits 31:0
  3403. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3404. * updates the WR Index for TX CE ring
  3405. * (needed for fusion platforms)
  3406. * - RX_IND_RING_BASE_ADDR_LO
  3407. * Bits 31:0
  3408. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3409. * - RX_IND_RING_BASE_ADDR_HI
  3410. * Bits 31:0
  3411. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3412. * - RX_IND_RING_SIZE
  3413. * Bits 31:0
  3414. * Purpose: RX Indication Ring size
  3415. * - RX_IND_RD_IDX_ADDR_LO
  3416. * Bits 31:0
  3417. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3418. * for WDI_IPA RX indication ring
  3419. * - RX_IND_RD_IDX_ADDR_HI
  3420. * Bits 31:0
  3421. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3422. * for WDI_IPA RX indication ring
  3423. * - RX_IND_WR_IDX_ADDR_LO
  3424. * Bits 31:0
  3425. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3426. * Lower 4 bytes of DDR address where WIFI FW
  3427. * updates the Write Index for WDI_IPA RX indication ring
  3428. * - RX_IND_WR_IDX_ADDR_HI
  3429. * Bits 31:0
  3430. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3431. * Higher 4 bytes of DDR address where WIFI FW
  3432. * updates the Write Index for WDI_IPA RX indication ring
  3433. * - RX_RING2_BASE_ADDR_LO
  3434. * Bits 31:0
  3435. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3436. * - RX_RING2_BASE_ADDR_HI
  3437. * Bits 31:0
  3438. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3439. * - RX_RING2_SIZE
  3440. * Bits 31:0
  3441. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3442. * - RX_RING2_RD_IDX_ADDR_LO
  3443. * Bits 31:0
  3444. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3445. * DDR address where IPA uC updates the Read Index for Ring2.
  3446. * If Second RX ring is completion ring, this is NOT used
  3447. * - RX_RING2_RD_IDX_ADDR_HI
  3448. * Bits 31:0
  3449. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3450. * DDR address where IPA uC updates the Read Index for Ring2.
  3451. * If Second RX ring is completion ring, this is NOT used
  3452. * - RX_RING2_WR_IDX_ADDR_LO
  3453. * Bits 31:0
  3454. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3455. * DDR address where WIFI FW updates the Write Index
  3456. * for WDI_IPA RX ring2
  3457. * If second RX ring is completion ring, lower 4 bytes of
  3458. * DDR address where IPA uC updates the Write Index for Ring 2.
  3459. * - RX_RING2_WR_IDX_ADDR_HI
  3460. * Bits 31:0
  3461. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3462. * DDR address where WIFI FW updates the Write Index
  3463. * for WDI_IPA RX ring2
  3464. * If second RX ring is completion ring, higher 4 bytes of
  3465. * DDR address where IPA uC updates the Write Index for Ring 2.
  3466. */
  3467. #if HTT_PADDR64
  3468. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3469. #else
  3470. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3471. #endif
  3472. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3473. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3474. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3475. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3476. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3477. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3478. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3479. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3480. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3481. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3482. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3483. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3484. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3485. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3486. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3487. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3488. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3489. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3490. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3491. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3492. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3493. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3494. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3495. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3496. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3497. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3498. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3499. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3500. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3501. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3502. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3503. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3504. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3505. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3506. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3507. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3508. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3509. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3510. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3511. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3512. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3513. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3514. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3515. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3516. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3517. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3518. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3519. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3520. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3521. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3522. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3523. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3524. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3525. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3526. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3527. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3528. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3529. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3530. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3531. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3532. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3533. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3534. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3535. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3536. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3537. do { \
  3538. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3539. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3540. } while (0)
  3541. /* for systems using 32-bit format for bus addr */
  3542. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3543. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3544. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3545. do { \
  3546. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3547. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3548. } while (0)
  3549. /* for systems using 64-bit format for bus addr */
  3550. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3551. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3552. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3553. do { \
  3554. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3555. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3556. } while (0)
  3557. /* for systems using 64-bit format for bus addr */
  3558. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3559. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3560. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3561. do { \
  3562. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3563. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3564. } while (0)
  3565. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3566. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3567. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3568. do { \
  3569. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3570. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3571. } while (0)
  3572. /* for systems using 32-bit format for bus addr */
  3573. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3574. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3575. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3576. do { \
  3577. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3578. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3579. } while (0)
  3580. /* for systems using 64-bit format for bus addr */
  3581. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3582. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3583. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3584. do { \
  3585. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3586. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3587. } while (0)
  3588. /* for systems using 64-bit format for bus addr */
  3589. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3590. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3591. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3592. do { \
  3593. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3594. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3595. } while (0)
  3596. /* for systems using 32-bit format for bus addr */
  3597. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3598. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3599. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3600. do { \
  3601. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3602. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3603. } while (0)
  3604. /* for systems using 64-bit format for bus addr */
  3605. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3606. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3607. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3608. do { \
  3609. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3610. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3611. } while (0)
  3612. /* for systems using 64-bit format for bus addr */
  3613. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3614. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3615. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3616. do { \
  3617. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3618. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3619. } while (0)
  3620. /* for systems using 32-bit format for bus addr */
  3621. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3622. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3623. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3624. do { \
  3625. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3626. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3627. } while (0)
  3628. /* for systems using 64-bit format for bus addr */
  3629. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3630. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3631. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3632. do { \
  3633. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3634. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3635. } while (0)
  3636. /* for systems using 64-bit format for bus addr */
  3637. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3638. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3639. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3640. do { \
  3641. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3642. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3643. } while (0)
  3644. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3645. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3646. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3647. do { \
  3648. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3649. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3650. } while (0)
  3651. /* for systems using 32-bit format for bus addr */
  3652. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3653. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3654. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3655. do { \
  3656. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3657. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3658. } while (0)
  3659. /* for systems using 64-bit format for bus addr */
  3660. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3661. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3662. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3663. do { \
  3664. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3665. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3666. } while (0)
  3667. /* for systems using 64-bit format for bus addr */
  3668. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3669. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3670. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3671. do { \
  3672. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3673. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3674. } while (0)
  3675. /* for systems using 32-bit format for bus addr */
  3676. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3677. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3678. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3679. do { \
  3680. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3681. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3682. } while (0)
  3683. /* for systems using 64-bit format for bus addr */
  3684. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3685. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3686. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3687. do { \
  3688. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3689. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3690. } while (0)
  3691. /* for systems using 64-bit format for bus addr */
  3692. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3693. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3694. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3695. do { \
  3696. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3697. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3698. } while (0)
  3699. /* for systems using 32-bit format for bus addr */
  3700. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3701. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3702. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3703. do { \
  3704. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3705. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3706. } while (0)
  3707. /* for systems using 64-bit format for bus addr */
  3708. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3709. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3710. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3711. do { \
  3712. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3713. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3714. } while (0)
  3715. /* for systems using 64-bit format for bus addr */
  3716. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3717. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3718. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3719. do { \
  3720. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3721. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3722. } while (0)
  3723. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3724. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3725. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3726. do { \
  3727. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3728. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3729. } while (0)
  3730. /* for systems using 32-bit format for bus addr */
  3731. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3732. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3733. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3734. do { \
  3735. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3736. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3737. } while (0)
  3738. /* for systems using 64-bit format for bus addr */
  3739. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3740. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3741. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3742. do { \
  3743. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3744. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3745. } while (0)
  3746. /* for systems using 64-bit format for bus addr */
  3747. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3748. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3749. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3750. do { \
  3751. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3752. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3753. } while (0)
  3754. /* for systems using 32-bit format for bus addr */
  3755. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3756. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3757. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3758. do { \
  3759. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3760. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3761. } while (0)
  3762. /* for systems using 64-bit format for bus addr */
  3763. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3764. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3765. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3766. do { \
  3767. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3768. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3769. } while (0)
  3770. /* for systems using 64-bit format for bus addr */
  3771. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  3772. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  3773. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  3774. do { \
  3775. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  3776. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  3777. } while (0)
  3778. /*
  3779. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  3780. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  3781. * addresses are stored in a XXX-bit field.
  3782. * This macro is used to define both htt_wdi_ipa_config32_t and
  3783. * htt_wdi_ipa_config64_t structs.
  3784. */
  3785. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  3786. _paddr__tx_comp_ring_base_addr_, \
  3787. _paddr__tx_comp_wr_idx_addr_, \
  3788. _paddr__tx_ce_wr_idx_addr_, \
  3789. _paddr__rx_ind_ring_base_addr_, \
  3790. _paddr__rx_ind_rd_idx_addr_, \
  3791. _paddr__rx_ind_wr_idx_addr_, \
  3792. _paddr__rx_ring2_base_addr_,\
  3793. _paddr__rx_ring2_rd_idx_addr_,\
  3794. _paddr__rx_ring2_wr_idx_addr_) \
  3795. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  3796. { \
  3797. /* DWORD 0: flags and meta-data */ \
  3798. A_UINT32 \
  3799. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  3800. reserved: 8, \
  3801. tx_pkt_pool_size: 16;\
  3802. /* DWORD 1 */\
  3803. _paddr__tx_comp_ring_base_addr_;\
  3804. /* DWORD 2 (or 3)*/\
  3805. A_UINT32 tx_comp_ring_size;\
  3806. /* DWORD 3 (or 4)*/\
  3807. _paddr__tx_comp_wr_idx_addr_;\
  3808. /* DWORD 4 (or 6)*/\
  3809. _paddr__tx_ce_wr_idx_addr_;\
  3810. /* DWORD 5 (or 8)*/\
  3811. _paddr__rx_ind_ring_base_addr_;\
  3812. /* DWORD 6 (or 10)*/\
  3813. A_UINT32 rx_ind_ring_size;\
  3814. /* DWORD 7 (or 11)*/\
  3815. _paddr__rx_ind_rd_idx_addr_;\
  3816. /* DWORD 8 (or 13)*/\
  3817. _paddr__rx_ind_wr_idx_addr_;\
  3818. /* DWORD 9 (or 15)*/\
  3819. _paddr__rx_ring2_base_addr_;\
  3820. /* DWORD 10 (or 17) */\
  3821. A_UINT32 rx_ring2_size;\
  3822. /* DWORD 11 (or 18) */\
  3823. _paddr__rx_ring2_rd_idx_addr_;\
  3824. /* DWORD 12 (or 20) */\
  3825. _paddr__rx_ring2_wr_idx_addr_;\
  3826. } POSTPACK
  3827. /* define a htt_wdi_ipa_config32_t type */
  3828. 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));
  3829. /* define a htt_wdi_ipa_config64_t type */
  3830. 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));
  3831. #if HTT_PADDR64
  3832. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  3833. #else
  3834. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  3835. #endif
  3836. enum htt_wdi_ipa_op_code {
  3837. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  3838. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  3839. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  3840. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  3841. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  3842. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  3843. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  3844. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  3845. /* keep this last */
  3846. HTT_WDI_IPA_OPCODE_MAX
  3847. };
  3848. /**
  3849. * @brief HTT WDI_IPA Operation Request Message
  3850. *
  3851. * @details
  3852. * HTT WDI_IPA Operation Request message is sent by host
  3853. * to either suspend or resume WDI_IPA TX or RX path.
  3854. * |31 24|23 16|15 8|7 0|
  3855. * |----------------+----------------+----------------+----------------|
  3856. * | op_code | Rsvd | msg_type |
  3857. * |-------------------------------------------------------------------|
  3858. *
  3859. * Header fields:
  3860. * - MSG_TYPE
  3861. * Bits 7:0
  3862. * Purpose: Identifies this as WDI_IPA Operation Request message
  3863. * value: = 0x9
  3864. * - OP_CODE
  3865. * Bits 31:16
  3866. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  3867. * value: = enum htt_wdi_ipa_op_code
  3868. */
  3869. PREPACK struct htt_wdi_ipa_op_request_t
  3870. {
  3871. /* DWORD 0: flags and meta-data */
  3872. A_UINT32
  3873. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  3874. reserved: 8,
  3875. op_code: 16;
  3876. } POSTPACK;
  3877. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  3878. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  3879. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  3880. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  3881. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  3882. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  3883. do { \
  3884. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  3885. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  3886. } while (0)
  3887. /*
  3888. * @brief host -> target HTT_SRING_SETUP message
  3889. *
  3890. * @details
  3891. * After target is booted up, Host can send SRING setup message for
  3892. * each host facing LMAC SRING. Target setups up HW registers based
  3893. * on setup message and confirms back to Host if response_required is set.
  3894. * Host should wait for confirmation message before sending new SRING
  3895. * setup message
  3896. *
  3897. * The message would appear as follows:
  3898. * |31 24|23 20|19|18 16|15|14 8|7 0|
  3899. * |--------------- +-----------------+----------------+------------------|
  3900. * | ring_type | ring_id | pdev_id | msg_type |
  3901. * |----------------------------------------------------------------------|
  3902. * | ring_base_addr_lo |
  3903. * |----------------------------------------------------------------------|
  3904. * | ring_base_addr_hi |
  3905. * |----------------------------------------------------------------------|
  3906. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  3907. * |----------------------------------------------------------------------|
  3908. * | ring_head_offset32_remote_addr_lo |
  3909. * |----------------------------------------------------------------------|
  3910. * | ring_head_offset32_remote_addr_hi |
  3911. * |----------------------------------------------------------------------|
  3912. * | ring_tail_offset32_remote_addr_lo |
  3913. * |----------------------------------------------------------------------|
  3914. * | ring_tail_offset32_remote_addr_hi |
  3915. * |----------------------------------------------------------------------|
  3916. * | ring_msi_addr_lo |
  3917. * |----------------------------------------------------------------------|
  3918. * | ring_msi_addr_hi |
  3919. * |----------------------------------------------------------------------|
  3920. * | ring_msi_data |
  3921. * |----------------------------------------------------------------------|
  3922. * | intr_timer_th |IM| intr_batch_counter_th |
  3923. * |----------------------------------------------------------------------|
  3924. * | reserved |RR|PTCF| intr_low_threshold |
  3925. * |----------------------------------------------------------------------|
  3926. * Where
  3927. * IM = sw_intr_mode
  3928. * RR = response_required
  3929. * PTCF = prefetch_timer_cfg
  3930. *
  3931. * The message is interpreted as follows:
  3932. * dword0 - b'0:7 - msg_type: This will be set to
  3933. * HTT_H2T_MSG_TYPE_SRING_SETUP
  3934. * b'8:15 - pdev_id:
  3935. * 0 (for rings at SOC/UMAC level),
  3936. * 1/2/3 mac id (for rings at LMAC level)
  3937. * b'16:23 - ring_id: identify which ring is to setup,
  3938. * more details can be got from enum htt_srng_ring_id
  3939. * b'24:31 - ring_type: identify type of host rings,
  3940. * more details can be got from enum htt_srng_ring_type
  3941. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  3942. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  3943. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  3944. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  3945. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  3946. * SW_TO_HW_RING.
  3947. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  3948. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  3949. * Lower 32 bits of memory address of the remote variable
  3950. * storing the 4-byte word offset that identifies the head
  3951. * element within the ring.
  3952. * (The head offset variable has type A_UINT32.)
  3953. * Valid for HW_TO_SW and SW_TO_SW rings.
  3954. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  3955. * Upper 32 bits of memory address of the remote variable
  3956. * storing the 4-byte word offset that identifies the head
  3957. * element within the ring.
  3958. * (The head offset variable has type A_UINT32.)
  3959. * Valid for HW_TO_SW and SW_TO_SW rings.
  3960. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  3961. * Lower 32 bits of memory address of the remote variable
  3962. * storing the 4-byte word offset that identifies the tail
  3963. * element within the ring.
  3964. * (The tail offset variable has type A_UINT32.)
  3965. * Valid for HW_TO_SW and SW_TO_SW rings.
  3966. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  3967. * Upper 32 bits of memory address of the remote variable
  3968. * storing the 4-byte word offset that identifies the tail
  3969. * element within the ring.
  3970. * (The tail offset variable has type A_UINT32.)
  3971. * Valid for HW_TO_SW and SW_TO_SW rings.
  3972. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  3973. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3974. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  3975. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3976. * dword10 - b'0:31 - ring_msi_data: MSI data
  3977. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  3978. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3979. * dword11 - b'0:14 - intr_batch_counter_th:
  3980. * batch counter threshold is in units of 4-byte words.
  3981. * HW internally maintains and increments batch count.
  3982. * (see SRING spec for detail description).
  3983. * When batch count reaches threshold value, an interrupt
  3984. * is generated by HW.
  3985. * b'15 - sw_intr_mode:
  3986. * This configuration shall be static.
  3987. * Only programmed at power up.
  3988. * 0: generate pulse style sw interrupts
  3989. * 1: generate level style sw interrupts
  3990. * b'16:31 - intr_timer_th:
  3991. * The timer init value when timer is idle or is
  3992. * initialized to start downcounting.
  3993. * In 8us units (to cover a range of 0 to 524 ms)
  3994. * dword12 - b'0:15 - intr_low_threshold:
  3995. * Used only by Consumer ring to generate ring_sw_int_p.
  3996. * Ring entries low threshold water mark, that is used
  3997. * in combination with the interrupt timer as well as
  3998. * the the clearing of the level interrupt.
  3999. * b'16:18 - prefetch_timer_cfg:
  4000. * Used only by Consumer ring to set timer mode to
  4001. * support Application prefetch handling.
  4002. * The external tail offset/pointer will be updated
  4003. * at following intervals:
  4004. * 3'b000: (Prefetch feature disabled; used only for debug)
  4005. * 3'b001: 1 usec
  4006. * 3'b010: 4 usec
  4007. * 3'b011: 8 usec (default)
  4008. * 3'b100: 16 usec
  4009. * Others: Reserverd
  4010. * b'19 - response_required:
  4011. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4012. * b'20:31 - reserved: reserved for future use
  4013. */
  4014. PREPACK struct htt_sring_setup_t {
  4015. A_UINT32 msg_type: 8,
  4016. pdev_id: 8,
  4017. ring_id: 8,
  4018. ring_type: 8;
  4019. A_UINT32 ring_base_addr_lo;
  4020. A_UINT32 ring_base_addr_hi;
  4021. A_UINT32 ring_size: 16,
  4022. ring_entry_size: 8,
  4023. ring_misc_cfg_flag: 8;
  4024. A_UINT32 ring_head_offset32_remote_addr_lo;
  4025. A_UINT32 ring_head_offset32_remote_addr_hi;
  4026. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4027. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4028. A_UINT32 ring_msi_addr_lo;
  4029. A_UINT32 ring_msi_addr_hi;
  4030. A_UINT32 ring_msi_data;
  4031. A_UINT32 intr_batch_counter_th: 15,
  4032. sw_intr_mode: 1,
  4033. intr_timer_th: 16;
  4034. A_UINT32 intr_low_threshold: 16,
  4035. prefetch_timer_cfg: 3,
  4036. response_required: 1,
  4037. reserved1: 12;
  4038. } POSTPACK;
  4039. enum htt_srng_ring_type {
  4040. HTT_HW_TO_SW_RING = 0,
  4041. HTT_SW_TO_HW_RING,
  4042. HTT_SW_TO_SW_RING,
  4043. /* Insert new ring types above this line */
  4044. };
  4045. enum htt_srng_ring_id {
  4046. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4047. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4048. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4049. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4050. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4051. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4052. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4053. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4054. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4055. /* Add Other SRING which can't be directly configured by host software above this line */
  4056. };
  4057. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4058. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4059. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4060. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4061. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4062. HTT_SRING_SETUP_PDEV_ID_S)
  4063. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4064. do { \
  4065. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4066. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4067. } while (0)
  4068. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4069. #define HTT_SRING_SETUP_RING_ID_S 16
  4070. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4071. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4072. HTT_SRING_SETUP_RING_ID_S)
  4073. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4074. do { \
  4075. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4076. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4077. } while (0)
  4078. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4079. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4080. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4081. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4082. HTT_SRING_SETUP_RING_TYPE_S)
  4083. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4084. do { \
  4085. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4086. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4087. } while (0)
  4088. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4089. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4090. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4091. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4092. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4093. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4094. do { \
  4095. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4096. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4097. } while (0)
  4098. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4099. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4100. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4101. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4102. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4103. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4104. do { \
  4105. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4106. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4107. } while (0)
  4108. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4109. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4110. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4111. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4112. HTT_SRING_SETUP_RING_SIZE_S)
  4113. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4114. do { \
  4115. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4116. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4117. } while (0)
  4118. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4119. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4120. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4121. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4122. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4123. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4124. do { \
  4125. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4126. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4127. } while (0)
  4128. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4129. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4130. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4131. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4132. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4133. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4134. do { \
  4135. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4136. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4137. } while (0)
  4138. /* This control bit is applicable to only Producer, which updates Ring ID field
  4139. * of each descriptor before pushing into the ring.
  4140. * 0: updates ring_id(default)
  4141. * 1: ring_id updating disabled */
  4142. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4143. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4144. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4145. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4146. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4147. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4148. do { \
  4149. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4150. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4151. } while (0)
  4152. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4153. * of each descriptor before pushing into the ring.
  4154. * 0: updates Loopcnt(default)
  4155. * 1: Loopcnt updating disabled */
  4156. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4157. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4158. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4159. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4160. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4161. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4162. do { \
  4163. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4164. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4165. } while (0)
  4166. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4167. * into security_id port of GXI/AXI. */
  4168. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4169. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4170. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4171. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4172. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4173. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4174. do { \
  4175. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4176. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4177. } while (0)
  4178. /* During MSI write operation, SRNG drives value of this register bit into
  4179. * swap bit of GXI/AXI. */
  4180. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4181. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4182. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4183. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4184. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4185. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4186. do { \
  4187. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4188. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4189. } while (0)
  4190. /* During Pointer write operation, SRNG drives value of this register bit into
  4191. * swap bit of GXI/AXI. */
  4192. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4193. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4194. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4195. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4196. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4197. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4198. do { \
  4199. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4200. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4201. } while (0)
  4202. /* During any data or TLV write operation, SRNG drives value of this register
  4203. * bit into swap bit of GXI/AXI. */
  4204. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4205. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4206. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4207. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4208. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4209. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4210. do { \
  4211. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4212. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4213. } while (0)
  4214. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4215. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4216. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4217. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4218. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4219. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4220. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4221. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4222. do { \
  4223. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4224. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4225. } while (0)
  4226. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4227. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4228. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4229. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4230. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4231. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4232. do { \
  4233. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4234. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4235. } while (0)
  4236. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4237. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4238. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4239. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4240. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4241. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4242. do { \
  4243. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4244. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4245. } while (0)
  4246. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4247. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4248. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4249. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4250. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4251. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4252. do { \
  4253. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4254. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4255. } while (0)
  4256. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4257. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4258. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4259. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4260. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4261. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4262. do { \
  4263. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4264. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4265. } while (0)
  4266. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4267. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4268. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4269. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4270. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4271. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4272. do { \
  4273. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4274. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4275. } while (0)
  4276. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4277. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4278. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4279. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4280. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4281. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4282. do { \
  4283. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4284. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4285. } while (0)
  4286. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4287. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4288. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4289. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4290. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4291. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4292. do { \
  4293. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4294. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4295. } while (0)
  4296. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4297. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4298. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4299. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4300. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4301. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4302. do { \
  4303. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4304. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4305. } while (0)
  4306. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4307. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4308. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4309. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4310. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4311. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4312. do { \
  4313. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4314. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4315. } while (0)
  4316. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4317. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4318. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4319. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4320. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4321. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4322. do { \
  4323. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4324. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4325. } while (0)
  4326. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4327. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4328. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4329. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4330. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4331. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4332. do { \
  4333. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4334. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4335. } while (0)
  4336. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4337. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4338. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4339. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4340. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4341. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4342. do { \
  4343. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4344. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4345. } while (0)
  4346. /**
  4347. * @brief HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG Message
  4348. *
  4349. * @details
  4350. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4351. * configure RXDMA rings.
  4352. * The configuration is per ring based and includes both packet subtypes
  4353. * and PPDU/MPDU TLVs.
  4354. *
  4355. * The message would appear as follows:
  4356. *
  4357. * |31 28|27|26|25|24|23 16|15 |9 8|7 0|
  4358. * |-----+--+--+--+--+----------------+------------+---+---------------|
  4359. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  4360. * |-------------------------------------------------------------------|
  4361. * | rsvd2 | ring_buffer_size |
  4362. * |-------------------------------------------------------------------|
  4363. * | packet_type_enable_flags_0 |
  4364. * |-------------------------------------------------------------------|
  4365. * | packet_type_enable_flags_1 |
  4366. * |-------------------------------------------------------------------|
  4367. * | packet_type_enable_flags_2 |
  4368. * |-------------------------------------------------------------------|
  4369. * | packet_type_enable_flags_3 |
  4370. * |-------------------------------------------------------------------|
  4371. * | tlv_filter_in_flags |
  4372. * |-------------------------------------------------------------------|
  4373. * | rx_header_offset | rx_packet_offset |
  4374. * |-------------------------------------------------------------------|
  4375. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  4376. * |-------------------------------------------------------------------|
  4377. * | rx_msdu_start_offset | rx_msdu_end_offset |
  4378. * |-------------------------------------------------------------------|
  4379. * | rsvd3 | rx_attention_offset |
  4380. * |-------------------------------------------------------------------|
  4381. * | rsvd4 | rx_drop_threshold |
  4382. * |-------------------------------------------------------------------|
  4383. * Where:
  4384. * PS = pkt_swap
  4385. * SS = status_swap
  4386. * OV = rx_offsets_valid
  4387. * DT = drop_thresh_valid
  4388. * The message is interpreted as follows:
  4389. * dword0 - b'0:7 - msg_type: This will be set to
  4390. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4391. * b'8:15 - pdev_id:
  4392. * 0 (for rings at SOC/UMAC level),
  4393. * 1/2/3 mac id (for rings at LMAC level)
  4394. * b'16:23 - ring_id : Identify the ring to configure.
  4395. * More details can be got from enum htt_srng_ring_id
  4396. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  4397. * BUF_RING_CFG_0 defs within HW .h files,
  4398. * e.g. wmac_top_reg_seq_hwioreg.h
  4399. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  4400. * BUF_RING_CFG_0 defs within HW .h files,
  4401. * e.g. wmac_top_reg_seq_hwioreg.h
  4402. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  4403. * configuration fields are valid
  4404. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  4405. * rx_drop_threshold field is valid
  4406. * b'28:31 - rsvd1: reserved for future use
  4407. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4408. * in byte units.
  4409. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4410. * - b'16:31 - rsvd2: Reserved for future use
  4411. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4412. * Enable MGMT packet from 0b0000 to 0b1001
  4413. * bits from low to high: FP, MD, MO - 3 bits
  4414. * FP: Filter_Pass
  4415. * MD: Monitor_Direct
  4416. * MO: Monitor_Other
  4417. * 10 mgmt subtypes * 3 bits -> 30 bits
  4418. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4419. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4420. * Enable MGMT packet from 0b1010 to 0b1111
  4421. * bits from low to high: FP, MD, MO - 3 bits
  4422. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4423. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4424. * Enable CTRL packet from 0b0000 to 0b1001
  4425. * bits from low to high: FP, MD, MO - 3 bits
  4426. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4427. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4428. * Enable CTRL packet from 0b1010 to 0b1111,
  4429. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4430. * bits from low to high: FP, MD, MO - 3 bits
  4431. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4432. * dword6 - b'0:31 - tlv_filter_in_flags:
  4433. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4434. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4435. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  4436. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4437. * A value of 0 will be considered as ignore this config.
  4438. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4439. * e.g. wmac_top_reg_seq_hwioreg.h
  4440. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  4441. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4442. * A value of 0 will be considered as ignore this config.
  4443. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4444. * e.g. wmac_top_reg_seq_hwioreg.h
  4445. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  4446. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4447. * A value of 0 will be considered as ignore this config.
  4448. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4449. * e.g. wmac_top_reg_seq_hwioreg.h
  4450. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  4451. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4452. * A value of 0 will be considered as ignore this config.
  4453. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4454. * e.g. wmac_top_reg_seq_hwioreg.h
  4455. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  4456. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4457. * A value of 0 will be considered as ignore this config.
  4458. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4459. * e.g. wmac_top_reg_seq_hwioreg.h
  4460. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  4461. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4462. * A value of 0 will be considered as ignore this config.
  4463. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4464. * e.g. wmac_top_reg_seq_hwioreg.h
  4465. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  4466. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4467. * A value of 0 will be considered as ignore this config.
  4468. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  4469. * e.g. wmac_top_reg_seq_hwioreg.h
  4470. * - b'16:31 - rsvd3 for future use
  4471. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  4472. * to source rings. Consumer drops packets if the available
  4473. * words in the ring falls below the configured threshold
  4474. * value.
  4475. */
  4476. PREPACK struct htt_rx_ring_selection_cfg_t {
  4477. A_UINT32 msg_type: 8,
  4478. pdev_id: 8,
  4479. ring_id: 8,
  4480. status_swap: 1,
  4481. pkt_swap: 1,
  4482. rx_offsets_valid: 1,
  4483. drop_thresh_valid: 1,
  4484. rsvd1: 4;
  4485. A_UINT32 ring_buffer_size: 16,
  4486. rsvd2: 16;
  4487. A_UINT32 packet_type_enable_flags_0;
  4488. A_UINT32 packet_type_enable_flags_1;
  4489. A_UINT32 packet_type_enable_flags_2;
  4490. A_UINT32 packet_type_enable_flags_3;
  4491. A_UINT32 tlv_filter_in_flags;
  4492. A_UINT32 rx_packet_offset: 16,
  4493. rx_header_offset: 16;
  4494. A_UINT32 rx_mpdu_end_offset: 16,
  4495. rx_mpdu_start_offset: 16;
  4496. A_UINT32 rx_msdu_end_offset: 16,
  4497. rx_msdu_start_offset: 16;
  4498. A_UINT32 rx_attn_offset: 16,
  4499. rsvd3: 16;
  4500. A_UINT32 rx_drop_threshold: 10,
  4501. rsvd4: 22;
  4502. } POSTPACK;
  4503. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4504. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4505. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4506. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4507. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4508. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4509. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4510. do { \
  4511. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4512. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4513. } while (0)
  4514. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4515. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4516. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4517. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4518. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4519. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4520. do { \
  4521. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4522. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4523. } while (0)
  4524. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4525. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4526. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4527. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4528. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4529. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4530. do { \
  4531. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  4532. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4533. } while (0)
  4534. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4535. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4536. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4537. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4538. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4539. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4540. do { \
  4541. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  4542. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4543. } while (0)
  4544. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  4545. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  4546. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  4547. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  4548. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  4549. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  4550. do { \
  4551. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  4552. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  4553. } while (0)
  4554. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  4555. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  4556. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  4557. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  4558. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  4559. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  4560. do { \
  4561. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  4562. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  4563. } while (0)
  4564. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4565. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4566. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4567. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4568. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4569. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4570. do { \
  4571. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  4572. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4573. } while (0)
  4574. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4575. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4576. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4577. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4578. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4579. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4580. do { \
  4581. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  4582. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4583. } while (0)
  4584. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4585. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4586. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4587. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4588. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4589. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4590. do { \
  4591. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  4592. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4593. } while (0)
  4594. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4595. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4596. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4597. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4598. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4599. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4600. do { \
  4601. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  4602. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4603. } while (0)
  4604. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4605. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4606. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4607. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4608. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4609. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4610. do { \
  4611. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  4612. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4613. } while (0)
  4614. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4615. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4616. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4617. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4618. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4619. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4620. do { \
  4621. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4622. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4623. } while (0)
  4624. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  4625. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  4626. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  4627. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  4628. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  4629. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  4630. do { \
  4631. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  4632. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  4633. } while (0)
  4634. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  4635. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  4636. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  4637. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  4638. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  4639. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  4640. do { \
  4641. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  4642. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  4643. } while (0)
  4644. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  4645. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  4646. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  4647. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  4648. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  4649. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  4650. do { \
  4651. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  4652. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  4653. } while (0)
  4654. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  4655. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  4656. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  4657. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  4658. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  4659. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  4660. do { \
  4661. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  4662. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  4663. } while (0)
  4664. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  4665. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  4666. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  4667. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  4668. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  4669. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  4670. do { \
  4671. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  4672. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  4673. } while (0)
  4674. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  4675. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  4676. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  4677. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  4678. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  4679. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  4680. do { \
  4681. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  4682. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  4683. } while (0)
  4684. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  4685. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  4686. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  4687. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  4688. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  4689. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  4690. do { \
  4691. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  4692. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  4693. } while (0)
  4694. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  4695. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  4696. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  4697. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  4698. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  4699. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  4700. do { \
  4701. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  4702. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  4703. } while (0)
  4704. /*
  4705. * Subtype based MGMT frames enable bits.
  4706. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4707. */
  4708. /* association request */
  4709. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  4710. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4711. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  4712. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4713. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  4714. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4715. /* association response */
  4716. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  4717. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4718. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  4719. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4720. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  4721. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4722. /* Reassociation request */
  4723. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  4724. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  4725. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  4726. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  4727. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  4728. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  4729. /* Reassociation response */
  4730. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  4731. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  4732. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  4733. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  4734. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  4735. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  4736. /* Probe request */
  4737. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  4738. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  4739. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  4740. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  4741. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  4742. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  4743. /* Probe response */
  4744. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  4745. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  4746. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  4747. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  4748. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  4749. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  4750. /* Timing Advertisement */
  4751. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  4752. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  4753. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  4754. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  4755. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  4756. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  4757. /* Reserved */
  4758. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  4759. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  4760. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  4761. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  4762. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  4763. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  4764. /* Beacon */
  4765. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  4766. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  4767. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  4768. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  4769. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  4770. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  4771. /* ATIM */
  4772. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  4773. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  4774. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  4775. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  4776. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  4777. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  4778. /* Disassociation */
  4779. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  4780. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  4781. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  4782. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  4783. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  4784. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  4785. /* Authentication */
  4786. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  4787. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  4788. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  4789. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  4790. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  4791. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  4792. /* Deauthentication */
  4793. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  4794. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  4795. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  4796. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  4797. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  4798. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  4799. /* Action */
  4800. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  4801. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  4802. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  4803. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  4804. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  4805. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  4806. /* Action No Ack */
  4807. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  4808. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  4809. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  4810. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  4811. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  4812. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  4813. /* Reserved */
  4814. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  4815. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  4816. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  4817. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  4818. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  4819. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  4820. /*
  4821. * Subtype based CTRL frames enable bits.
  4822. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  4823. */
  4824. /* Reserved */
  4825. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  4826. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  4827. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  4828. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  4829. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  4830. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  4831. /* Reserved */
  4832. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  4833. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  4834. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  4835. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  4836. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  4837. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  4838. /* Reserved */
  4839. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  4840. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  4841. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  4842. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  4843. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  4844. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  4845. /* Reserved */
  4846. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  4847. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  4848. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  4849. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  4850. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  4851. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  4852. /* Reserved */
  4853. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  4854. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  4855. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  4856. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  4857. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  4858. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  4859. /* Reserved */
  4860. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  4861. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  4862. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  4863. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  4864. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  4865. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  4866. /* Reserved */
  4867. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  4868. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  4869. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  4870. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  4871. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  4872. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  4873. /* Control Wrapper */
  4874. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  4875. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  4876. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  4877. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  4878. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  4879. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  4880. /* Block Ack Request */
  4881. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  4882. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  4883. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  4884. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  4885. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  4886. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  4887. /* Block Ack*/
  4888. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  4889. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  4890. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  4891. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  4892. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  4893. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  4894. /* PS-POLL */
  4895. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  4896. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  4897. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  4898. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  4899. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  4900. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  4901. /* RTS */
  4902. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  4903. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  4904. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  4905. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  4906. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  4907. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  4908. /* CTS */
  4909. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  4910. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  4911. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  4912. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  4913. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  4914. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  4915. /* ACK */
  4916. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  4917. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  4918. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  4919. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  4920. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  4921. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  4922. /* CF-END */
  4923. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  4924. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  4925. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  4926. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  4927. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  4928. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  4929. /* CF-END + CF-ACK */
  4930. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  4931. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  4932. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  4933. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  4934. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  4935. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  4936. /* Multicast data */
  4937. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  4938. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  4939. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  4940. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  4941. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  4942. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  4943. /* Unicast data */
  4944. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  4945. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  4946. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  4947. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  4948. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  4949. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  4950. /* NULL data */
  4951. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  4952. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  4953. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  4954. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  4955. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  4956. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  4957. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  4958. do { \
  4959. HTT_CHECK_SET_VAL(httsym, value); \
  4960. (word) |= (value) << httsym##_S; \
  4961. } while (0)
  4962. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  4963. (((word) & httsym##_M) >> httsym##_S)
  4964. #define htt_rx_ring_pkt_enable_subtype_set( \
  4965. word, flag, mode, type, subtype, val) \
  4966. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  4967. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  4968. #define htt_rx_ring_pkt_enable_subtype_get( \
  4969. word, flag, mode, type, subtype) \
  4970. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  4971. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  4972. /* Definition to filter in TLVs */
  4973. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  4974. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  4975. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  4976. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  4977. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  4978. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  4979. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  4980. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  4981. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  4982. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  4983. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  4984. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  4985. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  4986. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  4987. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  4988. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  4989. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  4990. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  4991. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  4992. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  4993. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  4994. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  4995. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  4996. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  4997. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  4998. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  4999. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  5000. do { \
  5001. HTT_CHECK_SET_VAL(httsym, enable); \
  5002. (word) |= (enable) << httsym##_S; \
  5003. } while (0)
  5004. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  5005. (((word) & httsym##_M) >> httsym##_S)
  5006. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  5007. HTT_RX_RING_TLV_ENABLE_SET( \
  5008. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  5009. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  5010. HTT_RX_RING_TLV_ENABLE_GET( \
  5011. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  5012. /**
  5013. * @brief HTT_H2T_MSG_TYPE_RFS_CONFIG
  5014. * host --> target Receive Flow Steering configuration message definition.
  5015. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5016. * The reason for this is we want RFS to be configured and ready before MAC
  5017. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5018. *
  5019. * |31 24|23 16|15 9|8|7 0|
  5020. * |----------------+----------------+----------------+----------------|
  5021. * | reserved |E| msg type |
  5022. * |-------------------------------------------------------------------|
  5023. * Where E = RFS enable flag
  5024. *
  5025. * The RFS_CONFIG message consists of a single 4-byte word.
  5026. *
  5027. * Header fields:
  5028. * - MSG_TYPE
  5029. * Bits 7:0
  5030. * Purpose: identifies this as a RFS config msg
  5031. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  5032. * - RFS_CONFIG
  5033. * Bit 8
  5034. * Purpose: Tells target whether to enable (1) or disable (0)
  5035. * flow steering feature when sending rx indication messages to host
  5036. */
  5037. #define HTT_H2T_RFS_CONFIG_M 0x100
  5038. #define HTT_H2T_RFS_CONFIG_S 8
  5039. #define HTT_RX_RFS_CONFIG_GET(_var) \
  5040. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  5041. HTT_H2T_RFS_CONFIG_S)
  5042. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  5043. do { \
  5044. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  5045. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  5046. } while (0)
  5047. #define HTT_RFS_CFG_REQ_BYTES 4
  5048. /**
  5049. * @brief host -> target FW extended statistics retrieve
  5050. *
  5051. * @details
  5052. * The following field definitions describe the format of the HTT host
  5053. * to target FW extended stats retrieve message.
  5054. * The message specifies the type of stats the host wants to retrieve.
  5055. *
  5056. * |31 24|23 16|15 8|7 0|
  5057. * |-----------------------------------------------------------|
  5058. * | reserved | stats type | pdev_mask | msg type |
  5059. * |-----------------------------------------------------------|
  5060. * | config param [0] |
  5061. * |-----------------------------------------------------------|
  5062. * | config param [1] |
  5063. * |-----------------------------------------------------------|
  5064. * | config param [2] |
  5065. * |-----------------------------------------------------------|
  5066. * | config param [3] |
  5067. * |-----------------------------------------------------------|
  5068. * | reserved |
  5069. * |-----------------------------------------------------------|
  5070. * | cookie LSBs |
  5071. * |-----------------------------------------------------------|
  5072. * | cookie MSBs |
  5073. * |-----------------------------------------------------------|
  5074. * Header fields:
  5075. * - MSG_TYPE
  5076. * Bits 7:0
  5077. * Purpose: identifies this is a extended stats upload request message
  5078. * Value: 0x10
  5079. * - PDEV_MASK
  5080. * Bits 8:15
  5081. * Purpose: identifies the mask of PDEVs to retrieve stats from
  5082. * Value: This is a overloaded field, refer to usage and interpretation of
  5083. * PDEV in interface document.
  5084. * Bit 8 : Reserved for SOC stats
  5085. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5086. * Indicates MACID_MASK in DBS
  5087. * - STATS_TYPE
  5088. * Bits 23:16
  5089. * Purpose: identifies which FW statistics to upload
  5090. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  5091. * - Reserved
  5092. * Bits 31:24
  5093. * - CONFIG_PARAM [0]
  5094. * Bits 31:0
  5095. * Purpose: give an opaque configuration value to the specified stats type
  5096. * Value: stats-type specific configuration value
  5097. * Refer to htt_stats.h for interpretation for each stats sub_type
  5098. * - CONFIG_PARAM [1]
  5099. * Bits 31:0
  5100. * Purpose: give an opaque configuration value to the specified stats type
  5101. * Value: stats-type specific configuration value
  5102. * Refer to htt_stats.h for interpretation for each stats sub_type
  5103. * - CONFIG_PARAM [2]
  5104. * Bits 31:0
  5105. * Purpose: give an opaque configuration value to the specified stats type
  5106. * Value: stats-type specific configuration value
  5107. * Refer to htt_stats.h for interpretation for each stats sub_type
  5108. * - CONFIG_PARAM [3]
  5109. * Bits 31:0
  5110. * Purpose: give an opaque configuration value to the specified stats type
  5111. * Value: stats-type specific configuration value
  5112. * Refer to htt_stats.h for interpretation for each stats sub_type
  5113. * - Reserved [31:0] for future use.
  5114. * - COOKIE_LSBS
  5115. * Bits 31:0
  5116. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5117. * message with its preceding host->target stats request message.
  5118. * Value: LSBs of the opaque cookie specified by the host-side requestor
  5119. * - COOKIE_MSBS
  5120. * Bits 31:0
  5121. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5122. * message with its preceding host->target stats request message.
  5123. * Value: MSBs of the opaque cookie specified by the host-side requestor
  5124. */
  5125. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  5126. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  5127. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  5128. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  5129. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  5130. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  5131. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  5132. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  5133. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  5134. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  5135. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  5136. do { \
  5137. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  5138. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  5139. } while (0)
  5140. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  5141. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  5142. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  5143. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  5144. do { \
  5145. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  5146. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  5147. } while (0)
  5148. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  5149. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  5150. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  5151. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  5152. do { \
  5153. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  5154. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  5155. } while (0)
  5156. /**
  5157. * @brief host -> target FW PPDU_STATS request message
  5158. *
  5159. * @details
  5160. * The following field definitions describe the format of the HTT host
  5161. * to target FW for PPDU_STATS_CFG msg.
  5162. * The message allows the host to configure the PPDU_STATS_IND messages
  5163. * produced by the target.
  5164. *
  5165. * |31 24|23 16|15 8|7 0|
  5166. * |-----------------------------------------------------------|
  5167. * | REQ bit mask | pdev_mask | msg type |
  5168. * |-----------------------------------------------------------|
  5169. * Header fields:
  5170. * - MSG_TYPE
  5171. * Bits 7:0
  5172. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  5173. * Value: 0x11
  5174. * - PDEV_MASK
  5175. * Bits 8:15
  5176. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  5177. * Value: This is a overloaded field, refer to usage and interpretation of
  5178. * PDEV in interface document.
  5179. * Bit 8 : Reserved for SOC stats
  5180. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5181. * Indicates MACID_MASK in DBS
  5182. * - REQ_TLV_BIT_MASK
  5183. * Bits 16:31
  5184. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  5185. * needs to be included in the target's PPDU_STATS_IND messages.
  5186. * Value: refer htt_ppdu_stats_tlv_tag_t
  5187. *
  5188. */
  5189. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  5190. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  5191. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  5192. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  5193. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  5194. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  5195. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  5196. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  5197. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  5198. do { \
  5199. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  5200. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  5201. } while (0)
  5202. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  5203. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  5204. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  5205. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  5206. do { \
  5207. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  5208. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  5209. } while (0)
  5210. /*=== target -> host messages ===============================================*/
  5211. enum htt_t2h_msg_type {
  5212. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  5213. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  5214. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  5215. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  5216. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  5217. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  5218. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  5219. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  5220. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  5221. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  5222. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  5223. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  5224. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  5225. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  5226. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  5227. /* only used for HL, add HTT MSG for HTT CREDIT update */
  5228. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  5229. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  5230. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  5231. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  5232. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  5233. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  5234. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  5235. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  5236. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  5237. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  5238. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  5239. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  5240. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  5241. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  5242. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  5243. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  5244. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  5245. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  5246. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  5247. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  5248. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  5249. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  5250. /* TX_OFFLOAD_DELIVER_IND:
  5251. * Forward the target's locally-generated packets to the host,
  5252. * to provide to the monitor mode interface.
  5253. */
  5254. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  5255. HTT_T2H_MSG_TYPE_TEST,
  5256. /* keep this last */
  5257. HTT_T2H_NUM_MSGS
  5258. };
  5259. /*
  5260. * HTT target to host message type -
  5261. * stored in bits 7:0 of the first word of the message
  5262. */
  5263. #define HTT_T2H_MSG_TYPE_M 0xff
  5264. #define HTT_T2H_MSG_TYPE_S 0
  5265. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  5266. do { \
  5267. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  5268. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  5269. } while (0)
  5270. #define HTT_T2H_MSG_TYPE_GET(word) \
  5271. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  5272. /**
  5273. * @brief target -> host version number confirmation message definition
  5274. *
  5275. * |31 24|23 16|15 8|7 0|
  5276. * |----------------+----------------+----------------+----------------|
  5277. * | reserved | major number | minor number | msg type |
  5278. * |-------------------------------------------------------------------|
  5279. * : option request TLV (optional) |
  5280. * :...................................................................:
  5281. *
  5282. * The VER_CONF message may consist of a single 4-byte word, or may be
  5283. * extended with TLVs that specify HTT options selected by the target.
  5284. * The following option TLVs may be appended to the VER_CONF message:
  5285. * - LL_BUS_ADDR_SIZE
  5286. * - HL_SUPPRESS_TX_COMPL_IND
  5287. * - MAX_TX_QUEUE_GROUPS
  5288. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  5289. * may be appended to the VER_CONF message (but only one TLV of each type).
  5290. *
  5291. * Header fields:
  5292. * - MSG_TYPE
  5293. * Bits 7:0
  5294. * Purpose: identifies this as a version number confirmation message
  5295. * Value: 0x0
  5296. * - VER_MINOR
  5297. * Bits 15:8
  5298. * Purpose: Specify the minor number of the HTT message library version
  5299. * in use by the target firmware.
  5300. * The minor number specifies the specific revision within a range
  5301. * of fundamentally compatible HTT message definition revisions.
  5302. * Compatible revisions involve adding new messages or perhaps
  5303. * adding new fields to existing messages, in a backwards-compatible
  5304. * manner.
  5305. * Incompatible revisions involve changing the message type values,
  5306. * or redefining existing messages.
  5307. * Value: minor number
  5308. * - VER_MAJOR
  5309. * Bits 15:8
  5310. * Purpose: Specify the major number of the HTT message library version
  5311. * in use by the target firmware.
  5312. * The major number specifies the family of minor revisions that are
  5313. * fundamentally compatible with each other, but not with prior or
  5314. * later families.
  5315. * Value: major number
  5316. */
  5317. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  5318. #define HTT_VER_CONF_MINOR_S 8
  5319. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  5320. #define HTT_VER_CONF_MAJOR_S 16
  5321. #define HTT_VER_CONF_MINOR_SET(word, value) \
  5322. do { \
  5323. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  5324. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  5325. } while (0)
  5326. #define HTT_VER_CONF_MINOR_GET(word) \
  5327. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  5328. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  5329. do { \
  5330. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  5331. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  5332. } while (0)
  5333. #define HTT_VER_CONF_MAJOR_GET(word) \
  5334. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  5335. #define HTT_VER_CONF_BYTES 4
  5336. /**
  5337. * @brief - target -> host HTT Rx In order indication message
  5338. *
  5339. * @details
  5340. *
  5341. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  5342. * |----------------+-------------------+---------------------+---------------|
  5343. * | peer ID | P| F| O| ext TID | msg type |
  5344. * |--------------------------------------------------------------------------|
  5345. * | MSDU count | Reserved | vdev id |
  5346. * |--------------------------------------------------------------------------|
  5347. * | MSDU 0 bus address (bits 31:0) |
  5348. #if HTT_PADDR64
  5349. * | MSDU 0 bus address (bits 63:32) |
  5350. #endif
  5351. * |--------------------------------------------------------------------------|
  5352. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  5353. * |--------------------------------------------------------------------------|
  5354. * | MSDU 1 bus address (bits 31:0) |
  5355. #if HTT_PADDR64
  5356. * | MSDU 1 bus address (bits 63:32) |
  5357. #endif
  5358. * |--------------------------------------------------------------------------|
  5359. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  5360. * |--------------------------------------------------------------------------|
  5361. */
  5362. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  5363. *
  5364. * @details
  5365. * bits
  5366. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  5367. * |-----+----+-------+--------+--------+---------+---------+-----------|
  5368. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  5369. * | | frag | | | | fail |chksum fail|
  5370. * |-----+----+-------+--------+--------+---------+---------+-----------|
  5371. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  5372. */
  5373. struct htt_rx_in_ord_paddr_ind_hdr_t
  5374. {
  5375. A_UINT32 /* word 0 */
  5376. msg_type: 8,
  5377. ext_tid: 5,
  5378. offload: 1,
  5379. frag: 1,
  5380. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  5381. peer_id: 16;
  5382. A_UINT32 /* word 1 */
  5383. vap_id: 8,
  5384. /* NOTE:
  5385. * This reserved_1 field is not truly reserved - certain targets use
  5386. * this field internally to store debug information, and do not zero
  5387. * out the contents of the field before uploading the message to the
  5388. * host. Thus, any host-target communication supported by this field
  5389. * is limited to using values that are never used by the debug
  5390. * information stored by certain targets in the reserved_1 field.
  5391. * In particular, the targets in question don't use the value 0x3
  5392. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  5393. * so this previously-unused value within these bits is available to
  5394. * use as the host / target PKT_CAPTURE_MODE flag.
  5395. */
  5396. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  5397. /* if pkt_capture_mode == 0x3, host should
  5398. * send rx frames to monitor mode interface
  5399. */
  5400. msdu_cnt: 16;
  5401. };
  5402. struct htt_rx_in_ord_paddr_ind_msdu32_t
  5403. {
  5404. A_UINT32 dma_addr;
  5405. A_UINT32
  5406. length: 16,
  5407. fw_desc: 8,
  5408. msdu_info:8;
  5409. };
  5410. struct htt_rx_in_ord_paddr_ind_msdu64_t
  5411. {
  5412. A_UINT32 dma_addr_lo;
  5413. A_UINT32 dma_addr_hi;
  5414. A_UINT32
  5415. length: 16,
  5416. fw_desc: 8,
  5417. msdu_info:8;
  5418. };
  5419. #if HTT_PADDR64
  5420. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  5421. #else
  5422. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  5423. #endif
  5424. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  5425. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  5426. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  5427. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  5428. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  5429. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  5430. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  5431. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  5432. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  5433. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  5434. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  5435. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  5436. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  5437. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  5438. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  5439. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  5440. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  5441. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  5442. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  5443. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  5444. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  5445. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  5446. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  5447. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  5448. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  5449. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  5450. /* for systems using 64-bit format for bus addresses */
  5451. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  5452. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  5453. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  5454. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  5455. /* for systems using 32-bit format for bus addresses */
  5456. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  5457. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  5458. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  5459. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  5460. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  5461. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  5462. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  5463. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  5464. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  5465. do { \
  5466. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  5467. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  5468. } while (0)
  5469. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  5470. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  5471. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  5472. do { \
  5473. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  5474. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  5475. } while (0)
  5476. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  5477. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  5478. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  5479. do { \
  5480. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  5481. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  5482. } while (0)
  5483. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  5484. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  5485. /*
  5486. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  5487. * deliver the rx frames to the monitor mode interface.
  5488. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  5489. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  5490. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  5491. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  5492. */
  5493. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  5494. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  5495. do { \
  5496. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  5497. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  5498. } while (0)
  5499. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  5500. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  5501. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  5502. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  5503. do { \
  5504. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  5505. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  5506. } while (0)
  5507. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  5508. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  5509. /* for systems using 64-bit format for bus addresses */
  5510. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  5511. do { \
  5512. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  5513. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  5514. } while (0)
  5515. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  5516. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  5517. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  5518. do { \
  5519. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  5520. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  5521. } while (0)
  5522. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  5523. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  5524. /* for systems using 32-bit format for bus addresses */
  5525. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  5526. do { \
  5527. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  5528. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  5529. } while (0)
  5530. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  5531. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  5532. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  5533. do { \
  5534. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  5535. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  5536. } while (0)
  5537. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  5538. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  5539. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  5540. do { \
  5541. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  5542. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  5543. } while (0)
  5544. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  5545. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  5546. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  5547. do { \
  5548. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  5549. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  5550. } while (0)
  5551. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  5552. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  5553. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  5554. do { \
  5555. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  5556. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  5557. } while (0)
  5558. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  5559. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  5560. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  5561. do { \
  5562. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  5563. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  5564. } while (0)
  5565. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  5566. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  5567. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  5568. do { \
  5569. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  5570. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  5571. } while (0)
  5572. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  5573. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  5574. /* definitions used within target -> host rx indication message */
  5575. PREPACK struct htt_rx_ind_hdr_prefix_t
  5576. {
  5577. A_UINT32 /* word 0 */
  5578. msg_type: 8,
  5579. ext_tid: 5,
  5580. release_valid: 1,
  5581. flush_valid: 1,
  5582. reserved0: 1,
  5583. peer_id: 16;
  5584. A_UINT32 /* word 1 */
  5585. flush_start_seq_num: 6,
  5586. flush_end_seq_num: 6,
  5587. release_start_seq_num: 6,
  5588. release_end_seq_num: 6,
  5589. num_mpdu_ranges: 8;
  5590. } POSTPACK;
  5591. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  5592. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  5593. #define HTT_TGT_RSSI_INVALID 0x80
  5594. PREPACK struct htt_rx_ppdu_desc_t
  5595. {
  5596. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  5597. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  5598. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  5599. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  5600. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  5601. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  5602. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  5603. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  5604. A_UINT32 /* word 0 */
  5605. rssi_cmb: 8,
  5606. timestamp_submicrosec: 8,
  5607. phy_err_code: 8,
  5608. phy_err: 1,
  5609. legacy_rate: 4,
  5610. legacy_rate_sel: 1,
  5611. end_valid: 1,
  5612. start_valid: 1;
  5613. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  5614. union {
  5615. A_UINT32 /* word 1 */
  5616. rssi0_pri20: 8,
  5617. rssi0_ext20: 8,
  5618. rssi0_ext40: 8,
  5619. rssi0_ext80: 8;
  5620. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  5621. } u0;
  5622. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  5623. union {
  5624. A_UINT32 /* word 2 */
  5625. rssi1_pri20: 8,
  5626. rssi1_ext20: 8,
  5627. rssi1_ext40: 8,
  5628. rssi1_ext80: 8;
  5629. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  5630. } u1;
  5631. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  5632. union {
  5633. A_UINT32 /* word 3 */
  5634. rssi2_pri20: 8,
  5635. rssi2_ext20: 8,
  5636. rssi2_ext40: 8,
  5637. rssi2_ext80: 8;
  5638. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  5639. } u2;
  5640. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  5641. union {
  5642. A_UINT32 /* word 4 */
  5643. rssi3_pri20: 8,
  5644. rssi3_ext20: 8,
  5645. rssi3_ext40: 8,
  5646. rssi3_ext80: 8;
  5647. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  5648. } u3;
  5649. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  5650. A_UINT32 tsf32; /* word 5 */
  5651. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  5652. A_UINT32 timestamp_microsec; /* word 6 */
  5653. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  5654. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  5655. A_UINT32 /* word 7 */
  5656. vht_sig_a1: 24,
  5657. preamble_type: 8;
  5658. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  5659. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  5660. A_UINT32 /* word 8 */
  5661. vht_sig_a2: 24,
  5662. /* sa_ant_matrix
  5663. * For cases where a single rx chain has options to be connected to
  5664. * different rx antennas, show which rx antennas were in use during
  5665. * receipt of a given PPDU.
  5666. * This sa_ant_matrix provides a bitmask of the antennas used while
  5667. * receiving this frame.
  5668. */
  5669. sa_ant_matrix: 8;
  5670. } POSTPACK;
  5671. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  5672. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  5673. PREPACK struct htt_rx_ind_hdr_suffix_t
  5674. {
  5675. A_UINT32 /* word 0 */
  5676. fw_rx_desc_bytes: 16,
  5677. reserved0: 16;
  5678. } POSTPACK;
  5679. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  5680. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  5681. PREPACK struct htt_rx_ind_hdr_t
  5682. {
  5683. struct htt_rx_ind_hdr_prefix_t prefix;
  5684. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  5685. struct htt_rx_ind_hdr_suffix_t suffix;
  5686. } POSTPACK;
  5687. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  5688. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  5689. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  5690. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  5691. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  5692. /*
  5693. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  5694. * the offset into the HTT rx indication message at which the
  5695. * FW rx PPDU descriptor resides
  5696. */
  5697. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  5698. /*
  5699. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  5700. * the offset into the HTT rx indication message at which the
  5701. * header suffix (FW rx MSDU byte count) resides
  5702. */
  5703. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  5704. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  5705. /*
  5706. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  5707. * the offset into the HTT rx indication message at which the per-MSDU
  5708. * information starts
  5709. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  5710. * per-MSDU information portion of the message. The per-MSDU info itself
  5711. * starts at byte 12.
  5712. */
  5713. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  5714. /**
  5715. * @brief target -> host rx indication message definition
  5716. *
  5717. * @details
  5718. * The following field definitions describe the format of the rx indication
  5719. * message sent from the target to the host.
  5720. * The message consists of three major sections:
  5721. * 1. a fixed-length header
  5722. * 2. a variable-length list of firmware rx MSDU descriptors
  5723. * 3. one or more 4-octet MPDU range information elements
  5724. * The fixed length header itself has two sub-sections
  5725. * 1. the message meta-information, including identification of the
  5726. * sender and type of the received data, and a 4-octet flush/release IE
  5727. * 2. the firmware rx PPDU descriptor
  5728. *
  5729. * The format of the message is depicted below.
  5730. * in this depiction, the following abbreviations are used for information
  5731. * elements within the message:
  5732. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  5733. * elements associated with the PPDU start are valid.
  5734. * Specifically, the following fields are valid only if SV is set:
  5735. * RSSI (all variants), L, legacy rate, preamble type, service,
  5736. * VHT-SIG-A
  5737. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  5738. * elements associated with the PPDU end are valid.
  5739. * Specifically, the following fields are valid only if EV is set:
  5740. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  5741. * - L - Legacy rate selector - if legacy rates are used, this flag
  5742. * indicates whether the rate is from a CCK (L == 1) or OFDM
  5743. * (L == 0) PHY.
  5744. * - P - PHY error flag - boolean indication of whether the rx frame had
  5745. * a PHY error
  5746. *
  5747. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  5748. * |----------------+-------------------+---------------------+---------------|
  5749. * | peer ID | |RV|FV| ext TID | msg type |
  5750. * |--------------------------------------------------------------------------|
  5751. * | num | release | release | flush | flush |
  5752. * | MPDU | end | start | end | start |
  5753. * | ranges | seq num | seq num | seq num | seq num |
  5754. * |==========================================================================|
  5755. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  5756. * |V|V| | rate | | | timestamp | RSSI |
  5757. * |--------------------------------------------------------------------------|
  5758. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  5759. * |--------------------------------------------------------------------------|
  5760. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  5761. * |--------------------------------------------------------------------------|
  5762. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  5763. * |--------------------------------------------------------------------------|
  5764. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  5765. * |--------------------------------------------------------------------------|
  5766. * | TSF LSBs |
  5767. * |--------------------------------------------------------------------------|
  5768. * | microsec timestamp |
  5769. * |--------------------------------------------------------------------------|
  5770. * | preamble type | HT-SIG / VHT-SIG-A1 |
  5771. * |--------------------------------------------------------------------------|
  5772. * | service | HT-SIG / VHT-SIG-A2 |
  5773. * |==========================================================================|
  5774. * | reserved | FW rx desc bytes |
  5775. * |--------------------------------------------------------------------------|
  5776. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  5777. * | desc B3 | desc B2 | desc B1 | desc B0 |
  5778. * |--------------------------------------------------------------------------|
  5779. * : : :
  5780. * |--------------------------------------------------------------------------|
  5781. * | alignment | MSDU Rx |
  5782. * | padding | desc Bn |
  5783. * |--------------------------------------------------------------------------|
  5784. * | reserved | MPDU range status | MPDU count |
  5785. * |--------------------------------------------------------------------------|
  5786. * : reserved : MPDU range status : MPDU count :
  5787. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  5788. *
  5789. * Header fields:
  5790. * - MSG_TYPE
  5791. * Bits 7:0
  5792. * Purpose: identifies this as an rx indication message
  5793. * Value: 0x1
  5794. * - EXT_TID
  5795. * Bits 12:8
  5796. * Purpose: identify the traffic ID of the rx data, including
  5797. * special "extended" TID values for multicast, broadcast, and
  5798. * non-QoS data frames
  5799. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  5800. * - FLUSH_VALID (FV)
  5801. * Bit 13
  5802. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  5803. * is valid
  5804. * Value:
  5805. * 1 -> flush IE is valid and needs to be processed
  5806. * 0 -> flush IE is not valid and should be ignored
  5807. * - REL_VALID (RV)
  5808. * Bit 13
  5809. * Purpose: indicate whether the release IE (start/end sequence numbers)
  5810. * is valid
  5811. * Value:
  5812. * 1 -> release IE is valid and needs to be processed
  5813. * 0 -> release IE is not valid and should be ignored
  5814. * - PEER_ID
  5815. * Bits 31:16
  5816. * Purpose: Identify, by ID, which peer sent the rx data
  5817. * Value: ID of the peer who sent the rx data
  5818. * - FLUSH_SEQ_NUM_START
  5819. * Bits 5:0
  5820. * Purpose: Indicate the start of a series of MPDUs to flush
  5821. * Not all MPDUs within this series are necessarily valid - the host
  5822. * must check each sequence number within this range to see if the
  5823. * corresponding MPDU is actually present.
  5824. * This field is only valid if the FV bit is set.
  5825. * Value:
  5826. * The sequence number for the first MPDUs to check to flush.
  5827. * The sequence number is masked by 0x3f.
  5828. * - FLUSH_SEQ_NUM_END
  5829. * Bits 11:6
  5830. * Purpose: Indicate the end of a series of MPDUs to flush
  5831. * Value:
  5832. * The sequence number one larger than the sequence number of the
  5833. * last MPDU to check to flush.
  5834. * The sequence number is masked by 0x3f.
  5835. * Not all MPDUs within this series are necessarily valid - the host
  5836. * must check each sequence number within this range to see if the
  5837. * corresponding MPDU is actually present.
  5838. * This field is only valid if the FV bit is set.
  5839. * - REL_SEQ_NUM_START
  5840. * Bits 17:12
  5841. * Purpose: Indicate the start of a series of MPDUs to release.
  5842. * All MPDUs within this series are present and valid - the host
  5843. * need not check each sequence number within this range to see if
  5844. * the corresponding MPDU is actually present.
  5845. * This field is only valid if the RV bit is set.
  5846. * Value:
  5847. * The sequence number for the first MPDUs to check to release.
  5848. * The sequence number is masked by 0x3f.
  5849. * - REL_SEQ_NUM_END
  5850. * Bits 23:18
  5851. * Purpose: Indicate the end of a series of MPDUs to release.
  5852. * Value:
  5853. * The sequence number one larger than the sequence number of the
  5854. * last MPDU to check to release.
  5855. * The sequence number is masked by 0x3f.
  5856. * All MPDUs within this series are present and valid - the host
  5857. * need not check each sequence number within this range to see if
  5858. * the corresponding MPDU is actually present.
  5859. * This field is only valid if the RV bit is set.
  5860. * - NUM_MPDU_RANGES
  5861. * Bits 31:24
  5862. * Purpose: Indicate how many ranges of MPDUs are present.
  5863. * Each MPDU range consists of a series of contiguous MPDUs within the
  5864. * rx frame sequence which all have the same MPDU status.
  5865. * Value: 1-63 (typically a small number, like 1-3)
  5866. *
  5867. * Rx PPDU descriptor fields:
  5868. * - RSSI_CMB
  5869. * Bits 7:0
  5870. * Purpose: Combined RSSI from all active rx chains, across the active
  5871. * bandwidth.
  5872. * Value: RSSI dB units w.r.t. noise floor
  5873. * - TIMESTAMP_SUBMICROSEC
  5874. * Bits 15:8
  5875. * Purpose: high-resolution timestamp
  5876. * Value:
  5877. * Sub-microsecond time of PPDU reception.
  5878. * This timestamp ranges from [0,MAC clock MHz).
  5879. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  5880. * to form a high-resolution, large range rx timestamp.
  5881. * - PHY_ERR_CODE
  5882. * Bits 23:16
  5883. * Purpose:
  5884. * If the rx frame processing resulted in a PHY error, indicate what
  5885. * type of rx PHY error occurred.
  5886. * Value:
  5887. * This field is valid if the "P" (PHY_ERR) flag is set.
  5888. * TBD: document/specify the values for this field
  5889. * - PHY_ERR
  5890. * Bit 24
  5891. * Purpose: indicate whether the rx PPDU had a PHY error
  5892. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  5893. * - LEGACY_RATE
  5894. * Bits 28:25
  5895. * Purpose:
  5896. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  5897. * specify which rate was used.
  5898. * Value:
  5899. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  5900. * flag.
  5901. * If LEGACY_RATE_SEL is 0:
  5902. * 0x8: OFDM 48 Mbps
  5903. * 0x9: OFDM 24 Mbps
  5904. * 0xA: OFDM 12 Mbps
  5905. * 0xB: OFDM 6 Mbps
  5906. * 0xC: OFDM 54 Mbps
  5907. * 0xD: OFDM 36 Mbps
  5908. * 0xE: OFDM 18 Mbps
  5909. * 0xF: OFDM 9 Mbps
  5910. * If LEGACY_RATE_SEL is 1:
  5911. * 0x8: CCK 11 Mbps long preamble
  5912. * 0x9: CCK 5.5 Mbps long preamble
  5913. * 0xA: CCK 2 Mbps long preamble
  5914. * 0xB: CCK 1 Mbps long preamble
  5915. * 0xC: CCK 11 Mbps short preamble
  5916. * 0xD: CCK 5.5 Mbps short preamble
  5917. * 0xE: CCK 2 Mbps short preamble
  5918. * - LEGACY_RATE_SEL
  5919. * Bit 29
  5920. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  5921. * Value:
  5922. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  5923. * used a legacy rate.
  5924. * 0 -> OFDM, 1 -> CCK
  5925. * - END_VALID
  5926. * Bit 30
  5927. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5928. * the start of the PPDU are valid. Specifically, the following
  5929. * fields are only valid if END_VALID is set:
  5930. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  5931. * TIMESTAMP_SUBMICROSEC
  5932. * Value:
  5933. * 0 -> rx PPDU desc end fields are not valid
  5934. * 1 -> rx PPDU desc end fields are valid
  5935. * - START_VALID
  5936. * Bit 31
  5937. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5938. * the end of the PPDU are valid. Specifically, the following
  5939. * fields are only valid if START_VALID is set:
  5940. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  5941. * VHT-SIG-A
  5942. * Value:
  5943. * 0 -> rx PPDU desc start fields are not valid
  5944. * 1 -> rx PPDU desc start fields are valid
  5945. * - RSSI0_PRI20
  5946. * Bits 7:0
  5947. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  5948. * Value: RSSI dB units w.r.t. noise floor
  5949. *
  5950. * - RSSI0_EXT20
  5951. * Bits 7:0
  5952. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  5953. * (if the rx bandwidth was >= 40 MHz)
  5954. * Value: RSSI dB units w.r.t. noise floor
  5955. * - RSSI0_EXT40
  5956. * Bits 7:0
  5957. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  5958. * (if the rx bandwidth was >= 80 MHz)
  5959. * Value: RSSI dB units w.r.t. noise floor
  5960. * - RSSI0_EXT80
  5961. * Bits 7:0
  5962. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  5963. * (if the rx bandwidth was >= 160 MHz)
  5964. * Value: RSSI dB units w.r.t. noise floor
  5965. *
  5966. * - RSSI1_PRI20
  5967. * Bits 7:0
  5968. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  5969. * Value: RSSI dB units w.r.t. noise floor
  5970. * - RSSI1_EXT20
  5971. * Bits 7:0
  5972. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  5973. * (if the rx bandwidth was >= 40 MHz)
  5974. * Value: RSSI dB units w.r.t. noise floor
  5975. * - RSSI1_EXT40
  5976. * Bits 7:0
  5977. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  5978. * (if the rx bandwidth was >= 80 MHz)
  5979. * Value: RSSI dB units w.r.t. noise floor
  5980. * - RSSI1_EXT80
  5981. * Bits 7:0
  5982. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  5983. * (if the rx bandwidth was >= 160 MHz)
  5984. * Value: RSSI dB units w.r.t. noise floor
  5985. *
  5986. * - RSSI2_PRI20
  5987. * Bits 7:0
  5988. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  5989. * Value: RSSI dB units w.r.t. noise floor
  5990. * - RSSI2_EXT20
  5991. * Bits 7:0
  5992. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  5993. * (if the rx bandwidth was >= 40 MHz)
  5994. * Value: RSSI dB units w.r.t. noise floor
  5995. * - RSSI2_EXT40
  5996. * Bits 7:0
  5997. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  5998. * (if the rx bandwidth was >= 80 MHz)
  5999. * Value: RSSI dB units w.r.t. noise floor
  6000. * - RSSI2_EXT80
  6001. * Bits 7:0
  6002. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  6003. * (if the rx bandwidth was >= 160 MHz)
  6004. * Value: RSSI dB units w.r.t. noise floor
  6005. *
  6006. * - RSSI3_PRI20
  6007. * Bits 7:0
  6008. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  6009. * Value: RSSI dB units w.r.t. noise floor
  6010. * - RSSI3_EXT20
  6011. * Bits 7:0
  6012. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  6013. * (if the rx bandwidth was >= 40 MHz)
  6014. * Value: RSSI dB units w.r.t. noise floor
  6015. * - RSSI3_EXT40
  6016. * Bits 7:0
  6017. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  6018. * (if the rx bandwidth was >= 80 MHz)
  6019. * Value: RSSI dB units w.r.t. noise floor
  6020. * - RSSI3_EXT80
  6021. * Bits 7:0
  6022. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  6023. * (if the rx bandwidth was >= 160 MHz)
  6024. * Value: RSSI dB units w.r.t. noise floor
  6025. *
  6026. * - TSF32
  6027. * Bits 31:0
  6028. * Purpose: specify the time the rx PPDU was received, in TSF units
  6029. * Value: 32 LSBs of the TSF
  6030. * - TIMESTAMP_MICROSEC
  6031. * Bits 31:0
  6032. * Purpose: specify the time the rx PPDU was received, in microsecond units
  6033. * Value: PPDU rx time, in microseconds
  6034. * - VHT_SIG_A1
  6035. * Bits 23:0
  6036. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  6037. * from the rx PPDU
  6038. * Value:
  6039. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  6040. * VHT-SIG-A1 data.
  6041. * If PREAMBLE_TYPE specifies HT, then this field contains the
  6042. * first 24 bits of the HT-SIG data.
  6043. * Otherwise, this field is invalid.
  6044. * Refer to the the 802.11 protocol for the definition of the
  6045. * HT-SIG and VHT-SIG-A1 fields
  6046. * - VHT_SIG_A2
  6047. * Bits 23:0
  6048. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  6049. * from the rx PPDU
  6050. * Value:
  6051. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  6052. * VHT-SIG-A2 data.
  6053. * If PREAMBLE_TYPE specifies HT, then this field contains the
  6054. * last 24 bits of the HT-SIG data.
  6055. * Otherwise, this field is invalid.
  6056. * Refer to the the 802.11 protocol for the definition of the
  6057. * HT-SIG and VHT-SIG-A2 fields
  6058. * - PREAMBLE_TYPE
  6059. * Bits 31:24
  6060. * Purpose: indicate the PHY format of the received burst
  6061. * Value:
  6062. * 0x4: Legacy (OFDM/CCK)
  6063. * 0x8: HT
  6064. * 0x9: HT with TxBF
  6065. * 0xC: VHT
  6066. * 0xD: VHT with TxBF
  6067. * - SERVICE
  6068. * Bits 31:24
  6069. * Purpose: TBD
  6070. * Value: TBD
  6071. *
  6072. * Rx MSDU descriptor fields:
  6073. * - FW_RX_DESC_BYTES
  6074. * Bits 15:0
  6075. * Purpose: Indicate how many bytes in the Rx indication are used for
  6076. * FW Rx descriptors
  6077. *
  6078. * Payload fields:
  6079. * - MPDU_COUNT
  6080. * Bits 7:0
  6081. * Purpose: Indicate how many sequential MPDUs share the same status.
  6082. * All MPDUs within the indicated list are from the same RA-TA-TID.
  6083. * - MPDU_STATUS
  6084. * Bits 15:8
  6085. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  6086. * received successfully.
  6087. * Value:
  6088. * 0x1: success
  6089. * 0x2: FCS error
  6090. * 0x3: duplicate error
  6091. * 0x4: replay error
  6092. * 0x5: invalid peer
  6093. */
  6094. /* header fields */
  6095. #define HTT_RX_IND_EXT_TID_M 0x1f00
  6096. #define HTT_RX_IND_EXT_TID_S 8
  6097. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  6098. #define HTT_RX_IND_FLUSH_VALID_S 13
  6099. #define HTT_RX_IND_REL_VALID_M 0x4000
  6100. #define HTT_RX_IND_REL_VALID_S 14
  6101. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  6102. #define HTT_RX_IND_PEER_ID_S 16
  6103. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  6104. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  6105. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  6106. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  6107. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  6108. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  6109. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  6110. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  6111. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  6112. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  6113. /* rx PPDU descriptor fields */
  6114. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  6115. #define HTT_RX_IND_RSSI_CMB_S 0
  6116. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  6117. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  6118. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  6119. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  6120. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  6121. #define HTT_RX_IND_PHY_ERR_S 24
  6122. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  6123. #define HTT_RX_IND_LEGACY_RATE_S 25
  6124. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  6125. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  6126. #define HTT_RX_IND_END_VALID_M 0x40000000
  6127. #define HTT_RX_IND_END_VALID_S 30
  6128. #define HTT_RX_IND_START_VALID_M 0x80000000
  6129. #define HTT_RX_IND_START_VALID_S 31
  6130. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  6131. #define HTT_RX_IND_RSSI_PRI20_S 0
  6132. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  6133. #define HTT_RX_IND_RSSI_EXT20_S 8
  6134. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  6135. #define HTT_RX_IND_RSSI_EXT40_S 16
  6136. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  6137. #define HTT_RX_IND_RSSI_EXT80_S 24
  6138. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  6139. #define HTT_RX_IND_VHT_SIG_A1_S 0
  6140. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  6141. #define HTT_RX_IND_VHT_SIG_A2_S 0
  6142. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  6143. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  6144. #define HTT_RX_IND_SERVICE_M 0xff000000
  6145. #define HTT_RX_IND_SERVICE_S 24
  6146. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  6147. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  6148. /* rx MSDU descriptor fields */
  6149. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  6150. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  6151. /* payload fields */
  6152. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  6153. #define HTT_RX_IND_MPDU_COUNT_S 0
  6154. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  6155. #define HTT_RX_IND_MPDU_STATUS_S 8
  6156. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  6157. do { \
  6158. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  6159. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  6160. } while (0)
  6161. #define HTT_RX_IND_EXT_TID_GET(word) \
  6162. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  6163. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  6164. do { \
  6165. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  6166. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  6167. } while (0)
  6168. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  6169. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  6170. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  6171. do { \
  6172. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  6173. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  6174. } while (0)
  6175. #define HTT_RX_IND_REL_VALID_GET(word) \
  6176. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  6177. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  6178. do { \
  6179. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  6180. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  6181. } while (0)
  6182. #define HTT_RX_IND_PEER_ID_GET(word) \
  6183. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  6184. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  6185. do { \
  6186. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  6187. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  6188. } while (0)
  6189. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  6190. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  6191. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  6192. do { \
  6193. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  6194. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  6195. } while (0)
  6196. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  6197. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  6198. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  6199. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  6200. do { \
  6201. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  6202. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  6203. } while (0)
  6204. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  6205. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  6206. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  6207. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  6208. do { \
  6209. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  6210. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  6211. } while (0)
  6212. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  6213. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  6214. HTT_RX_IND_REL_SEQ_NUM_START_S)
  6215. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  6216. do { \
  6217. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  6218. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  6219. } while (0)
  6220. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  6221. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  6222. HTT_RX_IND_REL_SEQ_NUM_END_S)
  6223. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  6224. do { \
  6225. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  6226. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  6227. } while (0)
  6228. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  6229. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  6230. HTT_RX_IND_NUM_MPDU_RANGES_S)
  6231. /* FW rx PPDU descriptor fields */
  6232. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  6233. do { \
  6234. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  6235. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  6236. } while (0)
  6237. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  6238. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  6239. HTT_RX_IND_RSSI_CMB_S)
  6240. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  6241. do { \
  6242. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  6243. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  6244. } while (0)
  6245. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  6246. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  6247. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  6248. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  6249. do { \
  6250. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  6251. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  6252. } while (0)
  6253. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  6254. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  6255. HTT_RX_IND_PHY_ERR_CODE_S)
  6256. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  6257. do { \
  6258. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  6259. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  6260. } while (0)
  6261. #define HTT_RX_IND_PHY_ERR_GET(word) \
  6262. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  6263. HTT_RX_IND_PHY_ERR_S)
  6264. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  6265. do { \
  6266. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  6267. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  6268. } while (0)
  6269. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  6270. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  6271. HTT_RX_IND_LEGACY_RATE_S)
  6272. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  6273. do { \
  6274. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  6275. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  6276. } while (0)
  6277. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  6278. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  6279. HTT_RX_IND_LEGACY_RATE_SEL_S)
  6280. #define HTT_RX_IND_END_VALID_SET(word, value) \
  6281. do { \
  6282. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  6283. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  6284. } while (0)
  6285. #define HTT_RX_IND_END_VALID_GET(word) \
  6286. (((word) & HTT_RX_IND_END_VALID_M) >> \
  6287. HTT_RX_IND_END_VALID_S)
  6288. #define HTT_RX_IND_START_VALID_SET(word, value) \
  6289. do { \
  6290. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  6291. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  6292. } while (0)
  6293. #define HTT_RX_IND_START_VALID_GET(word) \
  6294. (((word) & HTT_RX_IND_START_VALID_M) >> \
  6295. HTT_RX_IND_START_VALID_S)
  6296. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  6297. do { \
  6298. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  6299. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  6300. } while (0)
  6301. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  6302. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  6303. HTT_RX_IND_RSSI_PRI20_S)
  6304. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  6305. do { \
  6306. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  6307. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  6308. } while (0)
  6309. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  6310. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  6311. HTT_RX_IND_RSSI_EXT20_S)
  6312. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  6313. do { \
  6314. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  6315. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  6316. } while (0)
  6317. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  6318. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  6319. HTT_RX_IND_RSSI_EXT40_S)
  6320. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  6321. do { \
  6322. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  6323. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  6324. } while (0)
  6325. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  6326. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  6327. HTT_RX_IND_RSSI_EXT80_S)
  6328. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  6329. do { \
  6330. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  6331. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  6332. } while (0)
  6333. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  6334. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  6335. HTT_RX_IND_VHT_SIG_A1_S)
  6336. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  6337. do { \
  6338. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  6339. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  6340. } while (0)
  6341. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  6342. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  6343. HTT_RX_IND_VHT_SIG_A2_S)
  6344. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  6345. do { \
  6346. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  6347. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  6348. } while (0)
  6349. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  6350. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  6351. HTT_RX_IND_PREAMBLE_TYPE_S)
  6352. #define HTT_RX_IND_SERVICE_SET(word, value) \
  6353. do { \
  6354. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  6355. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  6356. } while (0)
  6357. #define HTT_RX_IND_SERVICE_GET(word) \
  6358. (((word) & HTT_RX_IND_SERVICE_M) >> \
  6359. HTT_RX_IND_SERVICE_S)
  6360. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  6361. do { \
  6362. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  6363. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  6364. } while (0)
  6365. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  6366. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  6367. HTT_RX_IND_SA_ANT_MATRIX_S)
  6368. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  6369. do { \
  6370. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  6371. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  6372. } while (0)
  6373. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  6374. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  6375. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  6376. do { \
  6377. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  6378. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  6379. } while (0)
  6380. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  6381. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  6382. #define HTT_RX_IND_HL_BYTES \
  6383. (HTT_RX_IND_HDR_BYTES + \
  6384. 4 /* single FW rx MSDU descriptor */ + \
  6385. 4 /* single MPDU range information element */)
  6386. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  6387. /* Could we use one macro entry? */
  6388. #define HTT_WORD_SET(word, field, value) \
  6389. do { \
  6390. HTT_CHECK_SET_VAL(field, value); \
  6391. (word) |= ((value) << field ## _S); \
  6392. } while (0)
  6393. #define HTT_WORD_GET(word, field) \
  6394. (((word) & field ## _M) >> field ## _S)
  6395. PREPACK struct hl_htt_rx_ind_base {
  6396. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  6397. } POSTPACK;
  6398. /*
  6399. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  6400. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  6401. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  6402. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  6403. * htt_rx_ind_hl_rx_desc_t.
  6404. */
  6405. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  6406. struct htt_rx_ind_hl_rx_desc_t {
  6407. A_UINT8 ver;
  6408. A_UINT8 len;
  6409. struct {
  6410. A_UINT8
  6411. first_msdu: 1,
  6412. last_msdu: 1,
  6413. c3_failed: 1,
  6414. c4_failed: 1,
  6415. ipv6: 1,
  6416. tcp: 1,
  6417. udp: 1,
  6418. reserved: 1;
  6419. } flags;
  6420. /* NOTE: no reserved space - don't append any new fields here */
  6421. };
  6422. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  6423. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6424. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  6425. #define HTT_RX_IND_HL_RX_DESC_VER 0
  6426. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  6427. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6428. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  6429. #define HTT_RX_IND_HL_FLAG_OFFSET \
  6430. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6431. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  6432. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  6433. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  6434. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  6435. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  6436. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  6437. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  6438. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  6439. /* This structure is used in HL, the basic descriptor information
  6440. * used by host. the structure is translated by FW from HW desc
  6441. * or generated by FW. But in HL monitor mode, the host would use
  6442. * the same structure with LL.
  6443. */
  6444. PREPACK struct hl_htt_rx_desc_base {
  6445. A_UINT32
  6446. seq_num:12,
  6447. encrypted:1,
  6448. chan_info_present:1,
  6449. resv0:2,
  6450. mcast_bcast:1,
  6451. fragment:1,
  6452. key_id_oct:8,
  6453. resv1:6;
  6454. A_UINT32
  6455. pn_31_0;
  6456. union {
  6457. struct {
  6458. A_UINT16 pn_47_32;
  6459. A_UINT16 pn_63_48;
  6460. } pn16;
  6461. A_UINT32 pn_63_32;
  6462. } u0;
  6463. A_UINT32
  6464. pn_95_64;
  6465. A_UINT32
  6466. pn_127_96;
  6467. } POSTPACK;
  6468. /*
  6469. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  6470. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  6471. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  6472. * Please see htt_chan_change_t for description of the fields.
  6473. */
  6474. PREPACK struct htt_chan_info_t
  6475. {
  6476. A_UINT32 primary_chan_center_freq_mhz: 16,
  6477. contig_chan1_center_freq_mhz: 16;
  6478. A_UINT32 contig_chan2_center_freq_mhz: 16,
  6479. phy_mode: 8,
  6480. reserved: 8;
  6481. } POSTPACK;
  6482. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  6483. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  6484. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  6485. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  6486. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  6487. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  6488. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  6489. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  6490. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  6491. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  6492. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  6493. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  6494. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  6495. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  6496. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  6497. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  6498. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  6499. /* Channel information */
  6500. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  6501. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  6502. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  6503. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  6504. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  6505. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  6506. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  6507. #define HTT_CHAN_INFO_PHY_MODE_S 16
  6508. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  6509. do { \
  6510. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  6511. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  6512. } while (0)
  6513. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  6514. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  6515. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  6516. do { \
  6517. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  6518. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  6519. } while (0)
  6520. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  6521. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  6522. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  6523. do { \
  6524. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  6525. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  6526. } while (0)
  6527. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  6528. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  6529. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  6530. do { \
  6531. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  6532. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  6533. } while (0)
  6534. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  6535. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  6536. /*
  6537. * HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  6538. * @brief target -> host message definition for FW offloaded pkts
  6539. *
  6540. * @details
  6541. * The following field definitions describe the format of the firmware
  6542. * offload deliver message sent from the target to the host.
  6543. *
  6544. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  6545. *
  6546. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  6547. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  6548. * | reserved_1 | msg type |
  6549. * |--------------------------------------------------------------------------|
  6550. * | phy_timestamp_l32 |
  6551. * |--------------------------------------------------------------------------|
  6552. * | WORD2 (see below) |
  6553. * |--------------------------------------------------------------------------|
  6554. * | seqno | framectrl |
  6555. * |--------------------------------------------------------------------------|
  6556. * | reserved_3 | vdev_id | tid_num|
  6557. * |--------------------------------------------------------------------------|
  6558. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  6559. * |--------------------------------------------------------------------------|
  6560. *
  6561. * where:
  6562. * STAT = status
  6563. * F = format (802.3 vs. 802.11)
  6564. *
  6565. * definition for word 2
  6566. *
  6567. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  6568. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  6569. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  6570. * |--------------------------------------------------------------------------|
  6571. *
  6572. * where:
  6573. * PR = preamble
  6574. * BF = beamformed
  6575. */
  6576. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  6577. {
  6578. A_UINT32 /* word 0 */
  6579. msg_type:8, /* [ 7: 0] */
  6580. reserved_1:24; /* [31: 8] */
  6581. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  6582. A_UINT32 /* word 2 */
  6583. /* preamble:
  6584. * 0-OFDM,
  6585. * 1-CCk,
  6586. * 2-HT,
  6587. * 3-VHT
  6588. */
  6589. preamble: 2, /* [1:0] */
  6590. /* mcs:
  6591. * In case of HT preamble interpret
  6592. * MCS along with NSS.
  6593. * Valid values for HT are 0 to 7.
  6594. * HT mcs 0 with NSS 2 is mcs 8.
  6595. * Valid values for VHT are 0 to 9.
  6596. */
  6597. mcs: 4, /* [5:2] */
  6598. /* rate:
  6599. * This is applicable only for
  6600. * CCK and OFDM preamble type
  6601. * rate 0: OFDM 48 Mbps,
  6602. * 1: OFDM 24 Mbps,
  6603. * 2: OFDM 12 Mbps
  6604. * 3: OFDM 6 Mbps
  6605. * 4: OFDM 54 Mbps
  6606. * 5: OFDM 36 Mbps
  6607. * 6: OFDM 18 Mbps
  6608. * 7: OFDM 9 Mbps
  6609. * rate 0: CCK 11 Mbps Long
  6610. * 1: CCK 5.5 Mbps Long
  6611. * 2: CCK 2 Mbps Long
  6612. * 3: CCK 1 Mbps Long
  6613. * 4: CCK 11 Mbps Short
  6614. * 5: CCK 5.5 Mbps Short
  6615. * 6: CCK 2 Mbps Short
  6616. */
  6617. rate : 3, /* [ 8: 6] */
  6618. rssi : 8, /* [16: 9] units=dBm */
  6619. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  6620. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  6621. stbc : 1, /* [22] */
  6622. sgi : 1, /* [23] */
  6623. ldpc : 1, /* [24] */
  6624. beamformed: 1, /* [25] */
  6625. reserved_2: 6; /* [31:26] */
  6626. A_UINT32 /* word 3 */
  6627. framectrl:16, /* [15: 0] */
  6628. seqno:16; /* [31:16] */
  6629. A_UINT32 /* word 4 */
  6630. tid_num:5, /* [ 4: 0] actual TID number */
  6631. vdev_id:8, /* [12: 5] */
  6632. reserved_3:19; /* [31:13] */
  6633. A_UINT32 /* word 5 */
  6634. /* status:
  6635. * 0: tx_ok
  6636. * 1: retry
  6637. * 2: drop
  6638. * 3: filtered
  6639. * 4: abort
  6640. * 5: tid delete
  6641. * 6: sw abort
  6642. * 7: dropped by peer migration
  6643. */
  6644. status:3, /* [2:0] */
  6645. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  6646. tx_mpdu_bytes:16, /* [19:4] */
  6647. reserved_4:12; /* [31:20] */
  6648. } POSTPACK;
  6649. /* FW offload deliver ind message header fields */
  6650. /* DWORD one */
  6651. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  6652. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  6653. /* DWORD two */
  6654. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  6655. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  6656. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  6657. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  6658. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  6659. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  6660. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  6661. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  6662. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  6663. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  6664. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  6665. #define HTT_FW_OFFLOAD_IND_BW_S 19
  6666. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  6667. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  6668. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  6669. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  6670. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  6671. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  6672. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  6673. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  6674. /* DWORD three*/
  6675. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  6676. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  6677. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  6678. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  6679. /* DWORD four */
  6680. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  6681. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  6682. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  6683. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  6684. /* DWORD five */
  6685. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  6686. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  6687. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  6688. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  6689. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  6690. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  6691. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  6692. do { \
  6693. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  6694. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  6695. } while (0)
  6696. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  6697. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  6698. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  6699. do { \
  6700. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  6701. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  6702. } while (0)
  6703. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  6704. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  6705. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  6706. do { \
  6707. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  6708. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  6709. } while (0)
  6710. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  6711. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  6712. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  6713. do { \
  6714. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  6715. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  6716. } while (0)
  6717. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  6718. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  6719. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  6720. do { \
  6721. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  6722. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  6723. } while (0)
  6724. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  6725. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  6726. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  6727. do { \
  6728. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  6729. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  6730. } while (0)
  6731. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  6732. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  6733. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  6734. do { \
  6735. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  6736. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  6737. } while (0)
  6738. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  6739. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  6740. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  6741. do { \
  6742. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  6743. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  6744. } while (0)
  6745. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  6746. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  6747. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  6748. do { \
  6749. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  6750. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  6751. } while (0)
  6752. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  6753. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  6754. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  6755. do { \
  6756. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  6757. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  6758. } while (0)
  6759. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  6760. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  6761. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  6762. do { \
  6763. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  6764. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  6765. } while (0)
  6766. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  6767. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  6768. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  6769. do { \
  6770. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  6771. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  6772. } while (0)
  6773. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  6774. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  6775. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  6776. do { \
  6777. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  6778. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  6779. } while (0)
  6780. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  6781. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  6782. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  6783. do { \
  6784. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  6785. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  6786. } while (0)
  6787. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  6788. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  6789. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  6790. do { \
  6791. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  6792. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  6793. } while (0)
  6794. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  6795. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  6796. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  6797. do { \
  6798. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  6799. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  6800. } while (0)
  6801. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  6802. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  6803. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  6804. do { \
  6805. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  6806. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  6807. } while (0)
  6808. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  6809. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  6810. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  6811. do { \
  6812. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  6813. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  6814. } while (0)
  6815. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  6816. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  6817. /*
  6818. * @brief target -> host rx reorder flush message definition
  6819. *
  6820. * @details
  6821. * The following field definitions describe the format of the rx flush
  6822. * message sent from the target to the host.
  6823. * The message consists of a 4-octet header, followed by one or more
  6824. * 4-octet payload information elements.
  6825. *
  6826. * |31 24|23 8|7 0|
  6827. * |--------------------------------------------------------------|
  6828. * | TID | peer ID | msg type |
  6829. * |--------------------------------------------------------------|
  6830. * | seq num end | seq num start | MPDU status | reserved |
  6831. * |--------------------------------------------------------------|
  6832. * First DWORD:
  6833. * - MSG_TYPE
  6834. * Bits 7:0
  6835. * Purpose: identifies this as an rx flush message
  6836. * Value: 0x2
  6837. * - PEER_ID
  6838. * Bits 23:8 (only bits 18:8 actually used)
  6839. * Purpose: identify which peer's rx data is being flushed
  6840. * Value: (rx) peer ID
  6841. * - TID
  6842. * Bits 31:24 (only bits 27:24 actually used)
  6843. * Purpose: Specifies which traffic identifier's rx data is being flushed
  6844. * Value: traffic identifier
  6845. * Second DWORD:
  6846. * - MPDU_STATUS
  6847. * Bits 15:8
  6848. * Purpose:
  6849. * Indicate whether the flushed MPDUs should be discarded or processed.
  6850. * Value:
  6851. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  6852. * stages of rx processing
  6853. * other: discard the MPDUs
  6854. * It is anticipated that flush messages will always have
  6855. * MPDU status == 1, but the status flag is included for
  6856. * flexibility.
  6857. * - SEQ_NUM_START
  6858. * Bits 23:16
  6859. * Purpose:
  6860. * Indicate the start of a series of consecutive MPDUs being flushed.
  6861. * Not all MPDUs within this range are necessarily valid - the host
  6862. * must check each sequence number within this range to see if the
  6863. * corresponding MPDU is actually present.
  6864. * Value:
  6865. * The sequence number for the first MPDU in the sequence.
  6866. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6867. * - SEQ_NUM_END
  6868. * Bits 30:24
  6869. * Purpose:
  6870. * Indicate the end of a series of consecutive MPDUs being flushed.
  6871. * Value:
  6872. * The sequence number one larger than the sequence number of the
  6873. * last MPDU being flushed.
  6874. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6875. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  6876. * are to be released for further rx processing.
  6877. * Not all MPDUs within this range are necessarily valid - the host
  6878. * must check each sequence number within this range to see if the
  6879. * corresponding MPDU is actually present.
  6880. */
  6881. /* first DWORD */
  6882. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  6883. #define HTT_RX_FLUSH_PEER_ID_S 8
  6884. #define HTT_RX_FLUSH_TID_M 0xff000000
  6885. #define HTT_RX_FLUSH_TID_S 24
  6886. /* second DWORD */
  6887. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  6888. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  6889. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  6890. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  6891. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  6892. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  6893. #define HTT_RX_FLUSH_BYTES 8
  6894. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  6895. do { \
  6896. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  6897. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  6898. } while (0)
  6899. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  6900. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  6901. #define HTT_RX_FLUSH_TID_SET(word, value) \
  6902. do { \
  6903. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  6904. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  6905. } while (0)
  6906. #define HTT_RX_FLUSH_TID_GET(word) \
  6907. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  6908. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  6909. do { \
  6910. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  6911. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  6912. } while (0)
  6913. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  6914. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  6915. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  6916. do { \
  6917. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  6918. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  6919. } while (0)
  6920. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  6921. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  6922. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  6923. do { \
  6924. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  6925. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  6926. } while (0)
  6927. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  6928. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  6929. /*
  6930. * @brief target -> host rx pn check indication message
  6931. *
  6932. * @details
  6933. * The following field definitions describe the format of the Rx PN check
  6934. * indication message sent from the target to the host.
  6935. * The message consists of a 4-octet header, followed by the start and
  6936. * end sequence numbers to be released, followed by the PN IEs. Each PN
  6937. * IE is one octet containing the sequence number that failed the PN
  6938. * check.
  6939. *
  6940. * |31 24|23 8|7 0|
  6941. * |--------------------------------------------------------------|
  6942. * | TID | peer ID | msg type |
  6943. * |--------------------------------------------------------------|
  6944. * | Reserved | PN IE count | seq num end | seq num start|
  6945. * |--------------------------------------------------------------|
  6946. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  6947. * |--------------------------------------------------------------|
  6948. * First DWORD:
  6949. * - MSG_TYPE
  6950. * Bits 7:0
  6951. * Purpose: Identifies this as an rx pn check indication message
  6952. * Value: 0x2
  6953. * - PEER_ID
  6954. * Bits 23:8 (only bits 18:8 actually used)
  6955. * Purpose: identify which peer
  6956. * Value: (rx) peer ID
  6957. * - TID
  6958. * Bits 31:24 (only bits 27:24 actually used)
  6959. * Purpose: identify traffic identifier
  6960. * Value: traffic identifier
  6961. * Second DWORD:
  6962. * - SEQ_NUM_START
  6963. * Bits 7:0
  6964. * Purpose:
  6965. * Indicates the starting sequence number of the MPDU in this
  6966. * series of MPDUs that went though PN check.
  6967. * Value:
  6968. * The sequence number for the first MPDU in the sequence.
  6969. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6970. * - SEQ_NUM_END
  6971. * Bits 15:8
  6972. * Purpose:
  6973. * Indicates the ending sequence number of the MPDU in this
  6974. * series of MPDUs that went though PN check.
  6975. * Value:
  6976. * The sequence number one larger then the sequence number of the last
  6977. * MPDU being flushed.
  6978. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6979. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  6980. * for invalid PN numbers and are ready to be released for further processing.
  6981. * Not all MPDUs within this range are necessarily valid - the host
  6982. * must check each sequence number within this range to see if the
  6983. * corresponding MPDU is actually present.
  6984. * - PN_IE_COUNT
  6985. * Bits 23:16
  6986. * Purpose:
  6987. * Used to determine the variable number of PN information elements in this
  6988. * message
  6989. *
  6990. * PN information elements:
  6991. * - PN_IE_x-
  6992. * Purpose:
  6993. * Each PN information element contains the sequence number of the MPDU that
  6994. * has failed the target PN check.
  6995. * Value:
  6996. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  6997. * that failed the PN check.
  6998. */
  6999. /* first DWORD */
  7000. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  7001. #define HTT_RX_PN_IND_PEER_ID_S 8
  7002. #define HTT_RX_PN_IND_TID_M 0xff000000
  7003. #define HTT_RX_PN_IND_TID_S 24
  7004. /* second DWORD */
  7005. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  7006. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  7007. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  7008. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  7009. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  7010. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  7011. #define HTT_RX_PN_IND_BYTES 8
  7012. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  7013. do { \
  7014. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  7015. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  7016. } while (0)
  7017. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  7018. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  7019. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  7020. do { \
  7021. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  7022. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  7023. } while (0)
  7024. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  7025. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  7026. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  7027. do { \
  7028. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  7029. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  7030. } while (0)
  7031. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  7032. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  7033. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  7034. do { \
  7035. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  7036. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  7037. } while (0)
  7038. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  7039. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  7040. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  7041. do { \
  7042. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  7043. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  7044. } while (0)
  7045. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  7046. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  7047. /*
  7048. * @brief target -> host rx offload deliver message for LL system
  7049. *
  7050. * @details
  7051. * In a low latency system this message is sent whenever the offload
  7052. * manager flushes out the packets it has coalesced in its coalescing buffer.
  7053. * The DMA of the actual packets into host memory is done before sending out
  7054. * this message. This message indicates only how many MSDUs to reap. The
  7055. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  7056. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  7057. * DMA'd by the MAC directly into host memory these packets do not contain
  7058. * the MAC descriptors in the header portion of the packet. Instead they contain
  7059. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  7060. * message, the packets are delivered directly to the NW stack without going
  7061. * through the regular reorder buffering and PN checking path since it has
  7062. * already been done in target.
  7063. *
  7064. * |31 24|23 16|15 8|7 0|
  7065. * |-----------------------------------------------------------------------|
  7066. * | Total MSDU count | reserved | msg type |
  7067. * |-----------------------------------------------------------------------|
  7068. *
  7069. * @brief target -> host rx offload deliver message for HL system
  7070. *
  7071. * @details
  7072. * In a high latency system this message is sent whenever the offload manager
  7073. * flushes out the packets it has coalesced in its coalescing buffer. The
  7074. * actual packets are also carried along with this message. When the host
  7075. * receives this message, it is expected to deliver these packets to the NW
  7076. * stack directly instead of routing them through the reorder buffering and
  7077. * PN checking path since it has already been done in target.
  7078. *
  7079. * |31 24|23 16|15 8|7 0|
  7080. * |-----------------------------------------------------------------------|
  7081. * | Total MSDU count | reserved | msg type |
  7082. * |-----------------------------------------------------------------------|
  7083. * | peer ID | MSDU length |
  7084. * |-----------------------------------------------------------------------|
  7085. * | MSDU payload | FW Desc | tid | vdev ID |
  7086. * |-----------------------------------------------------------------------|
  7087. * | MSDU payload contd. |
  7088. * |-----------------------------------------------------------------------|
  7089. * | peer ID | MSDU length |
  7090. * |-----------------------------------------------------------------------|
  7091. * | MSDU payload | FW Desc | tid | vdev ID |
  7092. * |-----------------------------------------------------------------------|
  7093. * | MSDU payload contd. |
  7094. * |-----------------------------------------------------------------------|
  7095. *
  7096. */
  7097. /* first DWORD */
  7098. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  7099. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  7100. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  7101. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  7102. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  7103. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  7104. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  7105. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  7106. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  7107. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  7108. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  7109. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  7110. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  7111. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  7112. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  7113. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  7114. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  7115. do { \
  7116. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  7117. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  7118. } while (0)
  7119. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  7120. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  7121. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  7122. do { \
  7123. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  7124. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  7125. } while (0)
  7126. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  7127. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  7128. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  7129. do { \
  7130. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  7131. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  7132. } while (0)
  7133. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  7134. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  7135. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  7136. do { \
  7137. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  7138. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  7139. } while (0)
  7140. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  7141. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  7142. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  7143. do { \
  7144. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  7145. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  7146. } while (0)
  7147. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  7148. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  7149. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  7150. do { \
  7151. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  7152. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  7153. } while (0)
  7154. /**
  7155. * @brief target -> host rx peer map/unmap message definition
  7156. *
  7157. * @details
  7158. * The following diagram shows the format of the rx peer map message sent
  7159. * from the target to the host. This layout assumes the target operates
  7160. * as little-endian.
  7161. *
  7162. * This message always contains a SW peer ID. The main purpose of the
  7163. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  7164. * with, so that the host can use that peer ID to determine which peer
  7165. * transmitted the rx frame. This SW peer ID is sometimes also used for
  7166. * other purposes, such as identifying during tx completions which peer
  7167. * the tx frames in question were transmitted to.
  7168. *
  7169. * In certain generations of chips, the peer map message also contains
  7170. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  7171. * to identify which peer the frame needs to be forwarded to (i.e. the
  7172. * peer assocated with the Destination MAC Address within the packet),
  7173. * and particularly which vdev needs to transmit the frame (for cases
  7174. * of inter-vdev rx --> tx forwarding).
  7175. * This DA-based peer ID that is provided for certain rx frames
  7176. * (the rx frames that need to be re-transmitted as tx frames)
  7177. * is the ID that the HW uses for referring to the peer in question,
  7178. * rather than the peer ID that the SW+FW use to refer to the peer.
  7179. *
  7180. *
  7181. * |31 24|23 16|15 8|7 0|
  7182. * |-----------------------------------------------------------------------|
  7183. * | SW peer ID | VDEV ID | msg type |
  7184. * |-----------------------------------------------------------------------|
  7185. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  7186. * |-----------------------------------------------------------------------|
  7187. * | HW peer ID | MAC addr 5 | MAC addr 4 |
  7188. * |-----------------------------------------------------------------------|
  7189. *
  7190. *
  7191. * The following diagram shows the format of the rx peer unmap message sent
  7192. * from the target to the host.
  7193. *
  7194. * |31 24|23 16|15 8|7 0|
  7195. * |-----------------------------------------------------------------------|
  7196. * | SW peer ID | VDEV ID | msg type |
  7197. * |-----------------------------------------------------------------------|
  7198. *
  7199. * The following field definitions describe the format of the rx peer map
  7200. * and peer unmap messages sent from the target to the host.
  7201. * - MSG_TYPE
  7202. * Bits 7:0
  7203. * Purpose: identifies this as an rx peer map or peer unmap message
  7204. * Value: peer map -> 0x3, peer unmap -> 0x4
  7205. * - VDEV_ID
  7206. * Bits 15:8
  7207. * Purpose: Indicates which virtual device the peer is associated
  7208. * with.
  7209. * Value: vdev ID (used in the host to look up the vdev object)
  7210. * - PEER_ID (a.k.a. SW_PEER_ID)
  7211. * Bits 31:16
  7212. * Purpose: The peer ID (index) that WAL is allocating (map) or
  7213. * freeing (unmap)
  7214. * Value: (rx) peer ID
  7215. * - MAC_ADDR_L32 (peer map only)
  7216. * Bits 31:0
  7217. * Purpose: Identifies which peer node the peer ID is for.
  7218. * Value: lower 4 bytes of peer node's MAC address
  7219. * - MAC_ADDR_U16 (peer map only)
  7220. * Bits 15:0
  7221. * Purpose: Identifies which peer node the peer ID is for.
  7222. * Value: upper 2 bytes of peer node's MAC address
  7223. * - HW_PEER_ID
  7224. * Bits 31:16
  7225. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  7226. * address, so for rx frames marked for rx --> tx forwarding, the
  7227. * host can determine from the HW peer ID provided as meta-data with
  7228. * the rx frame which peer the frame is supposed to be forwarded to.
  7229. * Value: ID used by the MAC HW to identify the peer
  7230. */
  7231. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  7232. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  7233. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  7234. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  7235. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  7236. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  7237. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  7238. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  7239. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  7240. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  7241. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  7242. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  7243. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  7244. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  7245. do { \
  7246. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  7247. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  7248. } while (0)
  7249. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  7250. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  7251. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  7252. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  7253. do { \
  7254. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  7255. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  7256. } while (0)
  7257. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  7258. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  7259. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  7260. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  7261. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  7262. do { \
  7263. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  7264. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  7265. } while (0)
  7266. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  7267. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  7268. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  7269. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  7270. #define HTT_RX_PEER_MAP_BYTES 12
  7271. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  7272. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  7273. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  7274. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  7275. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  7276. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  7277. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  7278. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  7279. #define HTT_RX_PEER_UNMAP_BYTES 4
  7280. /**
  7281. * @brief target -> host rx peer map V2 message definition
  7282. *
  7283. * @details
  7284. * The following diagram shows the format of the rx peer map v2 message sent
  7285. * from the target to the host. This layout assumes the target operates
  7286. * as little-endian.
  7287. *
  7288. * This message always contains a SW peer ID. The main purpose of the
  7289. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  7290. * with, so that the host can use that peer ID to determine which peer
  7291. * transmitted the rx frame. This SW peer ID is sometimes also used for
  7292. * other purposes, such as identifying during tx completions which peer
  7293. * the tx frames in question were transmitted to.
  7294. *
  7295. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  7296. * is used during rx --> tx frame forwarding to identify which peer the
  7297. * frame needs to be forwarded to (i.e. the peer assocated with the
  7298. * Destination MAC Address within the packet), and particularly which vdev
  7299. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  7300. * This DA-based peer ID that is provided for certain rx frames
  7301. * (the rx frames that need to be re-transmitted as tx frames)
  7302. * is the ID that the HW uses for referring to the peer in question,
  7303. * rather than the peer ID that the SW+FW use to refer to the peer.
  7304. *
  7305. *
  7306. * |31 24|23 16|15 8|7 0|
  7307. * |-----------------------------------------------------------------------|
  7308. * | SW peer ID | VDEV ID | msg type |
  7309. * |-----------------------------------------------------------------------|
  7310. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  7311. * |-----------------------------------------------------------------------|
  7312. * | HW peer ID | MAC addr 5 | MAC addr 4 |
  7313. * |-----------------------------------------------------------------------|
  7314. * | Reserved_17_31 | Next Hop | AST Hash Value |
  7315. * |-----------------------------------------------------------------------|
  7316. * | Reserved_0 |
  7317. * |-----------------------------------------------------------------------|
  7318. * | Reserved_1 |
  7319. * |-----------------------------------------------------------------------|
  7320. * | Reserved_2 |
  7321. * |-----------------------------------------------------------------------|
  7322. * | Reserved_3 |
  7323. * |-----------------------------------------------------------------------|
  7324. *
  7325. *
  7326. * The following field definitions describe the format of the rx peer map v2
  7327. * messages sent from the target to the host.
  7328. * - MSG_TYPE
  7329. * Bits 7:0
  7330. * Purpose: identifies this as an rx peer map v2 message
  7331. * Value: peer map v2 -> 0x1e
  7332. * - VDEV_ID
  7333. * Bits 15:8
  7334. * Purpose: Indicates which virtual device the peer is associated with.
  7335. * Value: vdev ID (used in the host to look up the vdev object)
  7336. * - SW_PEER_ID
  7337. * Bits 31:16
  7338. * Purpose: The peer ID (index) that WAL is allocating
  7339. * Value: (rx) peer ID
  7340. * - MAC_ADDR_L32
  7341. * Bits 31:0
  7342. * Purpose: Identifies which peer node the peer ID is for.
  7343. * Value: lower 4 bytes of peer node's MAC address
  7344. * - MAC_ADDR_U16
  7345. * Bits 15:0
  7346. * Purpose: Identifies which peer node the peer ID is for.
  7347. * Value: upper 2 bytes of peer node's MAC address
  7348. * - HW_PEER_ID
  7349. * Bits 31:16
  7350. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  7351. * address, so for rx frames marked for rx --> tx forwarding, the
  7352. * host can determine from the HW peer ID provided as meta-data with
  7353. * the rx frame which peer the frame is supposed to be forwarded to.
  7354. * Value: ID used by the MAC HW to identify the peer
  7355. * - AST_HASH_VALUE
  7356. * Bits 15:0
  7357. * Purpose: Indicates AST Hash value is required for the TCL AST index
  7358. * override feature.
  7359. * - NEXT_HOP
  7360. * Bit 16
  7361. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  7362. * (Wireless Distribution System).
  7363. */
  7364. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  7365. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  7366. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  7367. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  7368. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  7369. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  7370. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  7371. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  7372. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  7373. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  7374. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  7375. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  7376. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  7377. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  7378. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  7379. do { \
  7380. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  7381. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  7382. } while (0)
  7383. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  7384. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  7385. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  7386. do { \
  7387. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  7388. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  7389. } while (0)
  7390. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  7391. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  7392. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  7393. do { \
  7394. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  7395. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  7396. } while (0)
  7397. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  7398. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  7399. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  7400. do { \
  7401. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  7402. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  7403. } while (0)
  7404. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  7405. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  7406. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  7407. do { \
  7408. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  7409. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  7410. } while (0)
  7411. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  7412. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  7413. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  7414. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  7415. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  7416. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  7417. #define HTT_RX_PEER_MAP_V2_BYTES 32
  7418. /**
  7419. * @brief target -> host rx peer unmap V2 message definition
  7420. *
  7421. *
  7422. * The following diagram shows the format of the rx peer unmap message sent
  7423. * from the target to the host.
  7424. *
  7425. * |31 24|23 16|15 8|7 0|
  7426. * |-----------------------------------------------------------------------|
  7427. * | SW peer ID | VDEV ID | msg type |
  7428. * |-----------------------------------------------------------------------|
  7429. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  7430. * |-----------------------------------------------------------------------|
  7431. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  7432. * |-----------------------------------------------------------------------|
  7433. * | Peer Delete Duration |
  7434. * |-----------------------------------------------------------------------|
  7435. * | Reserved_0 |
  7436. * |-----------------------------------------------------------------------|
  7437. * | Reserved_1 |
  7438. * |-----------------------------------------------------------------------|
  7439. * | Reserved_2 |
  7440. * |-----------------------------------------------------------------------|
  7441. *
  7442. *
  7443. * The following field definitions describe the format of the rx peer unmap
  7444. * messages sent from the target to the host.
  7445. * - MSG_TYPE
  7446. * Bits 7:0
  7447. * Purpose: identifies this as an rx peer unmap v2 message
  7448. * Value: peer unmap v2 -> 0x1f
  7449. * - VDEV_ID
  7450. * Bits 15:8
  7451. * Purpose: Indicates which virtual device the peer is associated
  7452. * with.
  7453. * Value: vdev ID (used in the host to look up the vdev object)
  7454. * - SW_PEER_ID
  7455. * Bits 31:16
  7456. * Purpose: The peer ID (index) that WAL is freeing
  7457. * Value: (rx) peer ID
  7458. * - MAC_ADDR_L32
  7459. * Bits 31:0
  7460. * Purpose: Identifies which peer node the peer ID is for.
  7461. * Value: lower 4 bytes of peer node's MAC address
  7462. * - MAC_ADDR_U16
  7463. * Bits 15:0
  7464. * Purpose: Identifies which peer node the peer ID is for.
  7465. * Value: upper 2 bytes of peer node's MAC address
  7466. * - NEXT_HOP
  7467. * Bits 16
  7468. * Purpose: Bit indicates next_hop AST entry used for WDS
  7469. * (Wireless Distribution System).
  7470. * - PEER_DELETE_DURATION
  7471. * Bits 31:0
  7472. * Purpose: Time taken to delete peer, in msec,
  7473. * Used for monitoring / debugging PEER delete response delay
  7474. */
  7475. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  7476. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  7477. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  7478. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  7479. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  7480. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  7481. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  7482. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  7483. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  7484. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  7485. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  7486. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  7487. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  7488. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  7489. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  7490. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  7491. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  7492. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  7493. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  7494. do { \
  7495. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  7496. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  7497. } while (0)
  7498. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  7499. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  7500. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  7501. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  7502. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  7503. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  7504. /**
  7505. * @brief target -> host message specifying security parameters
  7506. *
  7507. * @details
  7508. * The following diagram shows the format of the security specification
  7509. * message sent from the target to the host.
  7510. * This security specification message tells the host whether a PN check is
  7511. * necessary on rx data frames, and if so, how large the PN counter is.
  7512. * This message also tells the host about the security processing to apply
  7513. * to defragmented rx frames - specifically, whether a Message Integrity
  7514. * Check is required, and the Michael key to use.
  7515. *
  7516. * |31 24|23 16|15|14 8|7 0|
  7517. * |-----------------------------------------------------------------------|
  7518. * | peer ID | U| security type | msg type |
  7519. * |-----------------------------------------------------------------------|
  7520. * | Michael Key K0 |
  7521. * |-----------------------------------------------------------------------|
  7522. * | Michael Key K1 |
  7523. * |-----------------------------------------------------------------------|
  7524. * | WAPI RSC Low0 |
  7525. * |-----------------------------------------------------------------------|
  7526. * | WAPI RSC Low1 |
  7527. * |-----------------------------------------------------------------------|
  7528. * | WAPI RSC Hi0 |
  7529. * |-----------------------------------------------------------------------|
  7530. * | WAPI RSC Hi1 |
  7531. * |-----------------------------------------------------------------------|
  7532. *
  7533. * The following field definitions describe the format of the security
  7534. * indication message sent from the target to the host.
  7535. * - MSG_TYPE
  7536. * Bits 7:0
  7537. * Purpose: identifies this as a security specification message
  7538. * Value: 0xb
  7539. * - SEC_TYPE
  7540. * Bits 14:8
  7541. * Purpose: specifies which type of security applies to the peer
  7542. * Value: htt_sec_type enum value
  7543. * - UNICAST
  7544. * Bit 15
  7545. * Purpose: whether this security is applied to unicast or multicast data
  7546. * Value: 1 -> unicast, 0 -> multicast
  7547. * - PEER_ID
  7548. * Bits 31:16
  7549. * Purpose: The ID number for the peer the security specification is for
  7550. * Value: peer ID
  7551. * - MICHAEL_KEY_K0
  7552. * Bits 31:0
  7553. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  7554. * Value: Michael Key K0 (if security type is TKIP)
  7555. * - MICHAEL_KEY_K1
  7556. * Bits 31:0
  7557. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  7558. * Value: Michael Key K1 (if security type is TKIP)
  7559. * - WAPI_RSC_LOW0
  7560. * Bits 31:0
  7561. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  7562. * Value: WAPI RSC Low0 (if security type is WAPI)
  7563. * - WAPI_RSC_LOW1
  7564. * Bits 31:0
  7565. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  7566. * Value: WAPI RSC Low1 (if security type is WAPI)
  7567. * - WAPI_RSC_HI0
  7568. * Bits 31:0
  7569. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  7570. * Value: WAPI RSC Hi0 (if security type is WAPI)
  7571. * - WAPI_RSC_HI1
  7572. * Bits 31:0
  7573. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  7574. * Value: WAPI RSC Hi1 (if security type is WAPI)
  7575. */
  7576. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  7577. #define HTT_SEC_IND_SEC_TYPE_S 8
  7578. #define HTT_SEC_IND_UNICAST_M 0x00008000
  7579. #define HTT_SEC_IND_UNICAST_S 15
  7580. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  7581. #define HTT_SEC_IND_PEER_ID_S 16
  7582. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  7583. do { \
  7584. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  7585. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  7586. } while (0)
  7587. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  7588. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  7589. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  7590. do { \
  7591. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  7592. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  7593. } while (0)
  7594. #define HTT_SEC_IND_UNICAST_GET(word) \
  7595. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  7596. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  7597. do { \
  7598. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  7599. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  7600. } while (0)
  7601. #define HTT_SEC_IND_PEER_ID_GET(word) \
  7602. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  7603. #define HTT_SEC_IND_BYTES 28
  7604. /**
  7605. * @brief target -> host rx ADDBA / DELBA message definitions
  7606. *
  7607. * @details
  7608. * The following diagram shows the format of the rx ADDBA message sent
  7609. * from the target to the host:
  7610. *
  7611. * |31 20|19 16|15 8|7 0|
  7612. * |---------------------------------------------------------------------|
  7613. * | peer ID | TID | window size | msg type |
  7614. * |---------------------------------------------------------------------|
  7615. *
  7616. * The following diagram shows the format of the rx DELBA message sent
  7617. * from the target to the host:
  7618. *
  7619. * |31 20|19 16|15 10|9 8|7 0|
  7620. * |---------------------------------------------------------------------|
  7621. * | peer ID | TID | reserved | IR| msg type |
  7622. * |---------------------------------------------------------------------|
  7623. *
  7624. * The following field definitions describe the format of the rx ADDBA
  7625. * and DELBA messages sent from the target to the host.
  7626. * - MSG_TYPE
  7627. * Bits 7:0
  7628. * Purpose: identifies this as an rx ADDBA or DELBA message
  7629. * Value: ADDBA -> 0x5, DELBA -> 0x6
  7630. * - IR (initiator / recipient)
  7631. * Bits 9:8 (DELBA only)
  7632. * Purpose: specify whether the DELBA handshake was initiated by the
  7633. * local STA/AP, or by the peer STA/AP
  7634. * Value:
  7635. * 0 - unspecified
  7636. * 1 - initiator (a.k.a. originator)
  7637. * 2 - recipient (a.k.a. responder)
  7638. * 3 - unused / reserved
  7639. * - WIN_SIZE
  7640. * Bits 15:8 (ADDBA only)
  7641. * Purpose: Specifies the length of the block ack window (max = 64).
  7642. * Value:
  7643. * block ack window length specified by the received ADDBA
  7644. * management message.
  7645. * - TID
  7646. * Bits 19:16
  7647. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  7648. * Value:
  7649. * TID specified by the received ADDBA or DELBA management message.
  7650. * - PEER_ID
  7651. * Bits 31:20
  7652. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  7653. * Value:
  7654. * ID (hash value) used by the host for fast, direct lookup of
  7655. * host SW peer info, including rx reorder states.
  7656. */
  7657. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  7658. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  7659. #define HTT_RX_ADDBA_TID_M 0xf0000
  7660. #define HTT_RX_ADDBA_TID_S 16
  7661. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  7662. #define HTT_RX_ADDBA_PEER_ID_S 20
  7663. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  7664. do { \
  7665. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  7666. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  7667. } while (0)
  7668. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  7669. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  7670. #define HTT_RX_ADDBA_TID_SET(word, value) \
  7671. do { \
  7672. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  7673. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  7674. } while (0)
  7675. #define HTT_RX_ADDBA_TID_GET(word) \
  7676. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  7677. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  7678. do { \
  7679. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  7680. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  7681. } while (0)
  7682. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  7683. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  7684. #define HTT_RX_ADDBA_BYTES 4
  7685. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  7686. #define HTT_RX_DELBA_INITIATOR_S 8
  7687. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  7688. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  7689. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  7690. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  7691. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  7692. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  7693. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  7694. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  7695. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  7696. do { \
  7697. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  7698. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  7699. } while (0)
  7700. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  7701. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  7702. #define HTT_RX_DELBA_BYTES 4
  7703. /**
  7704. * @brief tx queue group information element definition
  7705. *
  7706. * @details
  7707. * The following diagram shows the format of the tx queue group
  7708. * information element, which can be included in target --> host
  7709. * messages to specify the number of tx "credits" (tx descriptors
  7710. * for LL, or tx buffers for HL) available to a particular group
  7711. * of host-side tx queues, and which host-side tx queues belong to
  7712. * the group.
  7713. *
  7714. * |31|30 24|23 16|15|14|13 0|
  7715. * |------------------------------------------------------------------------|
  7716. * | X| reserved | tx queue grp ID | A| S| credit count |
  7717. * |------------------------------------------------------------------------|
  7718. * | vdev ID mask | AC mask |
  7719. * |------------------------------------------------------------------------|
  7720. *
  7721. * The following definitions describe the fields within the tx queue group
  7722. * information element:
  7723. * - credit_count
  7724. * Bits 13:1
  7725. * Purpose: specify how many tx credits are available to the tx queue group
  7726. * Value: An absolute or relative, positive or negative credit value
  7727. * The 'A' bit specifies whether the value is absolute or relative.
  7728. * The 'S' bit specifies whether the value is positive or negative.
  7729. * A negative value can only be relative, not absolute.
  7730. * An absolute value replaces any prior credit value the host has for
  7731. * the tx queue group in question.
  7732. * A relative value is added to the prior credit value the host has for
  7733. * the tx queue group in question.
  7734. * - sign
  7735. * Bit 14
  7736. * Purpose: specify whether the credit count is positive or negative
  7737. * Value: 0 -> positive, 1 -> negative
  7738. * - absolute
  7739. * Bit 15
  7740. * Purpose: specify whether the credit count is absolute or relative
  7741. * Value: 0 -> relative, 1 -> absolute
  7742. * - txq_group_id
  7743. * Bits 23:16
  7744. * Purpose: indicate which tx queue group's credit and/or membership are
  7745. * being specified
  7746. * Value: 0 to max_tx_queue_groups-1
  7747. * - reserved
  7748. * Bits 30:16
  7749. * Value: 0x0
  7750. * - eXtension
  7751. * Bit 31
  7752. * Purpose: specify whether another tx queue group info element follows
  7753. * Value: 0 -> no more tx queue group information elements
  7754. * 1 -> another tx queue group information element immediately follows
  7755. * - ac_mask
  7756. * Bits 15:0
  7757. * Purpose: specify which Access Categories belong to the tx queue group
  7758. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  7759. * the tx queue group.
  7760. * The AC bit-mask values are obtained by left-shifting by the
  7761. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  7762. * - vdev_id_mask
  7763. * Bits 31:16
  7764. * Purpose: specify which vdev's tx queues belong to the tx queue group
  7765. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  7766. * belong to the tx queue group.
  7767. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  7768. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  7769. */
  7770. PREPACK struct htt_txq_group {
  7771. A_UINT32
  7772. credit_count: 14,
  7773. sign: 1,
  7774. absolute: 1,
  7775. tx_queue_group_id: 8,
  7776. reserved0: 7,
  7777. extension: 1;
  7778. A_UINT32
  7779. ac_mask: 16,
  7780. vdev_id_mask: 16;
  7781. } POSTPACK;
  7782. /* first word */
  7783. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  7784. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  7785. #define HTT_TXQ_GROUP_SIGN_S 14
  7786. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  7787. #define HTT_TXQ_GROUP_ABS_S 15
  7788. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  7789. #define HTT_TXQ_GROUP_ID_S 16
  7790. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  7791. #define HTT_TXQ_GROUP_EXT_S 31
  7792. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  7793. /* second word */
  7794. #define HTT_TXQ_GROUP_AC_MASK_S 0
  7795. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  7796. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  7797. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  7798. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  7799. do { \
  7800. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  7801. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  7802. } while (0)
  7803. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  7804. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  7805. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  7806. do { \
  7807. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  7808. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  7809. } while (0)
  7810. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  7811. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  7812. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  7813. do { \
  7814. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  7815. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  7816. } while (0)
  7817. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  7818. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  7819. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  7820. do { \
  7821. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  7822. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  7823. } while (0)
  7824. #define HTT_TXQ_GROUP_ID_GET(_info) \
  7825. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  7826. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  7827. do { \
  7828. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  7829. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  7830. } while (0)
  7831. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  7832. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  7833. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  7834. do { \
  7835. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  7836. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  7837. } while (0)
  7838. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  7839. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  7840. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  7841. do { \
  7842. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  7843. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  7844. } while (0)
  7845. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  7846. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  7847. /**
  7848. * @brief target -> host TX completion indication message definition
  7849. *
  7850. * @details
  7851. * The following diagram shows the format of the TX completion indication sent
  7852. * from the target to the host
  7853. *
  7854. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  7855. * |-------------------------------------------------------------------|
  7856. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  7857. * |-------------------------------------------------------------------|
  7858. * payload:| MSDU1 ID | MSDU0 ID |
  7859. * |-------------------------------------------------------------------|
  7860. * : MSDU3 ID | MSDU2 ID :
  7861. * |-------------------------------------------------------------------|
  7862. * | struct htt_tx_compl_ind_append_retries |
  7863. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7864. * | struct htt_tx_compl_ind_append_tx_tstamp |
  7865. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7866. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  7867. * |-------------------------------------------------------------------|
  7868. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  7869. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7870. * | MSDU0 tx_tsf64_low |
  7871. * |-------------------------------------------------------------------|
  7872. * | MSDU0 tx_tsf64_high |
  7873. * |-------------------------------------------------------------------|
  7874. * | MSDU1 tx_tsf64_low |
  7875. * |-------------------------------------------------------------------|
  7876. * | MSDU1 tx_tsf64_high |
  7877. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7878. * | phy_timestamp |
  7879. * |-------------------------------------------------------------------|
  7880. * | rate specs (see below) |
  7881. * |-------------------------------------------------------------------|
  7882. * | seqctrl | framectrl |
  7883. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7884. * Where:
  7885. * A0 = append (a.k.a. append0)
  7886. * A1 = append1
  7887. * TP = MSDU tx power presence
  7888. * A2 = append2
  7889. * A3 = append3
  7890. * A4 = append4
  7891. *
  7892. * The following field definitions describe the format of the TX completion
  7893. * indication sent from the target to the host
  7894. * Header fields:
  7895. * - msg_type
  7896. * Bits 7:0
  7897. * Purpose: identifies this as HTT TX completion indication
  7898. * Value: 0x7
  7899. * - status
  7900. * Bits 10:8
  7901. * Purpose: the TX completion status of payload fragmentations descriptors
  7902. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  7903. * - tid
  7904. * Bits 14:11
  7905. * Purpose: the tid associated with those fragmentation descriptors. It is
  7906. * valid or not, depending on the tid_invalid bit.
  7907. * Value: 0 to 15
  7908. * - tid_invalid
  7909. * Bits 15:15
  7910. * Purpose: this bit indicates whether the tid field is valid or not
  7911. * Value: 0 indicates valid; 1 indicates invalid
  7912. * - num
  7913. * Bits 23:16
  7914. * Purpose: the number of payload in this indication
  7915. * Value: 1 to 255
  7916. * - append (a.k.a. append0)
  7917. * Bits 24:24
  7918. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  7919. * the number of tx retries for one MSDU at the end of this message
  7920. * Value: 0 indicates no appending; 1 indicates appending
  7921. * - append1
  7922. * Bits 25:25
  7923. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  7924. * contains the timestamp info for each TX msdu id in payload.
  7925. * The order of the timestamps matches the order of the MSDU IDs.
  7926. * Note that a big-endian host needs to account for the reordering
  7927. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  7928. * conversion) when determining which tx timestamp corresponds to
  7929. * which MSDU ID.
  7930. * Value: 0 indicates no appending; 1 indicates appending
  7931. * - msdu_tx_power_presence
  7932. * Bits 26:26
  7933. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  7934. * for each MSDU referenced by the TX_COMPL_IND message.
  7935. * The tx power is reported in 0.5 dBm units.
  7936. * The order of the per-MSDU tx power reports matches the order
  7937. * of the MSDU IDs.
  7938. * Note that a big-endian host needs to account for the reordering
  7939. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  7940. * conversion) when determining which Tx Power corresponds to
  7941. * which MSDU ID.
  7942. * Value: 0 indicates MSDU tx power reports are not appended,
  7943. * 1 indicates MSDU tx power reports are appended
  7944. * - append2
  7945. * Bits 27:27
  7946. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  7947. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  7948. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  7949. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  7950. * for each MSDU, for convenience.
  7951. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  7952. * this append2 bit is set).
  7953. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  7954. * dB above the noise floor.
  7955. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  7956. * 1 indicates MSDU ACK RSSI values are appended.
  7957. * - append3
  7958. * Bits 28:28
  7959. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  7960. * contains the tx tsf info based on wlan global TSF for
  7961. * each TX msdu id in payload.
  7962. * The order of the tx tsf matches the order of the MSDU IDs.
  7963. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  7964. * values to indicate the the lower 32 bits and higher 32 bits of
  7965. * the tx tsf.
  7966. * The tx_tsf64 here represents the time MSDU was acked and the
  7967. * tx_tsf64 has microseconds units.
  7968. * Value: 0 indicates no appending; 1 indicates appending
  7969. * - append4
  7970. * Bits 29:29
  7971. * Purpose: Indicate whether data frame control fields and fields required
  7972. * for radio tap header are appended for each MSDU in TX_COMP_IND
  7973. * message. The order of the this message matches the order of
  7974. * the MSDU IDs.
  7975. * Value: 0 indicates frame control fields and fields required for
  7976. * radio tap header values are not appended,
  7977. * 1 indicates frame control fields and fields required for
  7978. * radio tap header values are appended.
  7979. * Payload fields:
  7980. * - hmsdu_id
  7981. * Bits 15:0
  7982. * Purpose: this ID is used to track the Tx buffer in host
  7983. * Value: 0 to "size of host MSDU descriptor pool - 1"
  7984. */
  7985. PREPACK struct htt_tx_data_hdr_information {
  7986. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  7987. A_UINT32 /* word 1 */
  7988. /* preamble:
  7989. * 0-OFDM,
  7990. * 1-CCk,
  7991. * 2-HT,
  7992. * 3-VHT
  7993. */
  7994. preamble: 2, /* [1:0] */
  7995. /* mcs:
  7996. * In case of HT preamble interpret
  7997. * MCS along with NSS.
  7998. * Valid values for HT are 0 to 7.
  7999. * HT mcs 0 with NSS 2 is mcs 8.
  8000. * Valid values for VHT are 0 to 9.
  8001. */
  8002. mcs: 4, /* [5:2] */
  8003. /* rate:
  8004. * This is applicable only for
  8005. * CCK and OFDM preamble type
  8006. * rate 0: OFDM 48 Mbps,
  8007. * 1: OFDM 24 Mbps,
  8008. * 2: OFDM 12 Mbps
  8009. * 3: OFDM 6 Mbps
  8010. * 4: OFDM 54 Mbps
  8011. * 5: OFDM 36 Mbps
  8012. * 6: OFDM 18 Mbps
  8013. * 7: OFDM 9 Mbps
  8014. * rate 0: CCK 11 Mbps Long
  8015. * 1: CCK 5.5 Mbps Long
  8016. * 2: CCK 2 Mbps Long
  8017. * 3: CCK 1 Mbps Long
  8018. * 4: CCK 11 Mbps Short
  8019. * 5: CCK 5.5 Mbps Short
  8020. * 6: CCK 2 Mbps Short
  8021. */
  8022. rate : 3, /* [ 8: 6] */
  8023. rssi : 8, /* [16: 9] units=dBm */
  8024. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  8025. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  8026. stbc : 1, /* [22] */
  8027. sgi : 1, /* [23] */
  8028. ldpc : 1, /* [24] */
  8029. beamformed: 1, /* [25] */
  8030. reserved_1: 6; /* [31:26] */
  8031. A_UINT32 /* word 2 */
  8032. framectrl:16, /* [15: 0] */
  8033. seqno:16; /* [31:16] */
  8034. } POSTPACK;
  8035. #define HTT_TX_COMPL_IND_STATUS_S 8
  8036. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  8037. #define HTT_TX_COMPL_IND_TID_S 11
  8038. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  8039. #define HTT_TX_COMPL_IND_TID_INV_S 15
  8040. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  8041. #define HTT_TX_COMPL_IND_NUM_S 16
  8042. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  8043. #define HTT_TX_COMPL_IND_APPEND_S 24
  8044. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  8045. #define HTT_TX_COMPL_IND_APPEND1_S 25
  8046. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  8047. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  8048. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  8049. #define HTT_TX_COMPL_IND_APPEND2_S 27
  8050. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  8051. #define HTT_TX_COMPL_IND_APPEND3_S 28
  8052. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  8053. #define HTT_TX_COMPL_IND_APPEND4_S 29
  8054. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  8055. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  8056. do { \
  8057. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  8058. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  8059. } while (0)
  8060. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  8061. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  8062. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  8063. do { \
  8064. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  8065. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  8066. } while (0)
  8067. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  8068. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  8069. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  8070. do { \
  8071. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  8072. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  8073. } while (0)
  8074. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  8075. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  8076. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  8077. do { \
  8078. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  8079. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  8080. } while (0)
  8081. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  8082. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  8083. HTT_TX_COMPL_IND_TID_INV_S)
  8084. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  8085. do { \
  8086. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  8087. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  8088. } while (0)
  8089. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  8090. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  8091. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  8092. do { \
  8093. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  8094. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  8095. } while (0)
  8096. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  8097. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  8098. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  8099. do { \
  8100. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  8101. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  8102. } while (0)
  8103. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  8104. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  8105. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  8106. do { \
  8107. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  8108. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  8109. } while (0)
  8110. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  8111. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  8112. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  8113. do { \
  8114. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  8115. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  8116. } while (0)
  8117. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  8118. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  8119. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  8120. do { \
  8121. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  8122. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  8123. } while (0)
  8124. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  8125. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  8126. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  8127. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  8128. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  8129. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  8130. #define HTT_TX_COMPL_IND_STAT_OK 0
  8131. /* DISCARD:
  8132. * current meaning:
  8133. * MSDUs were queued for transmission but filtered by HW or SW
  8134. * without any over the air attempts
  8135. * legacy meaning (HL Rome):
  8136. * MSDUs were discarded by the target FW without any over the air
  8137. * attempts due to lack of space
  8138. */
  8139. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  8140. /* NO_ACK:
  8141. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  8142. */
  8143. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  8144. /* POSTPONE:
  8145. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  8146. * be downloaded again later (in the appropriate order), when they are
  8147. * deliverable.
  8148. */
  8149. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  8150. /*
  8151. * The PEER_DEL tx completion status is used for HL cases
  8152. * where the peer the frame is for has been deleted.
  8153. * The host has already discarded its copy of the frame, but
  8154. * it still needs the tx completion to restore its credit.
  8155. */
  8156. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  8157. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  8158. #define HTT_TX_COMPL_IND_STAT_DROP 5
  8159. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  8160. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  8161. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  8162. PREPACK struct htt_tx_compl_ind_base {
  8163. A_UINT32 hdr;
  8164. A_UINT16 payload[1/*or more*/];
  8165. } POSTPACK;
  8166. PREPACK struct htt_tx_compl_ind_append_retries {
  8167. A_UINT16 msdu_id;
  8168. A_UINT8 tx_retries;
  8169. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  8170. 0: this is the last append_retries struct */
  8171. } POSTPACK;
  8172. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  8173. A_UINT32 timestamp[1/*or more*/];
  8174. } POSTPACK;
  8175. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  8176. A_UINT32 tx_tsf64_low;
  8177. A_UINT32 tx_tsf64_high;
  8178. } POSTPACK;
  8179. /* htt_tx_data_hdr_information payload extension fields: */
  8180. /* DWORD zero */
  8181. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  8182. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  8183. /* DWORD one */
  8184. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  8185. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  8186. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  8187. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  8188. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  8189. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  8190. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  8191. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  8192. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  8193. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  8194. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  8195. #define HTT_FW_TX_DATA_HDR_BW_S 19
  8196. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  8197. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  8198. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  8199. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  8200. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  8201. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  8202. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  8203. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  8204. /* DWORD two */
  8205. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  8206. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  8207. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  8208. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  8209. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  8210. do { \
  8211. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  8212. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  8213. } while (0)
  8214. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  8215. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  8216. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  8217. do { \
  8218. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  8219. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  8220. } while (0)
  8221. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  8222. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  8223. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  8224. do { \
  8225. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  8226. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  8227. } while (0)
  8228. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  8229. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  8230. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  8231. do { \
  8232. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  8233. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  8234. } while (0)
  8235. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  8236. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  8237. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  8238. do { \
  8239. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  8240. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  8241. } while (0)
  8242. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  8243. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  8244. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  8245. do { \
  8246. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  8247. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  8248. } while (0)
  8249. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  8250. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  8251. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  8252. do { \
  8253. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  8254. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  8255. } while (0)
  8256. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  8257. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  8258. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  8259. do { \
  8260. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  8261. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  8262. } while (0)
  8263. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  8264. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  8265. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  8266. do { \
  8267. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  8268. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  8269. } while (0)
  8270. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  8271. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  8272. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  8273. do { \
  8274. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  8275. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  8276. } while (0)
  8277. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  8278. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  8279. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  8280. do { \
  8281. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  8282. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  8283. } while (0)
  8284. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  8285. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  8286. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  8287. do { \
  8288. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  8289. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  8290. } while (0)
  8291. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  8292. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  8293. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  8294. do { \
  8295. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  8296. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  8297. } while (0)
  8298. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  8299. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  8300. /**
  8301. * @brief target -> host rate-control update indication message
  8302. *
  8303. * @details
  8304. * The following diagram shows the format of the RC Update message
  8305. * sent from the target to the host, while processing the tx-completion
  8306. * of a transmitted PPDU.
  8307. *
  8308. * |31 24|23 16|15 8|7 0|
  8309. * |-------------------------------------------------------------|
  8310. * | peer ID | vdev ID | msg_type |
  8311. * |-------------------------------------------------------------|
  8312. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  8313. * |-------------------------------------------------------------|
  8314. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  8315. * |-------------------------------------------------------------|
  8316. * | : |
  8317. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  8318. * | : |
  8319. * |-------------------------------------------------------------|
  8320. * | : |
  8321. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  8322. * | : |
  8323. * |-------------------------------------------------------------|
  8324. * : :
  8325. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  8326. *
  8327. */
  8328. typedef struct {
  8329. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  8330. A_UINT32 rate_code_flags;
  8331. A_UINT32 flags; /* Encodes information such as excessive
  8332. retransmission, aggregate, some info
  8333. from .11 frame control,
  8334. STBC, LDPC, (SGI and Tx Chain Mask
  8335. are encoded in ptx_rc->flags field),
  8336. AMPDU truncation (BT/time based etc.),
  8337. RTS/CTS attempt */
  8338. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  8339. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  8340. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  8341. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  8342. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  8343. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  8344. } HTT_RC_TX_DONE_PARAMS;
  8345. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  8346. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  8347. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  8348. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  8349. #define HTT_RC_UPDATE_VDEVID_S 8
  8350. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  8351. #define HTT_RC_UPDATE_PEERID_S 16
  8352. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  8353. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  8354. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  8355. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  8356. do { \
  8357. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  8358. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  8359. } while (0)
  8360. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  8361. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  8362. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  8363. do { \
  8364. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  8365. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  8366. } while (0)
  8367. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  8368. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  8369. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  8370. do { \
  8371. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  8372. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  8373. } while (0)
  8374. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  8375. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  8376. /**
  8377. * @brief target -> host rx fragment indication message definition
  8378. *
  8379. * @details
  8380. * The following field definitions describe the format of the rx fragment
  8381. * indication message sent from the target to the host.
  8382. * The rx fragment indication message shares the format of the
  8383. * rx indication message, but not all fields from the rx indication message
  8384. * are relevant to the rx fragment indication message.
  8385. *
  8386. *
  8387. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  8388. * |-----------+-------------------+---------------------+-------------|
  8389. * | peer ID | |FV| ext TID | msg type |
  8390. * |-------------------------------------------------------------------|
  8391. * | | flush | flush |
  8392. * | | end | start |
  8393. * | | seq num | seq num |
  8394. * |-------------------------------------------------------------------|
  8395. * | reserved | FW rx desc bytes |
  8396. * |-------------------------------------------------------------------|
  8397. * | | FW MSDU Rx |
  8398. * | | desc B0 |
  8399. * |-------------------------------------------------------------------|
  8400. * Header fields:
  8401. * - MSG_TYPE
  8402. * Bits 7:0
  8403. * Purpose: identifies this as an rx fragment indication message
  8404. * Value: 0xa
  8405. * - EXT_TID
  8406. * Bits 12:8
  8407. * Purpose: identify the traffic ID of the rx data, including
  8408. * special "extended" TID values for multicast, broadcast, and
  8409. * non-QoS data frames
  8410. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  8411. * - FLUSH_VALID (FV)
  8412. * Bit 13
  8413. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  8414. * is valid
  8415. * Value:
  8416. * 1 -> flush IE is valid and needs to be processed
  8417. * 0 -> flush IE is not valid and should be ignored
  8418. * - PEER_ID
  8419. * Bits 31:16
  8420. * Purpose: Identify, by ID, which peer sent the rx data
  8421. * Value: ID of the peer who sent the rx data
  8422. * - FLUSH_SEQ_NUM_START
  8423. * Bits 5:0
  8424. * Purpose: Indicate the start of a series of MPDUs to flush
  8425. * Not all MPDUs within this series are necessarily valid - the host
  8426. * must check each sequence number within this range to see if the
  8427. * corresponding MPDU is actually present.
  8428. * This field is only valid if the FV bit is set.
  8429. * Value:
  8430. * The sequence number for the first MPDUs to check to flush.
  8431. * The sequence number is masked by 0x3f.
  8432. * - FLUSH_SEQ_NUM_END
  8433. * Bits 11:6
  8434. * Purpose: Indicate the end of a series of MPDUs to flush
  8435. * Value:
  8436. * The sequence number one larger than the sequence number of the
  8437. * last MPDU to check to flush.
  8438. * The sequence number is masked by 0x3f.
  8439. * Not all MPDUs within this series are necessarily valid - the host
  8440. * must check each sequence number within this range to see if the
  8441. * corresponding MPDU is actually present.
  8442. * This field is only valid if the FV bit is set.
  8443. * Rx descriptor fields:
  8444. * - FW_RX_DESC_BYTES
  8445. * Bits 15:0
  8446. * Purpose: Indicate how many bytes in the Rx indication are used for
  8447. * FW Rx descriptors
  8448. * Value: 1
  8449. */
  8450. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  8451. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  8452. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  8453. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  8454. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  8455. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  8456. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  8457. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  8458. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  8459. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  8460. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  8461. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  8462. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  8463. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  8464. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  8465. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  8466. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  8467. #define HTT_RX_FRAG_IND_BYTES \
  8468. (4 /* msg hdr */ + \
  8469. 4 /* flush spec */ + \
  8470. 4 /* (unused) FW rx desc bytes spec */ + \
  8471. 4 /* FW rx desc */)
  8472. /**
  8473. * @brief target -> host test message definition
  8474. *
  8475. * @details
  8476. * The following field definitions describe the format of the test
  8477. * message sent from the target to the host.
  8478. * The message consists of a 4-octet header, followed by a variable
  8479. * number of 32-bit integer values, followed by a variable number
  8480. * of 8-bit character values.
  8481. *
  8482. * |31 16|15 8|7 0|
  8483. * |-----------------------------------------------------------|
  8484. * | num chars | num ints | msg type |
  8485. * |-----------------------------------------------------------|
  8486. * | int 0 |
  8487. * |-----------------------------------------------------------|
  8488. * | int 1 |
  8489. * |-----------------------------------------------------------|
  8490. * | ... |
  8491. * |-----------------------------------------------------------|
  8492. * | char 3 | char 2 | char 1 | char 0 |
  8493. * |-----------------------------------------------------------|
  8494. * | | | ... | char 4 |
  8495. * |-----------------------------------------------------------|
  8496. * - MSG_TYPE
  8497. * Bits 7:0
  8498. * Purpose: identifies this as a test message
  8499. * Value: HTT_MSG_TYPE_TEST
  8500. * - NUM_INTS
  8501. * Bits 15:8
  8502. * Purpose: indicate how many 32-bit integers follow the message header
  8503. * - NUM_CHARS
  8504. * Bits 31:16
  8505. * Purpose: indicate how many 8-bit charaters follow the series of integers
  8506. */
  8507. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  8508. #define HTT_RX_TEST_NUM_INTS_S 8
  8509. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  8510. #define HTT_RX_TEST_NUM_CHARS_S 16
  8511. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  8512. do { \
  8513. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  8514. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  8515. } while (0)
  8516. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  8517. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  8518. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  8519. do { \
  8520. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  8521. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  8522. } while (0)
  8523. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  8524. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  8525. /**
  8526. * @brief target -> host packet log message
  8527. *
  8528. * @details
  8529. * The following field definitions describe the format of the packet log
  8530. * message sent from the target to the host.
  8531. * The message consists of a 4-octet header,followed by a variable number
  8532. * of 32-bit character values.
  8533. *
  8534. * |31 16|15 12|11 10|9 8|7 0|
  8535. * |------------------------------------------------------------------|
  8536. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  8537. * |------------------------------------------------------------------|
  8538. * | payload |
  8539. * |------------------------------------------------------------------|
  8540. * - MSG_TYPE
  8541. * Bits 7:0
  8542. * Purpose: identifies this as a pktlog message
  8543. * Value: HTT_T2H_MSG_TYPE_PKTLOG
  8544. * - mac_id
  8545. * Bits 9:8
  8546. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  8547. * Value: 0-3
  8548. * - pdev_id
  8549. * Bits 11:10
  8550. * Purpose: pdev_id
  8551. * Value: 0-3
  8552. * 0 (for rings at SOC level),
  8553. * 1/2/3 PDEV -> 0/1/2
  8554. * - payload_size
  8555. * Bits 31:16
  8556. * Purpose: explicitly specify the payload size
  8557. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  8558. */
  8559. PREPACK struct htt_pktlog_msg {
  8560. A_UINT32 header;
  8561. A_UINT32 payload[1/* or more */];
  8562. } POSTPACK;
  8563. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  8564. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  8565. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  8566. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  8567. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  8568. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  8569. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  8570. do { \
  8571. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  8572. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  8573. } while (0)
  8574. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  8575. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  8576. HTT_T2H_PKTLOG_MAC_ID_S)
  8577. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  8578. do { \
  8579. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  8580. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  8581. } while (0)
  8582. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  8583. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  8584. HTT_T2H_PKTLOG_PDEV_ID_S)
  8585. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  8586. do { \
  8587. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  8588. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  8589. } while (0)
  8590. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  8591. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  8592. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  8593. /*
  8594. * Rx reorder statistics
  8595. * NB: all the fields must be defined in 4 octets size.
  8596. */
  8597. struct rx_reorder_stats {
  8598. /* Non QoS MPDUs received */
  8599. A_UINT32 deliver_non_qos;
  8600. /* MPDUs received in-order */
  8601. A_UINT32 deliver_in_order;
  8602. /* Flush due to reorder timer expired */
  8603. A_UINT32 deliver_flush_timeout;
  8604. /* Flush due to move out of window */
  8605. A_UINT32 deliver_flush_oow;
  8606. /* Flush due to DELBA */
  8607. A_UINT32 deliver_flush_delba;
  8608. /* MPDUs dropped due to FCS error */
  8609. A_UINT32 fcs_error;
  8610. /* MPDUs dropped due to monitor mode non-data packet */
  8611. A_UINT32 mgmt_ctrl;
  8612. /* Unicast-data MPDUs dropped due to invalid peer */
  8613. A_UINT32 invalid_peer;
  8614. /* MPDUs dropped due to duplication (non aggregation) */
  8615. A_UINT32 dup_non_aggr;
  8616. /* MPDUs dropped due to processed before */
  8617. A_UINT32 dup_past;
  8618. /* MPDUs dropped due to duplicate in reorder queue */
  8619. A_UINT32 dup_in_reorder;
  8620. /* Reorder timeout happened */
  8621. A_UINT32 reorder_timeout;
  8622. /* invalid bar ssn */
  8623. A_UINT32 invalid_bar_ssn;
  8624. /* reorder reset due to bar ssn */
  8625. A_UINT32 ssn_reset;
  8626. /* Flush due to delete peer */
  8627. A_UINT32 deliver_flush_delpeer;
  8628. /* Flush due to offload*/
  8629. A_UINT32 deliver_flush_offload;
  8630. /* Flush due to out of buffer*/
  8631. A_UINT32 deliver_flush_oob;
  8632. /* MPDUs dropped due to PN check fail */
  8633. A_UINT32 pn_fail;
  8634. /* MPDUs dropped due to unable to allocate memory */
  8635. A_UINT32 store_fail;
  8636. /* Number of times the tid pool alloc succeeded */
  8637. A_UINT32 tid_pool_alloc_succ;
  8638. /* Number of times the MPDU pool alloc succeeded */
  8639. A_UINT32 mpdu_pool_alloc_succ;
  8640. /* Number of times the MSDU pool alloc succeeded */
  8641. A_UINT32 msdu_pool_alloc_succ;
  8642. /* Number of times the tid pool alloc failed */
  8643. A_UINT32 tid_pool_alloc_fail;
  8644. /* Number of times the MPDU pool alloc failed */
  8645. A_UINT32 mpdu_pool_alloc_fail;
  8646. /* Number of times the MSDU pool alloc failed */
  8647. A_UINT32 msdu_pool_alloc_fail;
  8648. /* Number of times the tid pool freed */
  8649. A_UINT32 tid_pool_free;
  8650. /* Number of times the MPDU pool freed */
  8651. A_UINT32 mpdu_pool_free;
  8652. /* Number of times the MSDU pool freed */
  8653. A_UINT32 msdu_pool_free;
  8654. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  8655. A_UINT32 msdu_queued;
  8656. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  8657. A_UINT32 msdu_recycled;
  8658. /* Number of MPDUs with invalid peer but A2 found in AST */
  8659. A_UINT32 invalid_peer_a2_in_ast;
  8660. /* Number of MPDUs with invalid peer but A3 found in AST */
  8661. A_UINT32 invalid_peer_a3_in_ast;
  8662. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  8663. A_UINT32 invalid_peer_bmc_mpdus;
  8664. /* Number of MSDUs with err attention word */
  8665. A_UINT32 rxdesc_err_att;
  8666. /* Number of MSDUs with flag of peer_idx_invalid */
  8667. A_UINT32 rxdesc_err_peer_idx_inv;
  8668. /* Number of MSDUs with flag of peer_idx_timeout */
  8669. A_UINT32 rxdesc_err_peer_idx_to;
  8670. /* Number of MSDUs with flag of overflow */
  8671. A_UINT32 rxdesc_err_ov;
  8672. /* Number of MSDUs with flag of msdu_length_err */
  8673. A_UINT32 rxdesc_err_msdu_len;
  8674. /* Number of MSDUs with flag of mpdu_length_err */
  8675. A_UINT32 rxdesc_err_mpdu_len;
  8676. /* Number of MSDUs with flag of tkip_mic_err */
  8677. A_UINT32 rxdesc_err_tkip_mic;
  8678. /* Number of MSDUs with flag of decrypt_err */
  8679. A_UINT32 rxdesc_err_decrypt;
  8680. /* Number of MSDUs with flag of fcs_err */
  8681. A_UINT32 rxdesc_err_fcs;
  8682. /* Number of Unicast (bc_mc bit is not set in attention word)
  8683. * frames with invalid peer handler
  8684. */
  8685. A_UINT32 rxdesc_uc_msdus_inv_peer;
  8686. /* Number of unicast frame directly (direct bit is set in attention word)
  8687. * to DUT with invalid peer handler
  8688. */
  8689. A_UINT32 rxdesc_direct_msdus_inv_peer;
  8690. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  8691. * frames with invalid peer handler
  8692. */
  8693. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  8694. /* Number of MSDUs dropped due to no first MSDU flag */
  8695. A_UINT32 rxdesc_no_1st_msdu;
  8696. /* Number of MSDUs droped due to ring overflow */
  8697. A_UINT32 msdu_drop_ring_ov;
  8698. /* Number of MSDUs dropped due to FC mismatch */
  8699. A_UINT32 msdu_drop_fc_mismatch;
  8700. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  8701. A_UINT32 msdu_drop_mgmt_remote_ring;
  8702. /* Number of MSDUs dropped due to errors not reported in attention word */
  8703. A_UINT32 msdu_drop_misc;
  8704. /* Number of MSDUs go to offload before reorder */
  8705. A_UINT32 offload_msdu_wal;
  8706. /* Number of data frame dropped by offload after reorder */
  8707. A_UINT32 offload_msdu_reorder;
  8708. /* Number of MPDUs with sequence number in the past and within the BA window */
  8709. A_UINT32 dup_past_within_window;
  8710. /* Number of MPDUs with sequence number in the past and outside the BA window */
  8711. A_UINT32 dup_past_outside_window;
  8712. /* Number of MSDUs with decrypt/MIC error */
  8713. A_UINT32 rxdesc_err_decrypt_mic;
  8714. /* Number of data MSDUs received on both local and remote rings */
  8715. A_UINT32 data_msdus_on_both_rings;
  8716. /* MPDUs never filled */
  8717. A_UINT32 holes_not_filled;
  8718. };
  8719. /*
  8720. * Rx Remote buffer statistics
  8721. * NB: all the fields must be defined in 4 octets size.
  8722. */
  8723. struct rx_remote_buffer_mgmt_stats {
  8724. /* Total number of MSDUs reaped for Rx processing */
  8725. A_UINT32 remote_reaped;
  8726. /* MSDUs recycled within firmware */
  8727. A_UINT32 remote_recycled;
  8728. /* MSDUs stored by Data Rx */
  8729. A_UINT32 data_rx_msdus_stored;
  8730. /* Number of HTT indications from WAL Rx MSDU */
  8731. A_UINT32 wal_rx_ind;
  8732. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  8733. A_UINT32 wal_rx_ind_unconsumed;
  8734. /* Number of HTT indications from Data Rx MSDU */
  8735. A_UINT32 data_rx_ind;
  8736. /* Number of unconsumed HTT indications from Data Rx MSDU */
  8737. A_UINT32 data_rx_ind_unconsumed;
  8738. /* Number of HTT indications from ATHBUF */
  8739. A_UINT32 athbuf_rx_ind;
  8740. /* Number of remote buffers requested for refill */
  8741. A_UINT32 refill_buf_req;
  8742. /* Number of remote buffers filled by the host */
  8743. A_UINT32 refill_buf_rsp;
  8744. /* Number of times MAC hw_index = f/w write_index */
  8745. A_INT32 mac_no_bufs;
  8746. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  8747. A_INT32 fw_indices_equal;
  8748. /* Number of times f/w finds no buffers to post */
  8749. A_INT32 host_no_bufs;
  8750. };
  8751. /*
  8752. * TXBF MU/SU packets and NDPA statistics
  8753. * NB: all the fields must be defined in 4 octets size.
  8754. */
  8755. struct rx_txbf_musu_ndpa_pkts_stats {
  8756. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  8757. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  8758. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  8759. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  8760. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  8761. A_UINT32 reserved[3]; /* must be set to 0x0 */
  8762. };
  8763. /*
  8764. * htt_dbg_stats_status -
  8765. * present - The requested stats have been delivered in full.
  8766. * This indicates that either the stats information was contained
  8767. * in its entirety within this message, or else this message
  8768. * completes the delivery of the requested stats info that was
  8769. * partially delivered through earlier STATS_CONF messages.
  8770. * partial - The requested stats have been delivered in part.
  8771. * One or more subsequent STATS_CONF messages with the same
  8772. * cookie value will be sent to deliver the remainder of the
  8773. * information.
  8774. * error - The requested stats could not be delivered, for example due
  8775. * to a shortage of memory to construct a message holding the
  8776. * requested stats.
  8777. * invalid - The requested stat type is either not recognized, or the
  8778. * target is configured to not gather the stats type in question.
  8779. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  8780. * series_done - This special value indicates that no further stats info
  8781. * elements are present within a series of stats info elems
  8782. * (within a stats upload confirmation message).
  8783. */
  8784. enum htt_dbg_stats_status {
  8785. HTT_DBG_STATS_STATUS_PRESENT = 0,
  8786. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  8787. HTT_DBG_STATS_STATUS_ERROR = 2,
  8788. HTT_DBG_STATS_STATUS_INVALID = 3,
  8789. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  8790. };
  8791. /**
  8792. * @brief target -> host statistics upload
  8793. *
  8794. * @details
  8795. * The following field definitions describe the format of the HTT target
  8796. * to host stats upload confirmation message.
  8797. * The message contains a cookie echoed from the HTT host->target stats
  8798. * upload request, which identifies which request the confirmation is
  8799. * for, and a series of tag-length-value stats information elements.
  8800. * The tag-length header for each stats info element also includes a
  8801. * status field, to indicate whether the request for the stat type in
  8802. * question was fully met, partially met, unable to be met, or invalid
  8803. * (if the stat type in question is disabled in the target).
  8804. * A special value of all 1's in this status field is used to indicate
  8805. * the end of the series of stats info elements.
  8806. *
  8807. *
  8808. * |31 16|15 8|7 5|4 0|
  8809. * |------------------------------------------------------------|
  8810. * | reserved | msg type |
  8811. * |------------------------------------------------------------|
  8812. * | cookie LSBs |
  8813. * |------------------------------------------------------------|
  8814. * | cookie MSBs |
  8815. * |------------------------------------------------------------|
  8816. * | stats entry length | reserved | S |stat type|
  8817. * |------------------------------------------------------------|
  8818. * | |
  8819. * | type-specific stats info |
  8820. * | |
  8821. * |------------------------------------------------------------|
  8822. * | stats entry length | reserved | S |stat type|
  8823. * |------------------------------------------------------------|
  8824. * | |
  8825. * | type-specific stats info |
  8826. * | |
  8827. * |------------------------------------------------------------|
  8828. * | n/a | reserved | 111 | n/a |
  8829. * |------------------------------------------------------------|
  8830. * Header fields:
  8831. * - MSG_TYPE
  8832. * Bits 7:0
  8833. * Purpose: identifies this is a statistics upload confirmation message
  8834. * Value: 0x9
  8835. * - COOKIE_LSBS
  8836. * Bits 31:0
  8837. * Purpose: Provide a mechanism to match a target->host stats confirmation
  8838. * message with its preceding host->target stats request message.
  8839. * Value: LSBs of the opaque cookie specified by the host-side requestor
  8840. * - COOKIE_MSBS
  8841. * Bits 31:0
  8842. * Purpose: Provide a mechanism to match a target->host stats confirmation
  8843. * message with its preceding host->target stats request message.
  8844. * Value: MSBs of the opaque cookie specified by the host-side requestor
  8845. *
  8846. * Stats Information Element tag-length header fields:
  8847. * - STAT_TYPE
  8848. * Bits 4:0
  8849. * Purpose: identifies the type of statistics info held in the
  8850. * following information element
  8851. * Value: htt_dbg_stats_type
  8852. * - STATUS
  8853. * Bits 7:5
  8854. * Purpose: indicate whether the requested stats are present
  8855. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  8856. * the completion of the stats entry series
  8857. * - LENGTH
  8858. * Bits 31:16
  8859. * Purpose: indicate the stats information size
  8860. * Value: This field specifies the number of bytes of stats information
  8861. * that follows the element tag-length header.
  8862. * It is expected but not required that this length is a multiple of
  8863. * 4 bytes. Even if the length is not an integer multiple of 4, the
  8864. * subsequent stats entry header will begin on a 4-byte aligned
  8865. * boundary.
  8866. */
  8867. #define HTT_T2H_STATS_COOKIE_SIZE 8
  8868. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  8869. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  8870. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  8871. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  8872. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  8873. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  8874. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  8875. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  8876. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  8877. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  8878. do { \
  8879. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  8880. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  8881. } while (0)
  8882. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  8883. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  8884. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  8885. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  8886. do { \
  8887. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  8888. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  8889. } while (0)
  8890. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  8891. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  8892. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  8893. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  8894. do { \
  8895. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  8896. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  8897. } while (0)
  8898. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  8899. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  8900. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  8901. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  8902. #define HTT_MAX_AGGR 64
  8903. #define HTT_HL_MAX_AGGR 18
  8904. /**
  8905. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  8906. *
  8907. * @details
  8908. * The following field definitions describe the format of the HTT host
  8909. * to target frag_desc/msdu_ext bank configuration message.
  8910. * The message contains the based address and the min and max id of the
  8911. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  8912. * MSDU_EXT/FRAG_DESC.
  8913. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  8914. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  8915. * the hardware does the mapping/translation.
  8916. *
  8917. * Total banks that can be configured is configured to 16.
  8918. *
  8919. * This should be called before any TX has be initiated by the HTT
  8920. *
  8921. * |31 16|15 8|7 5|4 0|
  8922. * |------------------------------------------------------------|
  8923. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  8924. * |------------------------------------------------------------|
  8925. * | BANK0_BASE_ADDRESS (bits 31:0) |
  8926. #if HTT_PADDR64
  8927. * | BANK0_BASE_ADDRESS (bits 63:32) |
  8928. #endif
  8929. * |------------------------------------------------------------|
  8930. * | ... |
  8931. * |------------------------------------------------------------|
  8932. * | BANK15_BASE_ADDRESS (bits 31:0) |
  8933. #if HTT_PADDR64
  8934. * | BANK15_BASE_ADDRESS (bits 63:32) |
  8935. #endif
  8936. * |------------------------------------------------------------|
  8937. * | BANK0_MAX_ID | BANK0_MIN_ID |
  8938. * |------------------------------------------------------------|
  8939. * | ... |
  8940. * |------------------------------------------------------------|
  8941. * | BANK15_MAX_ID | BANK15_MIN_ID |
  8942. * |------------------------------------------------------------|
  8943. * Header fields:
  8944. * - MSG_TYPE
  8945. * Bits 7:0
  8946. * Value: 0x6
  8947. * for systems with 64-bit format for bus addresses:
  8948. * - BANKx_BASE_ADDRESS_LO
  8949. * Bits 31:0
  8950. * Purpose: Provide a mechanism to specify the base address of the
  8951. * MSDU_EXT bank physical/bus address.
  8952. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  8953. * - BANKx_BASE_ADDRESS_HI
  8954. * Bits 31:0
  8955. * Purpose: Provide a mechanism to specify the base address of the
  8956. * MSDU_EXT bank physical/bus address.
  8957. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  8958. * for systems with 32-bit format for bus addresses:
  8959. * - BANKx_BASE_ADDRESS
  8960. * Bits 31:0
  8961. * Purpose: Provide a mechanism to specify the base address of the
  8962. * MSDU_EXT bank physical/bus address.
  8963. * Value: MSDU_EXT bank physical / bus address
  8964. * - BANKx_MIN_ID
  8965. * Bits 15:0
  8966. * Purpose: Provide a mechanism to specify the min index that needs to
  8967. * mapped.
  8968. * - BANKx_MAX_ID
  8969. * Bits 31:16
  8970. * Purpose: Provide a mechanism to specify the max index that needs to
  8971. * mapped.
  8972. *
  8973. */
  8974. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  8975. * safe value.
  8976. * @note MAX supported banks is 16.
  8977. */
  8978. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  8979. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  8980. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  8981. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  8982. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  8983. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  8984. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  8985. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  8986. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  8987. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  8988. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  8989. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  8990. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  8991. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  8992. do { \
  8993. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  8994. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  8995. } while (0)
  8996. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  8997. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  8998. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  8999. do { \
  9000. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  9001. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  9002. } while (0)
  9003. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  9004. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  9005. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  9006. do { \
  9007. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  9008. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  9009. } while (0)
  9010. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  9011. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  9012. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  9013. do { \
  9014. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  9015. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  9016. } while (0)
  9017. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  9018. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  9019. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  9020. do { \
  9021. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  9022. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  9023. } while (0)
  9024. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  9025. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  9026. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  9027. do { \
  9028. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  9029. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  9030. } while (0)
  9031. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  9032. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  9033. /*
  9034. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  9035. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  9036. * addresses are stored in a XXX-bit field.
  9037. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  9038. * htt_tx_frag_desc64_bank_cfg_t structs.
  9039. */
  9040. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  9041. _paddr_bits_, \
  9042. _paddr__bank_base_address_) \
  9043. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  9044. /** word 0 \
  9045. * msg_type: 8, \
  9046. * pdev_id: 2, \
  9047. * swap: 1, \
  9048. * reserved0: 5, \
  9049. * num_banks: 8, \
  9050. * desc_size: 8; \
  9051. */ \
  9052. A_UINT32 word0; \
  9053. /* \
  9054. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  9055. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  9056. * the second A_UINT32). \
  9057. */ \
  9058. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  9059. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  9060. } POSTPACK
  9061. /* define htt_tx_frag_desc32_bank_cfg_t */
  9062. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  9063. /* define htt_tx_frag_desc64_bank_cfg_t */
  9064. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  9065. /*
  9066. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  9067. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  9068. */
  9069. #if HTT_PADDR64
  9070. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  9071. #else
  9072. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  9073. #endif
  9074. /**
  9075. * @brief target -> host HTT TX Credit total count update message definition
  9076. *
  9077. *|31 16|15|14 9| 8 |7 0 |
  9078. *|---------------------+--+----------+-------+----------|
  9079. *|cur htt credit delta | Q| reserved | sign | msg type |
  9080. *|------------------------------------------------------|
  9081. *
  9082. * Header fields:
  9083. * - MSG_TYPE
  9084. * Bits 7:0
  9085. * Purpose: identifies this as a htt tx credit delta update message
  9086. * Value: 0xe
  9087. * - SIGN
  9088. * Bits 8
  9089. * identifies whether credit delta is positive or negative
  9090. * Value:
  9091. * - 0x0: credit delta is positive, rebalance in some buffers
  9092. * - 0x1: credit delta is negative, rebalance out some buffers
  9093. * - reserved
  9094. * Bits 14:9
  9095. * Value: 0x0
  9096. * - TXQ_GRP
  9097. * Bit 15
  9098. * Purpose: indicates whether any tx queue group information elements
  9099. * are appended to the tx credit update message
  9100. * Value: 0 -> no tx queue group information element is present
  9101. * 1 -> a tx queue group information element immediately follows
  9102. * - DELTA_COUNT
  9103. * Bits 31:16
  9104. * Purpose: Specify current htt credit delta absolute count
  9105. */
  9106. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  9107. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  9108. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  9109. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  9110. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  9111. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  9112. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  9113. do { \
  9114. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  9115. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  9116. } while (0)
  9117. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  9118. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  9119. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  9120. do { \
  9121. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  9122. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  9123. } while (0)
  9124. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  9125. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  9126. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  9127. do { \
  9128. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  9129. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  9130. } while (0)
  9131. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  9132. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  9133. #define HTT_TX_CREDIT_MSG_BYTES 4
  9134. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  9135. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  9136. /**
  9137. * @brief HTT WDI_IPA Operation Response Message
  9138. *
  9139. * @details
  9140. * HTT WDI_IPA Operation Response message is sent by target
  9141. * to host confirming suspend or resume operation.
  9142. * |31 24|23 16|15 8|7 0|
  9143. * |----------------+----------------+----------------+----------------|
  9144. * | op_code | Rsvd | msg_type |
  9145. * |-------------------------------------------------------------------|
  9146. * | Rsvd | Response len |
  9147. * |-------------------------------------------------------------------|
  9148. * | |
  9149. * | Response-type specific info |
  9150. * | |
  9151. * | |
  9152. * |-------------------------------------------------------------------|
  9153. * Header fields:
  9154. * - MSG_TYPE
  9155. * Bits 7:0
  9156. * Purpose: Identifies this as WDI_IPA Operation Response message
  9157. * value: = 0x13
  9158. * - OP_CODE
  9159. * Bits 31:16
  9160. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  9161. * value: = enum htt_wdi_ipa_op_code
  9162. * - RSP_LEN
  9163. * Bits 16:0
  9164. * Purpose: length for the response-type specific info
  9165. * value: = length in bytes for response-type specific info
  9166. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  9167. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  9168. */
  9169. PREPACK struct htt_wdi_ipa_op_response_t
  9170. {
  9171. /* DWORD 0: flags and meta-data */
  9172. A_UINT32
  9173. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  9174. reserved1: 8,
  9175. op_code: 16;
  9176. A_UINT32
  9177. rsp_len: 16,
  9178. reserved2: 16;
  9179. } POSTPACK;
  9180. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  9181. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  9182. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  9183. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  9184. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  9185. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  9186. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  9187. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  9188. do { \
  9189. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  9190. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  9191. } while (0)
  9192. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  9193. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  9194. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  9195. do { \
  9196. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  9197. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  9198. } while (0)
  9199. enum htt_phy_mode {
  9200. htt_phy_mode_11a = 0,
  9201. htt_phy_mode_11g = 1,
  9202. htt_phy_mode_11b = 2,
  9203. htt_phy_mode_11g_only = 3,
  9204. htt_phy_mode_11na_ht20 = 4,
  9205. htt_phy_mode_11ng_ht20 = 5,
  9206. htt_phy_mode_11na_ht40 = 6,
  9207. htt_phy_mode_11ng_ht40 = 7,
  9208. htt_phy_mode_11ac_vht20 = 8,
  9209. htt_phy_mode_11ac_vht40 = 9,
  9210. htt_phy_mode_11ac_vht80 = 10,
  9211. htt_phy_mode_11ac_vht20_2g = 11,
  9212. htt_phy_mode_11ac_vht40_2g = 12,
  9213. htt_phy_mode_11ac_vht80_2g = 13,
  9214. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  9215. htt_phy_mode_11ac_vht160 = 15,
  9216. htt_phy_mode_max,
  9217. };
  9218. /**
  9219. * @brief target -> host HTT channel change indication
  9220. * @details
  9221. * Specify when a channel change occurs.
  9222. * This allows the host to precisely determine which rx frames arrived
  9223. * on the old channel and which rx frames arrived on the new channel.
  9224. *
  9225. *|31 |7 0 |
  9226. *|-------------------------------------------+----------|
  9227. *| reserved | msg type |
  9228. *|------------------------------------------------------|
  9229. *| primary_chan_center_freq_mhz |
  9230. *|------------------------------------------------------|
  9231. *| contiguous_chan1_center_freq_mhz |
  9232. *|------------------------------------------------------|
  9233. *| contiguous_chan2_center_freq_mhz |
  9234. *|------------------------------------------------------|
  9235. *| phy_mode |
  9236. *|------------------------------------------------------|
  9237. *
  9238. * Header fields:
  9239. * - MSG_TYPE
  9240. * Bits 7:0
  9241. * Purpose: identifies this as a htt channel change indication message
  9242. * Value: 0x15
  9243. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  9244. * Bits 31:0
  9245. * Purpose: identify the (center of the) new 20 MHz primary channel
  9246. * Value: center frequency of the 20 MHz primary channel, in MHz units
  9247. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  9248. * Bits 31:0
  9249. * Purpose: identify the (center of the) contiguous frequency range
  9250. * comprising the new channel.
  9251. * For example, if the new channel is a 80 MHz channel extending
  9252. * 60 MHz beyond the primary channel, this field would be 30 larger
  9253. * than the primary channel center frequency field.
  9254. * Value: center frequency of the contiguous frequency range comprising
  9255. * the full channel in MHz units
  9256. * (80+80 channels also use the CONTIG_CHAN2 field)
  9257. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  9258. * Bits 31:0
  9259. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  9260. * within a VHT 80+80 channel.
  9261. * This field is only relevant for VHT 80+80 channels.
  9262. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  9263. * channel (arbitrary value for cases besides VHT 80+80)
  9264. * - PHY_MODE
  9265. * Bits 31:0
  9266. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  9267. * and band
  9268. * Value: htt_phy_mode enum value
  9269. */
  9270. PREPACK struct htt_chan_change_t
  9271. {
  9272. /* DWORD 0: flags and meta-data */
  9273. A_UINT32
  9274. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  9275. reserved1: 24;
  9276. A_UINT32 primary_chan_center_freq_mhz;
  9277. A_UINT32 contig_chan1_center_freq_mhz;
  9278. A_UINT32 contig_chan2_center_freq_mhz;
  9279. A_UINT32 phy_mode;
  9280. } POSTPACK;
  9281. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  9282. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  9283. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  9284. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  9285. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  9286. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  9287. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  9288. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  9289. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  9290. do { \
  9291. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  9292. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  9293. } while (0)
  9294. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  9295. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  9296. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  9297. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  9298. do { \
  9299. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  9300. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  9301. } while (0)
  9302. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  9303. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  9304. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  9305. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  9306. do { \
  9307. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  9308. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  9309. } while (0)
  9310. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  9311. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  9312. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  9313. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  9314. do { \
  9315. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  9316. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  9317. } while (0)
  9318. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  9319. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  9320. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  9321. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  9322. /**
  9323. * @brief rx offload packet error message
  9324. *
  9325. * @details
  9326. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  9327. * of target payload like mic err.
  9328. *
  9329. * |31 24|23 16|15 8|7 0|
  9330. * |----------------+----------------+----------------+----------------|
  9331. * | tid | vdev_id | msg_sub_type | msg_type |
  9332. * |-------------------------------------------------------------------|
  9333. * : (sub-type dependent content) :
  9334. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  9335. * Header fields:
  9336. * - msg_type
  9337. * Bits 7:0
  9338. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  9339. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  9340. * - msg_sub_type
  9341. * Bits 15:8
  9342. * Purpose: Identifies which type of rx error is reported by this message
  9343. * value: htt_rx_ofld_pkt_err_type
  9344. * - vdev_id
  9345. * Bits 23:16
  9346. * Purpose: Identifies which vdev received the erroneous rx frame
  9347. * value:
  9348. * - tid
  9349. * Bits 31:24
  9350. * Purpose: Identifies the traffic type of the rx frame
  9351. * value:
  9352. *
  9353. * - The payload fields used if the sub-type == MIC error are shown below.
  9354. * Note - MIC err is per MSDU, while PN is per MPDU.
  9355. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  9356. * with MIC err in A-MSDU case, so FW will send only one HTT message
  9357. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  9358. * instead of sending separate HTT messages for each wrong MSDU within
  9359. * the MPDU.
  9360. *
  9361. * |31 24|23 16|15 8|7 0|
  9362. * |----------------+----------------+----------------+----------------|
  9363. * | Rsvd | key_id | peer_id |
  9364. * |-------------------------------------------------------------------|
  9365. * | receiver MAC addr 31:0 |
  9366. * |-------------------------------------------------------------------|
  9367. * | Rsvd | receiver MAC addr 47:32 |
  9368. * |-------------------------------------------------------------------|
  9369. * | transmitter MAC addr 31:0 |
  9370. * |-------------------------------------------------------------------|
  9371. * | Rsvd | transmitter MAC addr 47:32 |
  9372. * |-------------------------------------------------------------------|
  9373. * | PN 31:0 |
  9374. * |-------------------------------------------------------------------|
  9375. * | Rsvd | PN 47:32 |
  9376. * |-------------------------------------------------------------------|
  9377. * - peer_id
  9378. * Bits 15:0
  9379. * Purpose: identifies which peer is frame is from
  9380. * value:
  9381. * - key_id
  9382. * Bits 23:16
  9383. * Purpose: identifies key_id of rx frame
  9384. * value:
  9385. * - RA_31_0 (receiver MAC addr 31:0)
  9386. * Bits 31:0
  9387. * Purpose: identifies by MAC address which vdev received the frame
  9388. * value: MAC address lower 4 bytes
  9389. * - RA_47_32 (receiver MAC addr 47:32)
  9390. * Bits 15:0
  9391. * Purpose: identifies by MAC address which vdev received the frame
  9392. * value: MAC address upper 2 bytes
  9393. * - TA_31_0 (transmitter MAC addr 31:0)
  9394. * Bits 31:0
  9395. * Purpose: identifies by MAC address which peer transmitted the frame
  9396. * value: MAC address lower 4 bytes
  9397. * - TA_47_32 (transmitter MAC addr 47:32)
  9398. * Bits 15:0
  9399. * Purpose: identifies by MAC address which peer transmitted the frame
  9400. * value: MAC address upper 2 bytes
  9401. * - PN_31_0
  9402. * Bits 31:0
  9403. * Purpose: Identifies pn of rx frame
  9404. * value: PN lower 4 bytes
  9405. * - PN_47_32
  9406. * Bits 15:0
  9407. * Purpose: Identifies pn of rx frame
  9408. * value:
  9409. * TKIP or CCMP: PN upper 2 bytes
  9410. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  9411. */
  9412. enum htt_rx_ofld_pkt_err_type {
  9413. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  9414. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  9415. };
  9416. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  9417. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  9418. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  9419. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  9420. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  9421. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  9422. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  9423. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  9424. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  9425. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  9426. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  9427. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  9428. do { \
  9429. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  9430. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  9431. } while (0)
  9432. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  9433. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  9434. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  9435. do { \
  9436. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  9437. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  9438. } while (0)
  9439. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  9440. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  9441. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  9442. do { \
  9443. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  9444. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  9445. } while (0)
  9446. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  9447. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  9448. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  9449. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  9450. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  9451. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  9452. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  9453. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  9454. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  9455. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  9456. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  9457. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  9458. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  9459. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  9460. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  9461. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  9462. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  9463. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  9464. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  9465. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  9466. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  9467. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  9468. do { \
  9469. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  9470. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  9471. } while (0)
  9472. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  9473. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  9474. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  9475. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  9476. do { \
  9477. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  9478. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  9479. } while (0)
  9480. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  9481. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  9482. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  9483. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  9484. do { \
  9485. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  9486. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  9487. } while (0)
  9488. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  9489. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  9490. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  9491. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  9492. do { \
  9493. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  9494. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  9495. } while (0)
  9496. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  9497. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  9498. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  9499. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  9500. do { \
  9501. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  9502. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  9503. } while (0)
  9504. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  9505. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  9506. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  9507. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  9508. do { \
  9509. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  9510. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  9511. } while (0)
  9512. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  9513. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  9514. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  9515. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  9516. do { \
  9517. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  9518. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  9519. } while (0)
  9520. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  9521. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  9522. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  9523. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  9524. do { \
  9525. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  9526. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  9527. } while (0)
  9528. /**
  9529. * @brief peer rate report message
  9530. *
  9531. * @details
  9532. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  9533. * justified rate of all the peers.
  9534. *
  9535. * |31 24|23 16|15 8|7 0|
  9536. * |----------------+----------------+----------------+----------------|
  9537. * | peer_count | | msg_type |
  9538. * |-------------------------------------------------------------------|
  9539. * : Payload (variant number of peer rate report) :
  9540. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  9541. * Header fields:
  9542. * - msg_type
  9543. * Bits 7:0
  9544. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  9545. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  9546. * - reserved
  9547. * Bits 15:8
  9548. * Purpose:
  9549. * value:
  9550. * - peer_count
  9551. * Bits 31:16
  9552. * Purpose: Specify how many peer rate report elements are present in the payload.
  9553. * value:
  9554. *
  9555. * Payload:
  9556. * There are variant number of peer rate report follow the first 32 bits.
  9557. * The peer rate report is defined as follows.
  9558. *
  9559. * |31 20|19 16|15 0|
  9560. * |-----------------------+---------+---------------------------------|-
  9561. * | reserved | phy | peer_id | \
  9562. * |-------------------------------------------------------------------| -> report #0
  9563. * | rate | /
  9564. * |-----------------------+---------+---------------------------------|-
  9565. * | reserved | phy | peer_id | \
  9566. * |-------------------------------------------------------------------| -> report #1
  9567. * | rate | /
  9568. * |-----------------------+---------+---------------------------------|-
  9569. * | reserved | phy | peer_id | \
  9570. * |-------------------------------------------------------------------| -> report #2
  9571. * | rate | /
  9572. * |-------------------------------------------------------------------|-
  9573. * : :
  9574. * : :
  9575. * : :
  9576. * :-------------------------------------------------------------------:
  9577. *
  9578. * - peer_id
  9579. * Bits 15:0
  9580. * Purpose: identify the peer
  9581. * value:
  9582. * - phy
  9583. * Bits 19:16
  9584. * Purpose: identify which phy is in use
  9585. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  9586. * Please see enum htt_peer_report_phy_type for detail.
  9587. * - reserved
  9588. * Bits 31:20
  9589. * Purpose:
  9590. * value:
  9591. * - rate
  9592. * Bits 31:0
  9593. * Purpose: represent the justified rate of the peer specified by peer_id
  9594. * value:
  9595. */
  9596. enum htt_peer_rate_report_phy_type {
  9597. HTT_PEER_RATE_REPORT_11B = 0,
  9598. HTT_PEER_RATE_REPORT_11A_G,
  9599. HTT_PEER_RATE_REPORT_11N,
  9600. HTT_PEER_RATE_REPORT_11AC,
  9601. };
  9602. #define HTT_PEER_RATE_REPORT_SIZE 8
  9603. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  9604. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  9605. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  9606. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  9607. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  9608. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  9609. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  9610. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  9611. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  9612. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  9613. do { \
  9614. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  9615. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  9616. } while (0)
  9617. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  9618. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  9619. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  9620. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  9621. do { \
  9622. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  9623. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  9624. } while (0)
  9625. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  9626. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  9627. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  9628. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  9629. do { \
  9630. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  9631. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  9632. } while (0)
  9633. /**
  9634. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_MAP Message
  9635. *
  9636. * @details
  9637. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  9638. * a flow of descriptors.
  9639. *
  9640. * This message is in TLV format and indicates the parameters to be setup a
  9641. * flow in the host. Each entry indicates that a particular flow ID is ready to
  9642. * receive descriptors from a specified pool.
  9643. *
  9644. * The message would appear as follows:
  9645. *
  9646. * |31 24|23 16|15 8|7 0|
  9647. * |----------------+----------------+----------------+----------------|
  9648. * header | reserved | num_flows | msg_type |
  9649. * |-------------------------------------------------------------------|
  9650. * | |
  9651. * : payload :
  9652. * | |
  9653. * |-------------------------------------------------------------------|
  9654. *
  9655. * The header field is one DWORD long and is interpreted as follows:
  9656. * b'0:7 - msg_type: This will be set to HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  9657. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  9658. * this message
  9659. * b'16-31 - reserved: These bits are reserved for future use
  9660. *
  9661. * Payload:
  9662. * The payload would contain multiple objects of the following structure. Each
  9663. * object represents a flow.
  9664. *
  9665. * |31 24|23 16|15 8|7 0|
  9666. * |----------------+----------------+----------------+----------------|
  9667. * header | reserved | num_flows | msg_type |
  9668. * |-------------------------------------------------------------------|
  9669. * payload0| flow_type |
  9670. * |-------------------------------------------------------------------|
  9671. * | flow_id |
  9672. * |-------------------------------------------------------------------|
  9673. * | reserved0 | flow_pool_id |
  9674. * |-------------------------------------------------------------------|
  9675. * | reserved1 | flow_pool_size |
  9676. * |-------------------------------------------------------------------|
  9677. * | reserved2 |
  9678. * |-------------------------------------------------------------------|
  9679. * payload1| flow_type |
  9680. * |-------------------------------------------------------------------|
  9681. * | flow_id |
  9682. * |-------------------------------------------------------------------|
  9683. * | reserved0 | flow_pool_id |
  9684. * |-------------------------------------------------------------------|
  9685. * | reserved1 | flow_pool_size |
  9686. * |-------------------------------------------------------------------|
  9687. * | reserved2 |
  9688. * |-------------------------------------------------------------------|
  9689. * | . |
  9690. * | . |
  9691. * | . |
  9692. * |-------------------------------------------------------------------|
  9693. *
  9694. * Each payload is 5 DWORDS long and is interpreted as follows:
  9695. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  9696. * this flow is associated. It can be VDEV, peer,
  9697. * or tid (AC). Based on enum htt_flow_type.
  9698. *
  9699. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  9700. * object. For flow_type vdev it is set to the
  9701. * vdevid, for peer it is peerid and for tid, it is
  9702. * tid_num.
  9703. *
  9704. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  9705. * in the host for this flow
  9706. * b'16:31 - reserved0: This field in reserved for the future. In case
  9707. * we have a hierarchical implementation (HCM) of
  9708. * pools, it can be used to indicate the ID of the
  9709. * parent-pool.
  9710. *
  9711. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  9712. * Descriptors for this flow will be
  9713. * allocated from this pool in the host.
  9714. * b'16:31 - reserved1: This field in reserved for the future. In case
  9715. * we have a hierarchical implementation of pools,
  9716. * it can be used to indicate the max number of
  9717. * descriptors in the pool. The b'0:15 can be used
  9718. * to indicate min number of descriptors in the
  9719. * HCM scheme.
  9720. *
  9721. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  9722. * we have a hierarchical implementation of pools,
  9723. * b'0:15 can be used to indicate the
  9724. * priority-based borrowing (PBB) threshold of
  9725. * the flow's pool. The b'16:31 are still left
  9726. * reserved.
  9727. */
  9728. enum htt_flow_type {
  9729. FLOW_TYPE_VDEV = 0,
  9730. /* Insert new flow types above this line */
  9731. };
  9732. PREPACK struct htt_flow_pool_map_payload_t {
  9733. A_UINT32 flow_type;
  9734. A_UINT32 flow_id;
  9735. A_UINT32 flow_pool_id:16,
  9736. reserved0:16;
  9737. A_UINT32 flow_pool_size:16,
  9738. reserved1:16;
  9739. A_UINT32 reserved2;
  9740. } POSTPACK;
  9741. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  9742. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  9743. (sizeof(struct htt_flow_pool_map_payload_t))
  9744. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  9745. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  9746. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  9747. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  9748. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  9749. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  9750. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  9751. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  9752. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  9753. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  9754. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  9755. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  9756. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  9757. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  9758. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  9759. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  9760. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  9761. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  9762. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  9763. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  9764. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  9765. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  9766. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  9767. do { \
  9768. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  9769. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  9770. } while (0)
  9771. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  9772. do { \
  9773. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  9774. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  9775. } while (0)
  9776. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  9777. do { \
  9778. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  9779. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  9780. } while (0)
  9781. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  9782. do { \
  9783. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  9784. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  9785. } while (0)
  9786. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  9787. do { \
  9788. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  9789. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  9790. } while (0)
  9791. /**
  9792. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP Message
  9793. *
  9794. * @details
  9795. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  9796. * down a flow of descriptors.
  9797. * This message indicates that for the flow (whose ID is provided) is wanting
  9798. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  9799. * pool of descriptors from where descriptors are being allocated for this
  9800. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  9801. * be unmapped by the host.
  9802. *
  9803. * The message would appear as follows:
  9804. *
  9805. * |31 24|23 16|15 8|7 0|
  9806. * |----------------+----------------+----------------+----------------|
  9807. * | reserved0 | msg_type |
  9808. * |-------------------------------------------------------------------|
  9809. * | flow_type |
  9810. * |-------------------------------------------------------------------|
  9811. * | flow_id |
  9812. * |-------------------------------------------------------------------|
  9813. * | reserved1 | flow_pool_id |
  9814. * |-------------------------------------------------------------------|
  9815. *
  9816. * The message is interpreted as follows:
  9817. * dword0 - b'0:7 - msg_type: This will be set to
  9818. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  9819. * b'8:31 - reserved0: Reserved for future use
  9820. *
  9821. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  9822. * this flow is associated. It can be VDEV, peer,
  9823. * or tid (AC). Based on enum htt_flow_type.
  9824. *
  9825. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  9826. * object. For flow_type vdev it is set to the
  9827. * vdevid, for peer it is peerid and for tid, it is
  9828. * tid_num.
  9829. *
  9830. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  9831. * used in the host for this flow
  9832. * b'16:31 - reserved0: This field in reserved for the future.
  9833. *
  9834. */
  9835. PREPACK struct htt_flow_pool_unmap_t {
  9836. A_UINT32 msg_type:8,
  9837. reserved0:24;
  9838. A_UINT32 flow_type;
  9839. A_UINT32 flow_id;
  9840. A_UINT32 flow_pool_id:16,
  9841. reserved1:16;
  9842. } POSTPACK;
  9843. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  9844. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  9845. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  9846. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  9847. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  9848. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  9849. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  9850. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  9851. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  9852. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  9853. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  9854. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  9855. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  9856. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  9857. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  9858. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  9859. do { \
  9860. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  9861. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  9862. } while (0)
  9863. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  9864. do { \
  9865. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  9866. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  9867. } while (0)
  9868. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  9869. do { \
  9870. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  9871. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  9872. } while (0)
  9873. /**
  9874. * @brief HTT_T2H_MSG_TYPE_SRING_SETUP_DONE Message
  9875. *
  9876. * @details
  9877. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  9878. * SRNG ring setup is done
  9879. *
  9880. * This message indicates whether the last setup operation is successful.
  9881. * It will be sent to host when host set respose_required bit in
  9882. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  9883. * The message would appear as follows:
  9884. *
  9885. * |31 24|23 16|15 8|7 0|
  9886. * |--------------- +----------------+----------------+----------------|
  9887. * | setup_status | ring_id | pdev_id | msg_type |
  9888. * |-------------------------------------------------------------------|
  9889. *
  9890. * The message is interpreted as follows:
  9891. * dword0 - b'0:7 - msg_type: This will be set to
  9892. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  9893. * b'8:15 - pdev_id:
  9894. * 0 (for rings at SOC/UMAC level),
  9895. * 1/2/3 mac id (for rings at LMAC level)
  9896. * b'16:23 - ring_id: Identify the ring which is set up
  9897. * More details can be got from enum htt_srng_ring_id
  9898. * b'24:31 - setup_status: Indicate status of setup operation
  9899. * Refer to htt_ring_setup_status
  9900. */
  9901. PREPACK struct htt_sring_setup_done_t {
  9902. A_UINT32 msg_type: 8,
  9903. pdev_id: 8,
  9904. ring_id: 8,
  9905. setup_status: 8;
  9906. } POSTPACK;
  9907. enum htt_ring_setup_status {
  9908. htt_ring_setup_status_ok = 0,
  9909. htt_ring_setup_status_error,
  9910. };
  9911. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  9912. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  9913. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  9914. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  9915. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  9916. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  9917. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  9918. do { \
  9919. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  9920. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  9921. } while (0)
  9922. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  9923. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  9924. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  9925. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  9926. HTT_SRING_SETUP_DONE_RING_ID_S)
  9927. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  9928. do { \
  9929. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  9930. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  9931. } while (0)
  9932. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  9933. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  9934. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  9935. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  9936. HTT_SRING_SETUP_DONE_STATUS_S)
  9937. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  9938. do { \
  9939. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  9940. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  9941. } while (0)
  9942. /**
  9943. * @brief HTT_T2H_MSG_TYPE_MAP_FLOW_INFO Message
  9944. *
  9945. * @details
  9946. * HTT TX map flow entry with tqm flow pointer
  9947. * Sent from firmware to host to add tqm flow pointer in corresponding
  9948. * flow search entry. Flow metadata is replayed back to host as part of this
  9949. * struct to enable host to find the specific flow search entry
  9950. *
  9951. * The message would appear as follows:
  9952. *
  9953. * |31 28|27 18|17 14|13 8|7 0|
  9954. * |-------+------------------------------------------+----------------|
  9955. * | rsvd0 | fse_hsh_idx | msg_type |
  9956. * |-------------------------------------------------------------------|
  9957. * | rsvd1 | tid | peer_id |
  9958. * |-------------------------------------------------------------------|
  9959. * | tqm_flow_pntr_lo |
  9960. * |-------------------------------------------------------------------|
  9961. * | tqm_flow_pntr_hi |
  9962. * |-------------------------------------------------------------------|
  9963. * | fse_meta_data |
  9964. * |-------------------------------------------------------------------|
  9965. *
  9966. * The message is interpreted as follows:
  9967. *
  9968. * dword0 - b'0:7 - msg_type: This will be set to
  9969. * HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  9970. *
  9971. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  9972. * for this flow entry
  9973. *
  9974. * dword0 - b'28:31 - rsvd0: Reserved for future use
  9975. *
  9976. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  9977. *
  9978. * dword1 - b'14:17 - tid
  9979. *
  9980. * dword1 - b'18:31 - rsvd1: Reserved for future use
  9981. *
  9982. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  9983. *
  9984. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  9985. *
  9986. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  9987. * given by host
  9988. */
  9989. PREPACK struct htt_tx_map_flow_info {
  9990. A_UINT32
  9991. msg_type: 8,
  9992. fse_hsh_idx: 20,
  9993. rsvd0: 4;
  9994. A_UINT32
  9995. peer_id: 14,
  9996. tid: 4,
  9997. rsvd1: 14;
  9998. A_UINT32 tqm_flow_pntr_lo;
  9999. A_UINT32 tqm_flow_pntr_hi;
  10000. struct htt_tx_flow_metadata fse_meta_data;
  10001. } POSTPACK;
  10002. /* DWORD 0 */
  10003. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  10004. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  10005. /* DWORD 1 */
  10006. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  10007. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  10008. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  10009. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  10010. /* DWORD 0 */
  10011. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  10012. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  10013. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  10014. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  10015. do { \
  10016. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  10017. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  10018. } while (0)
  10019. /* DWORD 1 */
  10020. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  10021. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  10022. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  10023. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  10024. do { \
  10025. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  10026. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  10027. } while (0)
  10028. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  10029. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  10030. HTT_TX_MAP_FLOW_INFO_TID_S)
  10031. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  10032. do { \
  10033. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  10034. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  10035. } while (0)
  10036. /*
  10037. * htt_dbg_ext_stats_status -
  10038. * present - The requested stats have been delivered in full.
  10039. * This indicates that either the stats information was contained
  10040. * in its entirety within this message, or else this message
  10041. * completes the delivery of the requested stats info that was
  10042. * partially delivered through earlier STATS_CONF messages.
  10043. * partial - The requested stats have been delivered in part.
  10044. * One or more subsequent STATS_CONF messages with the same
  10045. * cookie value will be sent to deliver the remainder of the
  10046. * information.
  10047. * error - The requested stats could not be delivered, for example due
  10048. * to a shortage of memory to construct a message holding the
  10049. * requested stats.
  10050. * invalid - The requested stat type is either not recognized, or the
  10051. * target is configured to not gather the stats type in question.
  10052. */
  10053. enum htt_dbg_ext_stats_status {
  10054. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  10055. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  10056. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  10057. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  10058. };
  10059. /**
  10060. * @brief target -> host ppdu stats upload
  10061. *
  10062. * @details
  10063. * The following field definitions describe the format of the HTT target
  10064. * to host ppdu stats indication message.
  10065. *
  10066. *
  10067. * |31 16|15 12|11 10|9 8|7 0 |
  10068. * |----------------------------------------------------------------------|
  10069. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  10070. * |----------------------------------------------------------------------|
  10071. * | ppdu_id |
  10072. * |----------------------------------------------------------------------|
  10073. * | Timestamp in us |
  10074. * |----------------------------------------------------------------------|
  10075. * | reserved |
  10076. * |----------------------------------------------------------------------|
  10077. * | type-specific stats info |
  10078. * | (see htt_ppdu_stats.h) |
  10079. * |----------------------------------------------------------------------|
  10080. * Header fields:
  10081. * - MSG_TYPE
  10082. * Bits 7:0
  10083. * Purpose: Identifies this is a PPDU STATS indication
  10084. * message.
  10085. * Value: 0x1d
  10086. * - mac_id
  10087. * Bits 9:8
  10088. * Purpose: mac_id of this ppdu_id
  10089. * Value: 0-3
  10090. * - pdev_id
  10091. * Bits 11:10
  10092. * Purpose: pdev_id of this ppdu_id
  10093. * Value: 0-3
  10094. * 0 (for rings at SOC level),
  10095. * 1/2/3 PDEV -> 0/1/2
  10096. * - payload_size
  10097. * Bits 31:16
  10098. * Purpose: total tlv size
  10099. * Value: payload_size in bytes
  10100. */
  10101. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  10102. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  10103. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  10104. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  10105. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  10106. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  10107. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  10108. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  10109. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  10110. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  10111. do { \
  10112. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  10113. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  10114. } while (0)
  10115. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  10116. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  10117. HTT_T2H_PPDU_STATS_MAC_ID_S)
  10118. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  10119. do { \
  10120. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  10121. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  10122. } while (0)
  10123. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  10124. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  10125. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  10126. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  10127. do { \
  10128. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  10129. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  10130. } while (0)
  10131. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  10132. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  10133. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  10134. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  10135. do { \
  10136. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  10137. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  10138. } while (0)
  10139. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  10140. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  10141. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  10142. /* htt_t2h_ppdu_stats_ind_hdr_t
  10143. * This struct contains the fields within the header of the
  10144. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  10145. * stats info.
  10146. * This struct assumes little-endian layout, and thus is only
  10147. * suitable for use within processors known to be little-endian
  10148. * (such as the target).
  10149. * In contrast, the above macros provide endian-portable methods
  10150. * to get and set the bitfields within this PPDU_STATS_IND header.
  10151. */
  10152. typedef struct {
  10153. A_UINT32 msg_type: 8, /* bits 7:0 */
  10154. mac_id: 2, /* bits 9:8 */
  10155. pdev_id: 2, /* bits 11:10 */
  10156. reserved1: 4, /* bits 15:12 */
  10157. payload_size: 16; /* bits 31:16 */
  10158. A_UINT32 ppdu_id;
  10159. A_UINT32 timestamp_us;
  10160. A_UINT32 reserved2;
  10161. } htt_t2h_ppdu_stats_ind_hdr_t;
  10162. /**
  10163. * @brief target -> host extended statistics upload
  10164. *
  10165. * @details
  10166. * The following field definitions describe the format of the HTT target
  10167. * to host stats upload confirmation message.
  10168. * The message contains a cookie echoed from the HTT host->target stats
  10169. * upload request, which identifies which request the confirmation is
  10170. * for, and a single stats can span over multiple HTT stats indication
  10171. * due to the HTT message size limitation so every HTT ext stats indication
  10172. * will have tag-length-value stats information elements.
  10173. * The tag-length header for each HTT stats IND message also includes a
  10174. * status field, to indicate whether the request for the stat type in
  10175. * question was fully met, partially met, unable to be met, or invalid
  10176. * (if the stat type in question is disabled in the target).
  10177. * A Done bit 1's indicate the end of the of stats info elements.
  10178. *
  10179. *
  10180. * |31 16|15 12|11|10 8|7 5|4 0|
  10181. * |--------------------------------------------------------------|
  10182. * | reserved | msg type |
  10183. * |--------------------------------------------------------------|
  10184. * | cookie LSBs |
  10185. * |--------------------------------------------------------------|
  10186. * | cookie MSBs |
  10187. * |--------------------------------------------------------------|
  10188. * | stats entry length | rsvd | D| S | stat type |
  10189. * |--------------------------------------------------------------|
  10190. * | type-specific stats info |
  10191. * | (see htt_stats.h) |
  10192. * |--------------------------------------------------------------|
  10193. * Header fields:
  10194. * - MSG_TYPE
  10195. * Bits 7:0
  10196. * Purpose: Identifies this is a extended statistics upload confirmation
  10197. * message.
  10198. * Value: 0x1c
  10199. * - COOKIE_LSBS
  10200. * Bits 31:0
  10201. * Purpose: Provide a mechanism to match a target->host stats confirmation
  10202. * message with its preceding host->target stats request message.
  10203. * Value: LSBs of the opaque cookie specified by the host-side requestor
  10204. * - COOKIE_MSBS
  10205. * Bits 31:0
  10206. * Purpose: Provide a mechanism to match a target->host stats confirmation
  10207. * message with its preceding host->target stats request message.
  10208. * Value: MSBs of the opaque cookie specified by the host-side requestor
  10209. *
  10210. * Stats Information Element tag-length header fields:
  10211. * - STAT_TYPE
  10212. * Bits 7:0
  10213. * Purpose: identifies the type of statistics info held in the
  10214. * following information element
  10215. * Value: htt_dbg_ext_stats_type
  10216. * - STATUS
  10217. * Bits 10:8
  10218. * Purpose: indicate whether the requested stats are present
  10219. * Value: htt_dbg_ext_stats_status
  10220. * - DONE
  10221. * Bits 11
  10222. * Purpose:
  10223. * Indicates the completion of the stats entry, this will be the last
  10224. * stats conf HTT segment for the requested stats type.
  10225. * Value:
  10226. * 0 -> the stats retrieval is ongoing
  10227. * 1 -> the stats retrieval is complete
  10228. * - LENGTH
  10229. * Bits 31:16
  10230. * Purpose: indicate the stats information size
  10231. * Value: This field specifies the number of bytes of stats information
  10232. * that follows the element tag-length header.
  10233. * It is expected but not required that this length is a multiple of
  10234. * 4 bytes.
  10235. */
  10236. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  10237. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  10238. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  10239. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  10240. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  10241. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  10242. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  10243. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  10244. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  10245. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  10246. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  10247. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  10248. do { \
  10249. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  10250. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  10251. } while (0)
  10252. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  10253. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  10254. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  10255. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  10256. do { \
  10257. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  10258. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  10259. } while (0)
  10260. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  10261. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  10262. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  10263. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  10264. do { \
  10265. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  10266. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  10267. } while (0)
  10268. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  10269. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  10270. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  10271. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  10272. do { \
  10273. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  10274. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  10275. } while (0)
  10276. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  10277. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  10278. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  10279. typedef enum {
  10280. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  10281. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  10282. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  10283. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  10284. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  10285. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  10286. /* Reserved from 128 - 255 for target internal use.*/
  10287. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  10288. } HTT_PEER_TYPE;
  10289. /** 2 word representation of MAC addr */
  10290. typedef struct {
  10291. /** upper 4 bytes of MAC address */
  10292. A_UINT32 mac_addr31to0;
  10293. /** lower 2 bytes of MAC address */
  10294. A_UINT32 mac_addr47to32;
  10295. } htt_mac_addr;
  10296. /** macro to convert MAC address from char array to HTT word format */
  10297. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  10298. (phtt_mac_addr)->mac_addr31to0 = \
  10299. (((c_macaddr)[0] << 0) | \
  10300. ((c_macaddr)[1] << 8) | \
  10301. ((c_macaddr)[2] << 16) | \
  10302. ((c_macaddr)[3] << 24)); \
  10303. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  10304. } while (0)
  10305. /**
  10306. * @brief target -> host monitor mac header indication message
  10307. *
  10308. * @details
  10309. * The following diagram shows the format of the monitor mac header message
  10310. * sent from the target to the host.
  10311. * This message is primarily sent when promiscuous rx mode is enabled.
  10312. * One message is sent per rx PPDU.
  10313. *
  10314. * |31 24|23 16|15 8|7 0|
  10315. * |-------------------------------------------------------------|
  10316. * | peer_id | reserved0 | msg_type |
  10317. * |-------------------------------------------------------------|
  10318. * | reserved1 | num_mpdu |
  10319. * |-------------------------------------------------------------|
  10320. * | struct hw_rx_desc |
  10321. * | (see wal_rx_desc.h) |
  10322. * |-------------------------------------------------------------|
  10323. * | struct ieee80211_frame_addr4 |
  10324. * | (see ieee80211_defs.h) |
  10325. * |-------------------------------------------------------------|
  10326. * | struct ieee80211_frame_addr4 |
  10327. * | (see ieee80211_defs.h) |
  10328. * |-------------------------------------------------------------|
  10329. * | ...... |
  10330. * |-------------------------------------------------------------|
  10331. *
  10332. * Header fields:
  10333. * - msg_type
  10334. * Bits 7:0
  10335. * Purpose: Identifies this is a monitor mac header indication message.
  10336. * Value: 0x20
  10337. * - peer_id
  10338. * Bits 31:16
  10339. * Purpose: Software peer id given by host during association,
  10340. * During promiscuous mode, the peer ID will be invalid (0xFF)
  10341. * for rx PPDUs received from unassociated peers.
  10342. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  10343. * - num_mpdu
  10344. * Bits 15:0
  10345. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  10346. * delivered within the message.
  10347. * Value: 1 to 32
  10348. * num_mpdu is limited to a maximum value of 32, due to buffer
  10349. * size limits. For PPDUs with more than 32 MPDUs, only the
  10350. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  10351. * the PPDU will be provided.
  10352. */
  10353. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  10354. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  10355. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  10356. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  10357. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  10358. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  10359. do { \
  10360. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  10361. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  10362. } while (0)
  10363. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  10364. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  10365. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  10366. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  10367. do { \
  10368. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  10369. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  10370. } while (0)
  10371. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  10372. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  10373. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  10374. /**
  10375. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE Message
  10376. *
  10377. * @details
  10378. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  10379. * the flow pool associated with the specified ID is resized
  10380. *
  10381. * The message would appear as follows:
  10382. *
  10383. * |31 16|15 8|7 0|
  10384. * |---------------------------------+----------------+----------------|
  10385. * | reserved0 | Msg type |
  10386. * |-------------------------------------------------------------------|
  10387. * | flow pool new size | flow pool ID |
  10388. * |-------------------------------------------------------------------|
  10389. *
  10390. * The message is interpreted as follows:
  10391. * b'0:7 - msg_type: This will be set to
  10392. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  10393. *
  10394. * b'0:15 - flow pool ID: Existing flow pool ID
  10395. *
  10396. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  10397. *
  10398. */
  10399. PREPACK struct htt_flow_pool_resize_t {
  10400. A_UINT32 msg_type:8,
  10401. reserved0:24;
  10402. A_UINT32 flow_pool_id:16,
  10403. flow_pool_new_size:16;
  10404. } POSTPACK;
  10405. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  10406. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  10407. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  10408. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  10409. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  10410. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  10411. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  10412. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  10413. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  10414. do { \
  10415. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  10416. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  10417. } while (0)
  10418. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  10419. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  10420. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  10421. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  10422. do { \
  10423. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  10424. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  10425. } while (0)
  10426. /**
  10427. * @brief host -> target channel change message
  10428. *
  10429. * @details
  10430. * the meesage is generated by FW every time FW changes channel. This will be used by host mainly
  10431. * to associate RX frames to correct channel they were received on.
  10432. * The following field definitions describe the format of the HTT target
  10433. * to host channel change message.
  10434. * |31 16|15 8|7 5|4 0|
  10435. * |------------------------------------------------------------|
  10436. * | reserved | MSG_TYPE |
  10437. * |------------------------------------------------------------|
  10438. * | CHAN_MHZ |
  10439. * |------------------------------------------------------------|
  10440. * | BAND_CENTER_FREQ1 |
  10441. * |------------------------------------------------------------|
  10442. * | BAND_CENTER_FREQ2 |
  10443. * |------------------------------------------------------------|
  10444. * | CHAN_PHY_MODE |
  10445. * |------------------------------------------------------------|
  10446. * Header fields:
  10447. * - MSG_TYPE
  10448. * Bits 7:0
  10449. * Value: 0xf
  10450. * - CHAN_MHZ
  10451. * Bits 31:0
  10452. * Purpose: frequency of the primary 20mhz channel.
  10453. * - BAND_CENTER_FREQ1
  10454. * Bits 31:0
  10455. * Purpose: centre frequency of the full channel.
  10456. * - BAND_CENTER_FREQ2
  10457. * Bits 31:0
  10458. * Purpose: centre frequency2 of the channel. is only valid for 11acvht 80plus80.
  10459. * - CHAN_PHY_MODE
  10460. * Bits 31:0
  10461. * Purpose: phy mode of the channel.
  10462. */
  10463. PREPACK struct htt_chan_change_msg {
  10464. A_UINT32 chan_mhz; /* frequency in mhz */
  10465. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz*/
  10466. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  10467. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  10468. } POSTPACK;
  10469. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  10470. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  10471. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  10472. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  10473. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  10474. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  10475. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  10476. /*
  10477. * The read and write indices point to the data within the host buffer.
  10478. * Because the first 4 bytes of the host buffer is used for the read index and
  10479. * the next 4 bytes for the write index, the data itself starts at offset 8.
  10480. * The read index and write index are the byte offsets from the base of the
  10481. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  10482. * Refer the ASCII text picture below.
  10483. */
  10484. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  10485. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  10486. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  10487. /*
  10488. ***************************************************************************
  10489. *
  10490. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  10491. *
  10492. ***************************************************************************
  10493. *
  10494. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  10495. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  10496. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  10497. * written into the Host memory region mentioned below.
  10498. *
  10499. * Read index is updated by the Host. At any point of time, the read index will
  10500. * indicate the index that will next be read by the Host. The read index is
  10501. * in units of bytes offset from the base of the meta-data buffer.
  10502. *
  10503. * Write index is updated by the FW. At any point of time, the write index will
  10504. * indicate from where the FW can start writing any new data. The write index is
  10505. * in units of bytes offset from the base of the meta-data buffer.
  10506. *
  10507. * If the Host is not fast enough in reading the CFR data, any new capture data
  10508. * would be dropped if there is no space left to write the new captures.
  10509. *
  10510. * The last 4 bytes of the memory region will have the magic pattern
  10511. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  10512. * not overrun the host buffer.
  10513. *
  10514. * ,--------------------. read and write indices store the
  10515. * | | byte offset from the base of the
  10516. * | ,--------+--------. meta-data buffer to the next
  10517. * | | | | location within the data buffer
  10518. * | | v v that will be read / written
  10519. * ************************************************************************
  10520. * * Read * Write * * Magic *
  10521. * * index * index * CFR data1 ...... CFR data N * pattern *
  10522. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  10523. * ************************************************************************
  10524. * |<---------- data buffer ---------->|
  10525. *
  10526. * |<----------------- meta-data buffer allocated in Host ----------------|
  10527. *
  10528. * Note:
  10529. * - Considering the 4 bytes needed to store the Read index (R) and the
  10530. * Write index (W), the initial value is as follows:
  10531. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  10532. * - Buffer empty condition:
  10533. * R = W
  10534. *
  10535. * Regarding CFR data format:
  10536. * --------------------------
  10537. *
  10538. * Each CFR tone is stored in HW as 16-bits with the following format:
  10539. * {bits[15:12], bits[11:6], bits[5:0]} =
  10540. * {unsigned exponent (4 bits),
  10541. * signed mantissa_real (6 bits),
  10542. * signed mantissa_imag (6 bits)}
  10543. *
  10544. * CFR_real = mantissa_real * 2^(exponent-5)
  10545. * CFR_imag = mantissa_imag * 2^(exponent-5)
  10546. *
  10547. *
  10548. * The CFR data is written to the 16-bit unsigned output array (buff) in
  10549. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  10550. *
  10551. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  10552. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  10553. * .
  10554. * .
  10555. * .
  10556. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  10557. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  10558. */
  10559. /* Bandwidth of peer CFR captures */
  10560. typedef enum {
  10561. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  10562. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  10563. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  10564. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  10565. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  10566. HTT_PEER_CFR_CAPTURE_BW_MAX,
  10567. } HTT_PEER_CFR_CAPTURE_BW;
  10568. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  10569. * was captured
  10570. */
  10571. typedef enum {
  10572. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  10573. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  10574. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  10575. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  10576. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  10577. } HTT_PEER_CFR_CAPTURE_MODE;
  10578. typedef enum {
  10579. /* This message type is currently used for the below purpose:
  10580. *
  10581. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  10582. * wmi_peer_cfr_capture_cmd.
  10583. * If payload_present bit is set to 0 then the associated memory region
  10584. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  10585. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  10586. * message; the CFR dump will be present at the end of the message,
  10587. * after the chan_phy_mode.
  10588. */
  10589. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  10590. /* Always keep this last */
  10591. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  10592. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  10593. /**
  10594. * @brief target -> host CFR dump completion indication message definition
  10595. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  10596. *
  10597. * @details
  10598. * The following diagram shows the format of the Channel Frequency Response
  10599. * (CFR) dump completion indication. This inidcation is sent to the Host when
  10600. * the channel capture of a peer is copied by Firmware into the Host memory
  10601. *
  10602. * **************************************************************************
  10603. *
  10604. * Message format when the CFR capture message type is
  10605. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  10606. *
  10607. * **************************************************************************
  10608. *
  10609. * |31 16|15 |8|7 0|
  10610. * |----------------------------------------------------------------|
  10611. * header: | reserved |P| msg_type |
  10612. * word 0 | | | |
  10613. * |----------------------------------------------------------------|
  10614. * payload: | cfr_capture_msg_type |
  10615. * word 1 | |
  10616. * |----------------------------------------------------------------|
  10617. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  10618. * word 2 | | | | | | | | |
  10619. * |----------------------------------------------------------------|
  10620. * | mac_addr31to0 |
  10621. * word 3 | |
  10622. * |----------------------------------------------------------------|
  10623. * | unused / reserved | mac_addr47to32 |
  10624. * word 4 | | |
  10625. * |----------------------------------------------------------------|
  10626. * | index |
  10627. * word 5 | |
  10628. * |----------------------------------------------------------------|
  10629. * | length |
  10630. * word 6 | |
  10631. * |----------------------------------------------------------------|
  10632. * | timestamp |
  10633. * word 7 | |
  10634. * |----------------------------------------------------------------|
  10635. * | counter |
  10636. * word 8 | |
  10637. * |----------------------------------------------------------------|
  10638. * | chan_mhz |
  10639. * word 9 | |
  10640. * |----------------------------------------------------------------|
  10641. * | band_center_freq1 |
  10642. * word 10 | |
  10643. * |----------------------------------------------------------------|
  10644. * | band_center_freq2 |
  10645. * word 11 | |
  10646. * |----------------------------------------------------------------|
  10647. * | chan_phy_mode |
  10648. * word 12 | |
  10649. * |----------------------------------------------------------------|
  10650. * where,
  10651. * P - payload present bit (payload_present explained below)
  10652. * req_id - memory request id (mem_req_id explained below)
  10653. * S - status field (status explained below)
  10654. * capbw - capture bandwidth (capture_bw explained below)
  10655. * mode - mode of capture (mode explained below)
  10656. * sts - space time streams (sts_count explained below)
  10657. * chbw - channel bandwidth (channel_bw explained below)
  10658. * captype - capture type (cap_type explained below)
  10659. *
  10660. * The following field definitions describe the format of the CFR dump
  10661. * completion indication sent from the target to the host
  10662. *
  10663. * Header fields:
  10664. *
  10665. * Word 0
  10666. * - msg_type
  10667. * Bits 7:0
  10668. * Purpose: Identifies this as CFR TX completion indication
  10669. * Value: HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  10670. * - payload_present
  10671. * Bit 8
  10672. * Purpose: Identifies how CFR data is sent to host
  10673. * Value: 0 - If CFR Payload is written to host memory
  10674. * 1 - If CFR Payload is sent as part of HTT message
  10675. * (This is the requirement for SDIO/USB where it is
  10676. * not possible to write CFR data to host memory)
  10677. * - reserved
  10678. * Bits 31:9
  10679. * Purpose: Reserved
  10680. * Value: 0
  10681. *
  10682. * Payload fields:
  10683. *
  10684. * Word 1
  10685. * - cfr_capture_msg_type
  10686. * Bits 31:0
  10687. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  10688. * to specify the format used for the remainder of the message
  10689. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  10690. * (currently only MSG_TYPE_1 is defined)
  10691. *
  10692. * Word 2
  10693. * - mem_req_id
  10694. * Bits 6:0
  10695. * Purpose: Contain the mem request id of the region where the CFR capture
  10696. * has been stored - of type WMI_HOST_MEM_REQ_ID
  10697. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  10698. this value is invalid)
  10699. * - status
  10700. * Bit 7
  10701. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  10702. * Value: 1 (True) - Successful; 0 (False) - Not successful
  10703. * - capture_bw
  10704. * Bits 10:8
  10705. * Purpose: Carry the bandwidth of the CFR capture
  10706. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  10707. * - mode
  10708. * Bits 13:11
  10709. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  10710. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  10711. * - sts_count
  10712. * Bits 16:14
  10713. * Purpose: Carry the number of space time streams
  10714. * Value: Number of space time streams
  10715. * - channel_bw
  10716. * Bits 19:17
  10717. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  10718. * measurement
  10719. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  10720. * - cap_type
  10721. * Bits 23:20
  10722. * Purpose: Carry the type of the capture
  10723. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  10724. * - vdev_id
  10725. * Bits 31:24
  10726. * Purpose: Carry the virtual device id
  10727. * Value: vdev ID
  10728. *
  10729. * Word 3
  10730. * - mac_addr31to0
  10731. * Bits 31:0
  10732. * Purpose: Contain the bits 31:0 of the peer MAC address
  10733. * Value: Bits 31:0 of the peer MAC address
  10734. *
  10735. * Word 4
  10736. * - mac_addr47to32
  10737. * Bits 15:0
  10738. * Purpose: Contain the bits 47:32 of the peer MAC address
  10739. * Value: Bits 47:32 of the peer MAC address
  10740. *
  10741. * Word 5
  10742. * - index
  10743. * Bits 31:0
  10744. * Purpose: Contain the index at which this CFR dump was written in the Host
  10745. * allocated memory. This index is the number of bytes from the base address.
  10746. * Value: Index position
  10747. *
  10748. * Word 6
  10749. * - length
  10750. * Bits 31:0
  10751. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  10752. * Value: Length of the CFR capture of the peer
  10753. *
  10754. * Word 7
  10755. * - timestamp
  10756. * Bits 31:0
  10757. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  10758. * clock used for this timestamp is private to the target and not visible to
  10759. * the host i.e., Host can interpret only the relative timestamp deltas from
  10760. * one message to the next, but can't interpret the absolute timestamp from a
  10761. * single message.
  10762. * Value: Timestamp in microseconds
  10763. *
  10764. * Word 8
  10765. * - counter
  10766. * Bits 31:0
  10767. * Purpose: Carry the count of the current CFR capture from FW. This is
  10768. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  10769. * in host memory)
  10770. * Value: Count of the current CFR capture
  10771. *
  10772. * Word 9
  10773. * - chan_mhz
  10774. * Bits 31:0
  10775. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  10776. * Value: Primary 20 channel frequency
  10777. *
  10778. * Word 10
  10779. * - band_center_freq1
  10780. * Bits 31:0
  10781. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  10782. * Value: Center frequency 1 in MHz
  10783. *
  10784. * Word 11
  10785. * - band_center_freq2
  10786. * Bits 31:0
  10787. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  10788. * the VDEV
  10789. * 80plus80 mode
  10790. * Value: Center frequency 2 in MHz
  10791. *
  10792. * Word 12
  10793. * - chan_phy_mode
  10794. * Bits 31:0
  10795. * Purpose: Carry the phy mode of the channel, of the VDEV
  10796. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  10797. */
  10798. PREPACK struct htt_cfr_dump_ind_type_1 {
  10799. A_UINT32 mem_req_id:7,
  10800. status:1,
  10801. capture_bw:3,
  10802. mode:3,
  10803. sts_count:3,
  10804. channel_bw:3,
  10805. cap_type:4,
  10806. vdev_id:8;
  10807. htt_mac_addr addr;
  10808. A_UINT32 index;
  10809. A_UINT32 length;
  10810. A_UINT32 timestamp;
  10811. A_UINT32 counter;
  10812. struct htt_chan_change_msg chan;
  10813. } POSTPACK;
  10814. PREPACK struct htt_cfr_dump_compl_ind {
  10815. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  10816. union {
  10817. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  10818. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  10819. /* If there is a need to change the memory layout and its associated
  10820. * HTT indication format, a new CFR capture message type can be
  10821. * introduced and added into this union.
  10822. */
  10823. };
  10824. } POSTPACK;
  10825. /*
  10826. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  10827. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  10828. */
  10829. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  10830. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  10831. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  10832. do { \
  10833. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  10834. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  10835. } while(0)
  10836. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  10837. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  10838. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  10839. /*
  10840. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  10841. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  10842. */
  10843. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  10844. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  10845. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  10846. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  10847. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  10848. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  10849. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  10850. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  10851. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  10852. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  10853. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  10854. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  10855. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  10856. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  10857. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  10858. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  10859. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  10860. do { \
  10861. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  10862. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  10863. } while (0)
  10864. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  10865. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  10866. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  10867. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  10868. do { \
  10869. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  10870. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  10871. } while (0)
  10872. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  10873. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  10874. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  10875. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  10876. do { \
  10877. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  10878. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  10879. } while (0)
  10880. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  10881. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  10882. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  10883. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  10884. do { \
  10885. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  10886. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  10887. } while (0)
  10888. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  10889. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  10890. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  10891. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  10892. do { \
  10893. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  10894. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  10895. } while (0)
  10896. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  10897. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  10898. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  10899. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  10900. do { \
  10901. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  10902. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  10903. } while (0)
  10904. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  10905. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  10906. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  10907. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  10908. do { \
  10909. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  10910. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  10911. } while (0)
  10912. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  10913. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  10914. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  10915. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  10916. do { \
  10917. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  10918. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  10919. } while (0)
  10920. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  10921. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  10922. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  10923. /**
  10924. * @brief target -> host peer (PPDU) stats message
  10925. * HTT_T2H_MSG_TYPE_PEER_STATS_IND
  10926. * @details
  10927. * This message is generated by FW when FW is sending stats to host
  10928. * about one or more PPDUs that the FW has transmitted to one or more peers.
  10929. * This message is sent autonomously by the target rather than upon request
  10930. * by the host.
  10931. * The following field definitions describe the format of the HTT target
  10932. * to host peer stats indication message.
  10933. *
  10934. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  10935. * or more PPDU stats records.
  10936. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  10937. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  10938. * then the message would start with the
  10939. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  10940. * below.
  10941. *
  10942. * |31 16|15|14|13 11|10 9|8|7 0|
  10943. * |-------------------------------------------------------------|
  10944. * | reserved |MSG_TYPE |
  10945. * |-------------------------------------------------------------|
  10946. * rec 0 | TLV header |
  10947. * rec 0 |-------------------------------------------------------------|
  10948. * rec 0 | ppdu successful bytes |
  10949. * rec 0 |-------------------------------------------------------------|
  10950. * rec 0 | ppdu retry bytes |
  10951. * rec 0 |-------------------------------------------------------------|
  10952. * rec 0 | ppdu failed bytes |
  10953. * rec 0 |-------------------------------------------------------------|
  10954. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  10955. * rec 0 |-------------------------------------------------------------|
  10956. * rec 0 | retried MSDUs | successful MSDUs |
  10957. * rec 0 |-------------------------------------------------------------|
  10958. * rec 0 | TX duration | failed MSDUs |
  10959. * rec 0 |-------------------------------------------------------------|
  10960. * ...
  10961. * |-------------------------------------------------------------|
  10962. * rec N | TLV header |
  10963. * rec N |-------------------------------------------------------------|
  10964. * rec N | ppdu successful bytes |
  10965. * rec N |-------------------------------------------------------------|
  10966. * rec N | ppdu retry bytes |
  10967. * rec N |-------------------------------------------------------------|
  10968. * rec N | ppdu failed bytes |
  10969. * rec N |-------------------------------------------------------------|
  10970. * rec N | peer id | S|SG| BW | BA |A|rate code|
  10971. * rec N |-------------------------------------------------------------|
  10972. * rec N | retried MSDUs | successful MSDUs |
  10973. * rec N |-------------------------------------------------------------|
  10974. * rec N | TX duration | failed MSDUs |
  10975. * rec N |-------------------------------------------------------------|
  10976. *
  10977. * where:
  10978. * A = is A-MPDU flag
  10979. * BA = block-ack failure flags
  10980. * BW = bandwidth spec
  10981. * SG = SGI enabled spec
  10982. * S = skipped rate ctrl
  10983. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  10984. *
  10985. * Header
  10986. * ------
  10987. * dword0 - b'0:7 - msg_type : HTT_T2H_MSG_TYPE_PEER_STATS_IND
  10988. * dword0 - b'8:31 - reserved : Reserved for future use
  10989. *
  10990. * payload include below peer_stats information
  10991. * --------------------------------------------
  10992. * @TLV : HTT_PPDU_STATS_INFO_TLV
  10993. * @tx_success_bytes : total successful bytes in the PPDU.
  10994. * @tx_retry_bytes : total retried bytes in the PPDU.
  10995. * @tx_failed_bytes : total failed bytes in the PPDU.
  10996. * @tx_ratecode : rate code used for the PPDU.
  10997. * @is_ampdu : Indicates PPDU is AMPDU or not.
  10998. * @ba_ack_failed : BA/ACK failed for this PPDU
  10999. * b00 -> BA received
  11000. * b01 -> BA failed once
  11001. * b10 -> BA failed twice, when HW retry is enabled.
  11002. * @bw : BW
  11003. * b00 -> 20 MHz
  11004. * b01 -> 40 MHz
  11005. * b10 -> 80 MHz
  11006. * b11 -> 160 MHz (or 80+80)
  11007. * @sg : SGI enabled
  11008. * @s : skipped ratectrl
  11009. * @peer_id : peer id
  11010. * @tx_success_msdus : successful MSDUs
  11011. * @tx_retry_msdus : retried MSDUs
  11012. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  11013. * @tx_duration : Tx duration for the PPDU (microsecond units)
  11014. */
  11015. /**
  11016. * @brief HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID Message
  11017. *
  11018. * @details
  11019. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  11020. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  11021. * This message will only be sent if the backpressure condition has existed
  11022. * continuously for an initial period (100 ms).
  11023. * Repeat messages with updated information will be sent after each
  11024. * subsequent period (100 ms) as long as the backpressure remains unabated.
  11025. * This message indicates the ring id along with current head and tail index
  11026. * locations (i.e. write and read indices).
  11027. * The backpressure time indicates the time in ms for which continous
  11028. * backpressure has been observed in the ring.
  11029. *
  11030. * The message format is as follows:
  11031. *
  11032. * |31 24|23 16|15 8|7 0|
  11033. * |----------------+----------------+----------------+----------------|
  11034. * | ring_id | ring_type | pdev_id | msg_type |
  11035. * |-------------------------------------------------------------------|
  11036. * | tail_idx | head_idx |
  11037. * |-------------------------------------------------------------------|
  11038. * | backpressure_time_ms |
  11039. * |-------------------------------------------------------------------|
  11040. *
  11041. * The message is interpreted as follows:
  11042. * dword0 - b'0:7 - msg_type: This will be set to
  11043. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  11044. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  11045. * 1, 2, 3 indicates pdev_id 0,1,2 and
  11046. the msg is for LMAC ring.
  11047. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  11048. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  11049. * htt_backpressure_lmac_ring_id. This represents
  11050. * the ring id for which continous backpressure is seen
  11051. *
  11052. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  11053. * the ring indicated by the ring_id
  11054. *
  11055. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  11056. * the ring indicated by the ring id
  11057. *
  11058. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  11059. * backpressure has been seen in the ring
  11060. * indicated by the ring_id.
  11061. * Units = milliseconds
  11062. */
  11063. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  11064. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  11065. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  11066. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  11067. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  11068. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  11069. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  11070. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  11071. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  11072. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  11073. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  11074. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  11075. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  11076. do { \
  11077. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  11078. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  11079. } while (0)
  11080. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  11081. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  11082. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  11083. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  11084. do { \
  11085. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  11086. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  11087. } while (0)
  11088. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  11089. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  11090. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  11091. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  11092. do { \
  11093. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  11094. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  11095. } while (0)
  11096. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  11097. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  11098. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  11099. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  11100. do { \
  11101. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  11102. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  11103. } while (0)
  11104. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  11105. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  11106. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  11107. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  11108. do { \
  11109. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  11110. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  11111. } while (0)
  11112. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  11113. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  11114. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  11115. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  11116. do { \
  11117. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  11118. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  11119. } while (0)
  11120. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  11121. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  11122. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  11123. enum htt_backpressure_ring_type {
  11124. HTT_SW_RING_TYPE_UMAC,
  11125. HTT_SW_RING_TYPE_LMAC,
  11126. HTT_SW_RING_TYPE_MAX,
  11127. };
  11128. /* Ring id for which the message is sent to host */
  11129. enum htt_backpressure_umac_ringid {
  11130. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  11131. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  11132. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  11133. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  11134. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  11135. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  11136. HTT_SW_RING_IDX_REO_REO2FW_RING,
  11137. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  11138. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  11139. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  11140. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  11141. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  11142. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  11143. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  11144. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  11145. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  11146. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  11147. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  11148. HTT_SW_UMAC_RING_IDX_MAX,
  11149. };
  11150. enum htt_backpressure_lmac_ringid {
  11151. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  11152. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  11153. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  11154. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  11155. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  11156. HTT_SW_RING_IDX_RXDMA2FW_RING,
  11157. HTT_SW_RING_IDX_RXDMA2SW_RING,
  11158. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  11159. HTT_SW_RING_IDX_RXDMA2REO_RING,
  11160. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  11161. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  11162. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  11163. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  11164. HTT_SW_LMAC_RING_IDX_MAX,
  11165. };
  11166. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  11167. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  11168. pdev_id: 8,
  11169. ring_type: 8, /* htt_backpressure_ring_type */
  11170. /*
  11171. * ring_id holds an enum value from either
  11172. * htt_backpressure_umac_ringid or
  11173. * htt_backpressure_lmac_ringid, based on
  11174. * the ring_type setting.
  11175. */
  11176. ring_id: 8;
  11177. A_UINT16 head_idx;
  11178. A_UINT16 tail_idx;
  11179. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  11180. } POSTPACK;
  11181. #endif