htt.h 592 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195
  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. * 3.68 Add ipa_drop threshold fields to HTT_H2T_MSG_TYPE_SRING_SETUP
  183. * 3.69 Add htt_ul_ofdma_user_info_v0 defs
  184. * 3.70 Add AST1-AST3 fields to HTT_T2H PEER_MAP_V2 msg
  185. * 3.71 Add rx offload engine / flow search engine htt setup message defs for
  186. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG, HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  187. */
  188. #define HTT_CURRENT_VERSION_MAJOR 3
  189. #define HTT_CURRENT_VERSION_MINOR 71
  190. #define HTT_NUM_TX_FRAG_DESC 1024
  191. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  192. #define HTT_CHECK_SET_VAL(field, val) \
  193. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  194. /* macros to assist in sign-extending fields from HTT messages */
  195. #define HTT_SIGN_BIT_MASK(field) \
  196. ((field ## _M + (1 << field ## _S)) >> 1)
  197. #define HTT_SIGN_BIT(_val, field) \
  198. (_val & HTT_SIGN_BIT_MASK(field))
  199. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  200. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  201. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  202. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  203. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  204. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  205. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  206. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  207. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  208. /*
  209. * TEMPORARY:
  210. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  211. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  212. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  213. * updated.
  214. */
  215. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  216. /*
  217. * TEMPORARY:
  218. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  219. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  220. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  221. * updated.
  222. */
  223. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  224. /* HTT Access Category values */
  225. enum HTT_AC_WMM {
  226. /* WMM Access Categories */
  227. HTT_AC_WMM_BE = 0x0,
  228. HTT_AC_WMM_BK = 0x1,
  229. HTT_AC_WMM_VI = 0x2,
  230. HTT_AC_WMM_VO = 0x3,
  231. /* extension Access Categories */
  232. HTT_AC_EXT_NON_QOS = 0x4,
  233. HTT_AC_EXT_UCAST_MGMT = 0x5,
  234. HTT_AC_EXT_MCAST_DATA = 0x6,
  235. HTT_AC_EXT_MCAST_MGMT = 0x7,
  236. };
  237. enum HTT_AC_WMM_MASK {
  238. /* WMM Access Categories */
  239. HTT_AC_WMM_BE_MASK = (1 << HTT_AC_WMM_BE),
  240. HTT_AC_WMM_BK_MASK = (1 << HTT_AC_WMM_BK),
  241. HTT_AC_WMM_VI_MASK = (1 << HTT_AC_WMM_VI),
  242. HTT_AC_WMM_VO_MASK = (1 << HTT_AC_WMM_VO),
  243. /* extension Access Categories */
  244. HTT_AC_EXT_NON_QOS_MASK = (1 << HTT_AC_EXT_NON_QOS),
  245. HTT_AC_EXT_UCAST_MGMT_MASK = (1 << HTT_AC_EXT_UCAST_MGMT),
  246. HTT_AC_EXT_MCAST_DATA_MASK = (1 << HTT_AC_EXT_MCAST_DATA),
  247. HTT_AC_EXT_MCAST_MGMT_MASK = (1 << HTT_AC_EXT_MCAST_MGMT),
  248. };
  249. #define HTT_AC_MASK_WMM \
  250. (HTT_AC_WMM_BE_MASK | HTT_AC_WMM_BK_MASK | \
  251. HTT_AC_WMM_VI_MASK | HTT_AC_WMM_VO_MASK)
  252. #define HTT_AC_MASK_EXT \
  253. (HTT_AC_EXT_NON_QOS_MASK | HTT_AC_EXT_UCAST_MGMT_MASK | \
  254. HTT_AC_EXT_MCAST_DATA_MASK | HTT_AC_EXT_MCAST_MGMT_MASK)
  255. #define HTT_AC_MASK_ALL (HTT_AC_MASK_WMM | HTT_AC_MASK_EXT)
  256. /*
  257. * htt_dbg_stats_type -
  258. * bit positions for each stats type within a stats type bitmask
  259. * The bitmask contains 24 bits.
  260. */
  261. enum htt_dbg_stats_type {
  262. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  263. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  264. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  265. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  266. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  267. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  268. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  269. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  270. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  271. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  272. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  273. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  274. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  275. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  276. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  277. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  278. /* bits 16-23 currently reserved */
  279. /* keep this last */
  280. HTT_DBG_NUM_STATS
  281. };
  282. /*=== HTT option selection TLVs ===
  283. * Certain HTT messages have alternatives or options.
  284. * For such cases, the host and target need to agree on which option to use.
  285. * Option specification TLVs can be appended to the VERSION_REQ and
  286. * VERSION_CONF messages to select options other than the default.
  287. * These TLVs are entirely optional - if they are not provided, there is a
  288. * well-defined default for each option. If they are provided, they can be
  289. * provided in any order. Each TLV can be present or absent independent of
  290. * the presence / absence of other TLVs.
  291. *
  292. * The HTT option selection TLVs use the following format:
  293. * |31 16|15 8|7 0|
  294. * |---------------------------------+----------------+----------------|
  295. * | value (payload) | length | tag |
  296. * |-------------------------------------------------------------------|
  297. * The value portion need not be only 2 bytes; it can be extended by any
  298. * integer number of 4-byte units. The total length of the TLV, including
  299. * the tag and length fields, must be a multiple of 4 bytes. The length
  300. * field specifies the total TLV size in 4-byte units. Thus, the typical
  301. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  302. * field, would store 0x1 in its length field, to show that the TLV occupies
  303. * a single 4-byte unit.
  304. */
  305. /*--- TLV header format - applies to all HTT option TLVs ---*/
  306. enum HTT_OPTION_TLV_TAGS {
  307. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  308. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  309. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  310. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  311. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  312. };
  313. PREPACK struct htt_option_tlv_header_t {
  314. A_UINT8 tag;
  315. A_UINT8 length;
  316. } POSTPACK;
  317. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  318. #define HTT_OPTION_TLV_TAG_S 0
  319. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  320. #define HTT_OPTION_TLV_LENGTH_S 8
  321. /*
  322. * value0 - 16 bit value field stored in word0
  323. * The TLV's value field may be longer than 2 bytes, in which case
  324. * the remainder of the value is stored in word1, word2, etc.
  325. */
  326. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  327. #define HTT_OPTION_TLV_VALUE0_S 16
  328. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  329. do { \
  330. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  331. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  332. } while (0)
  333. #define HTT_OPTION_TLV_TAG_GET(word) \
  334. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  335. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  336. do { \
  337. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  338. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  339. } while (0)
  340. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  341. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  342. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  343. do { \
  344. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  345. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  346. } while (0)
  347. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  348. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  349. /*--- format of specific HTT option TLVs ---*/
  350. /*
  351. * HTT option TLV for specifying LL bus address size
  352. * Some chips require bus addresses used by the target to access buffers
  353. * within the host's memory to be 32 bits; others require bus addresses
  354. * used by the target to access buffers within the host's memory to be
  355. * 64 bits.
  356. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  357. * a suffix to the VERSION_CONF message to specify which bus address format
  358. * the target requires.
  359. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  360. * default to providing bus addresses to the target in 32-bit format.
  361. */
  362. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  363. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  364. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  365. };
  366. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  367. struct htt_option_tlv_header_t hdr;
  368. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  369. } POSTPACK;
  370. /*
  371. * HTT option TLV for specifying whether HL systems should indicate
  372. * over-the-air tx completion for individual frames, or should instead
  373. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  374. * requests an OTA tx completion for a particular tx frame.
  375. * This option does not apply to LL systems, where the TX_COMPL_IND
  376. * is mandatory.
  377. * This option is primarily intended for HL systems in which the tx frame
  378. * downloads over the host --> target bus are as slow as or slower than
  379. * the transmissions over the WLAN PHY. For cases where the bus is faster
  380. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  381. * and consquently will send one TX_COMPL_IND message that covers several
  382. * tx frames. For cases where the WLAN PHY is faster than the bus,
  383. * the target will end up transmitting very short A-MPDUs, and consequently
  384. * sending many TX_COMPL_IND messages, which each cover a very small number
  385. * of tx frames.
  386. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  387. * a suffix to the VERSION_REQ message to request whether the host desires to
  388. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  389. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  390. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  391. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  392. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  393. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  394. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  395. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  396. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  397. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  398. * TLV.
  399. */
  400. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  401. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  402. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  403. };
  404. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  405. struct htt_option_tlv_header_t hdr;
  406. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  407. } POSTPACK;
  408. /*
  409. * HTT option TLV for specifying how many tx queue groups the target
  410. * may establish.
  411. * This TLV specifies the maximum value the target may send in the
  412. * txq_group_id field of any TXQ_GROUP information elements sent by
  413. * the target to the host. This allows the host to pre-allocate an
  414. * appropriate number of tx queue group structs.
  415. *
  416. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  417. * a suffix to the VERSION_REQ message to specify whether the host supports
  418. * tx queue groups at all, and if so if there is any limit on the number of
  419. * tx queue groups that the host supports.
  420. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  421. * a suffix to the VERSION_CONF message. If the host has specified in the
  422. * VER_REQ message a limit on the number of tx queue groups the host can
  423. * supprt, the target shall limit its specification of the maximum tx groups
  424. * to be no larger than this host-specified limit.
  425. *
  426. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  427. * shall preallocate 4 tx queue group structs, and the target shall not
  428. * specify a txq_group_id larger than 3.
  429. */
  430. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  431. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  432. /*
  433. * values 1 through N specify the max number of tx queue groups
  434. * the sender supports
  435. */
  436. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  437. };
  438. /* TEMPORARY backwards-compatibility alias for a typo fix -
  439. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  440. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  441. * to support the old name (with the typo) until all references to the
  442. * old name are replaced with the new name.
  443. */
  444. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  445. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  446. struct htt_option_tlv_header_t hdr;
  447. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  448. } POSTPACK;
  449. /*
  450. * HTT option TLV for specifying whether the target supports an extended
  451. * version of the HTT tx descriptor. If the target provides this TLV
  452. * and specifies in the TLV that the target supports an extended version
  453. * of the HTT tx descriptor, the target must check the "extension" bit in
  454. * the HTT tx descriptor, and if the extension bit is set, to expect a
  455. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  456. * descriptor. Furthermore, the target must provide room for the HTT
  457. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  458. * This option is intended for systems where the host needs to explicitly
  459. * control the transmission parameters such as tx power for individual
  460. * tx frames.
  461. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  462. * as a suffix to the VERSION_CONF message to explicitly specify whether
  463. * the target supports the HTT tx MSDU extension descriptor.
  464. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  465. * by the host as lack of target support for the HTT tx MSDU extension
  466. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  467. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  468. * the HTT tx MSDU extension descriptor.
  469. * The host is not required to provide the HTT tx MSDU extension descriptor
  470. * just because the target supports it; the target must check the
  471. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  472. * extension descriptor is present.
  473. */
  474. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  475. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  476. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  477. };
  478. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  479. struct htt_option_tlv_header_t hdr;
  480. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  481. } POSTPACK;
  482. /*=== host -> target messages ===============================================*/
  483. enum htt_h2t_msg_type {
  484. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  485. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  486. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  487. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  488. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  489. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  490. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  491. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  492. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  493. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  494. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  495. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  496. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  497. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  498. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  499. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  500. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  501. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  502. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  503. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  504. /* keep this last */
  505. HTT_H2T_NUM_MSGS
  506. };
  507. /*
  508. * HTT host to target message type -
  509. * stored in bits 7:0 of the first word of the message
  510. */
  511. #define HTT_H2T_MSG_TYPE_M 0xff
  512. #define HTT_H2T_MSG_TYPE_S 0
  513. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  514. do { \
  515. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  516. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  517. } while (0)
  518. #define HTT_H2T_MSG_TYPE_GET(word) \
  519. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  520. /**
  521. * @brief host -> target version number request message definition
  522. *
  523. * |31 24|23 16|15 8|7 0|
  524. * |----------------+----------------+----------------+----------------|
  525. * | reserved | msg type |
  526. * |-------------------------------------------------------------------|
  527. * : option request TLV (optional) |
  528. * :...................................................................:
  529. *
  530. * The VER_REQ message may consist of a single 4-byte word, or may be
  531. * extended with TLVs that specify which HTT options the host is requesting
  532. * from the target.
  533. * The following option TLVs may be appended to the VER_REQ message:
  534. * - HL_SUPPRESS_TX_COMPL_IND
  535. * - HL_MAX_TX_QUEUE_GROUPS
  536. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  537. * may be appended to the VER_REQ message (but only one TLV of each type).
  538. *
  539. * Header fields:
  540. * - MSG_TYPE
  541. * Bits 7:0
  542. * Purpose: identifies this as a version number request message
  543. * Value: 0x0
  544. */
  545. #define HTT_VER_REQ_BYTES 4
  546. /* TBDXXX: figure out a reasonable number */
  547. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  548. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  549. /**
  550. * @brief HTT tx MSDU descriptor
  551. *
  552. * @details
  553. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  554. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  555. * the target firmware needs for the FW's tx processing, particularly
  556. * for creating the HW msdu descriptor.
  557. * The same HTT tx descriptor is used for HL and LL systems, though
  558. * a few fields within the tx descriptor are used only by LL or
  559. * only by HL.
  560. * The HTT tx descriptor is defined in two manners: by a struct with
  561. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  562. * definitions.
  563. * The target should use the struct def, for simplicitly and clarity,
  564. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  565. * neutral. Specifically, the host shall use the get/set macros built
  566. * around the mask + shift defs.
  567. */
  568. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  569. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  570. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  571. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  572. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  573. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  574. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  575. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  576. #define HTT_TX_VDEV_ID_WORD 0
  577. #define HTT_TX_VDEV_ID_MASK 0x3f
  578. #define HTT_TX_VDEV_ID_SHIFT 16
  579. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  580. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  581. #define HTT_TX_MSDU_LEN_DWORD 1
  582. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  583. /*
  584. * HTT_VAR_PADDR macros
  585. * Allow physical / bus addresses to be either a single 32-bit value,
  586. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  587. */
  588. #define HTT_VAR_PADDR32(var_name) \
  589. A_UINT32 var_name
  590. #define HTT_VAR_PADDR64_LE(var_name) \
  591. struct { \
  592. /* little-endian: lo precedes hi */ \
  593. A_UINT32 lo; \
  594. A_UINT32 hi; \
  595. } var_name
  596. /*
  597. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  598. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  599. * addresses are stored in a XXX-bit field.
  600. * This macro is used to define both htt_tx_msdu_desc32_t and
  601. * htt_tx_msdu_desc64_t structs.
  602. */
  603. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  604. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  605. { \
  606. /* DWORD 0: flags and meta-data */ \
  607. A_UINT32 \
  608. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  609. \
  610. /* pkt_subtype - \
  611. * Detailed specification of the tx frame contents, extending the \
  612. * general specification provided by pkt_type. \
  613. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  614. * pkt_type | pkt_subtype \
  615. * ============================================================== \
  616. * 802.3 | bit 0:3 - Reserved \
  617. * | bit 4: 0x0 - Copy-Engine Classification Results \
  618. * | not appended to the HTT message \
  619. * | 0x1 - Copy-Engine Classification Results \
  620. * | appended to the HTT message in the \
  621. * | format: \
  622. * | [HTT tx desc, frame header, \
  623. * | CE classification results] \
  624. * | The CE classification results begin \
  625. * | at the next 4-byte boundary after \
  626. * | the frame header. \
  627. * ------------+------------------------------------------------- \
  628. * Eth2 | bit 0:3 - Reserved \
  629. * | bit 4: 0x0 - Copy-Engine Classification Results \
  630. * | not appended to the HTT message \
  631. * | 0x1 - Copy-Engine Classification Results \
  632. * | appended to the HTT message. \
  633. * | See the above specification of the \
  634. * | CE classification results location. \
  635. * ------------+------------------------------------------------- \
  636. * native WiFi | bit 0:3 - Reserved \
  637. * | bit 4: 0x0 - Copy-Engine Classification Results \
  638. * | not appended to the HTT message \
  639. * | 0x1 - Copy-Engine Classification Results \
  640. * | appended to the HTT message. \
  641. * | See the above specification of the \
  642. * | CE classification results location. \
  643. * ------------+------------------------------------------------- \
  644. * mgmt | 0x0 - 802.11 MAC header absent \
  645. * | 0x1 - 802.11 MAC header present \
  646. * ------------+------------------------------------------------- \
  647. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  648. * | 0x1 - 802.11 MAC header present \
  649. * | bit 1: 0x0 - allow aggregation \
  650. * | 0x1 - don't allow aggregation \
  651. * | bit 2: 0x0 - perform encryption \
  652. * | 0x1 - don't perform encryption \
  653. * | bit 3: 0x0 - perform tx classification / queuing \
  654. * | 0x1 - don't perform tx classification; \
  655. * | insert the frame into the "misc" \
  656. * | tx queue \
  657. * | bit 4: 0x0 - Copy-Engine Classification Results \
  658. * | not appended to the HTT message \
  659. * | 0x1 - Copy-Engine Classification Results \
  660. * | appended to the HTT message. \
  661. * | See the above specification of the \
  662. * | CE classification results location. \
  663. */ \
  664. pkt_subtype: 5, \
  665. \
  666. /* pkt_type - \
  667. * General specification of the tx frame contents. \
  668. * The htt_pkt_type enum should be used to specify and check the \
  669. * value of this field. \
  670. */ \
  671. pkt_type: 3, \
  672. \
  673. /* vdev_id - \
  674. * ID for the vdev that is sending this tx frame. \
  675. * For certain non-standard packet types, e.g. pkt_type == raw \
  676. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  677. * This field is used primarily for determining where to queue \
  678. * broadcast and multicast frames. \
  679. */ \
  680. vdev_id: 6, \
  681. /* ext_tid - \
  682. * The extended traffic ID. \
  683. * If the TID is unknown, the extended TID is set to \
  684. * HTT_TX_EXT_TID_INVALID. \
  685. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  686. * value of the QoS TID. \
  687. * If the tx frame is non-QoS data, then the extended TID is set to \
  688. * HTT_TX_EXT_TID_NON_QOS. \
  689. * If the tx frame is multicast or broadcast, then the extended TID \
  690. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  691. */ \
  692. ext_tid: 5, \
  693. \
  694. /* postponed - \
  695. * This flag indicates whether the tx frame has been downloaded to \
  696. * the target before but discarded by the target, and now is being \
  697. * downloaded again; or if this is a new frame that is being \
  698. * downloaded for the first time. \
  699. * This flag allows the target to determine the correct order for \
  700. * transmitting new vs. old frames. \
  701. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  702. * This flag only applies to HL systems, since in LL systems, \
  703. * the tx flow control is handled entirely within the target. \
  704. */ \
  705. postponed: 1, \
  706. \
  707. /* extension - \
  708. * This flag indicates whether a HTT tx MSDU extension descriptor \
  709. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  710. * \
  711. * 0x0 - no extension MSDU descriptor is present \
  712. * 0x1 - an extension MSDU descriptor immediately follows the \
  713. * regular MSDU descriptor \
  714. */ \
  715. extension: 1, \
  716. \
  717. /* cksum_offload - \
  718. * This flag indicates whether checksum offload is enabled or not \
  719. * for this frame. Target FW use this flag to turn on HW checksumming \
  720. * 0x0 - No checksum offload \
  721. * 0x1 - L3 header checksum only \
  722. * 0x2 - L4 checksum only \
  723. * 0x3 - L3 header checksum + L4 checksum \
  724. */ \
  725. cksum_offload: 2, \
  726. \
  727. /* tx_comp_req - \
  728. * This flag indicates whether Tx Completion \
  729. * from fw is required or not. \
  730. * This flag is only relevant if tx completion is not \
  731. * universally enabled. \
  732. * For all LL systems, tx completion is mandatory, \
  733. * so this flag will be irrelevant. \
  734. * For HL systems tx completion is optional, but HL systems in which \
  735. * the bus throughput exceeds the WLAN throughput will \
  736. * probably want to always use tx completion, and thus \
  737. * would not check this flag. \
  738. * This flag is required when tx completions are not used universally, \
  739. * but are still required for certain tx frames for which \
  740. * an OTA delivery acknowledgment is needed by the host. \
  741. * In practice, this would be for HL systems in which the \
  742. * bus throughput is less than the WLAN throughput. \
  743. * \
  744. * 0x0 - Tx Completion Indication from Fw not required \
  745. * 0x1 - Tx Completion Indication from Fw is required \
  746. */ \
  747. tx_compl_req: 1; \
  748. \
  749. \
  750. /* DWORD 1: MSDU length and ID */ \
  751. A_UINT32 \
  752. len: 16, /* MSDU length, in bytes */ \
  753. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  754. * and this id is used to calculate fragmentation \
  755. * descriptor pointer inside the target based on \
  756. * the base address, configured inside the target. \
  757. */ \
  758. \
  759. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  760. /* frags_desc_ptr - \
  761. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  762. * where the tx frame's fragments reside in memory. \
  763. * This field only applies to LL systems, since in HL systems the \
  764. * (degenerate single-fragment) fragmentation descriptor is created \
  765. * within the target. \
  766. */ \
  767. _paddr__frags_desc_ptr_; \
  768. \
  769. /* DWORD 3 (or 4): peerid, chanfreq */ \
  770. /* \
  771. * Peer ID : Target can use this value to know which peer-id packet \
  772. * destined to. \
  773. * It's intended to be specified by host in case of NAWDS. \
  774. */ \
  775. A_UINT16 peerid; \
  776. \
  777. /* \
  778. * Channel frequency: This identifies the desired channel \
  779. * frequency (in mhz) for tx frames. This is used by FW to help \
  780. * determine when it is safe to transmit or drop frames for \
  781. * off-channel operation. \
  782. * The default value of zero indicates to FW that the corresponding \
  783. * VDEV's home channel (if there is one) is the desired channel \
  784. * frequency. \
  785. */ \
  786. A_UINT16 chanfreq; \
  787. \
  788. /* Reason reserved is commented is increasing the htt structure size \
  789. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  790. * A_UINT32 reserved_dword3_bits0_31; \
  791. */ \
  792. } POSTPACK
  793. /* define a htt_tx_msdu_desc32_t type */
  794. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  795. /* define a htt_tx_msdu_desc64_t type */
  796. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  797. /*
  798. * Make htt_tx_msdu_desc_t be an alias for either
  799. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  800. */
  801. #if HTT_PADDR64
  802. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  803. #else
  804. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  805. #endif
  806. /* decriptor information for Management frame*/
  807. /*
  808. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  809. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  810. */
  811. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  812. extern A_UINT32 mgmt_hdr_len;
  813. PREPACK struct htt_mgmt_tx_desc_t {
  814. A_UINT32 msg_type;
  815. #if HTT_PADDR64
  816. A_UINT64 frag_paddr; /* DMAble address of the data */
  817. #else
  818. A_UINT32 frag_paddr; /* DMAble address of the data */
  819. #endif
  820. A_UINT32 desc_id; /* returned to host during completion
  821. * to free the meory*/
  822. A_UINT32 len; /* Fragment length */
  823. A_UINT32 vdev_id; /* virtual device ID*/
  824. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  825. } POSTPACK;
  826. PREPACK struct htt_mgmt_tx_compl_ind {
  827. A_UINT32 desc_id;
  828. A_UINT32 status;
  829. } POSTPACK;
  830. /*
  831. * This SDU header size comes from the summation of the following:
  832. * 1. Max of:
  833. * a. Native WiFi header, for native WiFi frames: 24 bytes
  834. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  835. * b. 802.11 header, for raw frames: 36 bytes
  836. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  837. * QoS header, HT header)
  838. * c. 802.3 header, for ethernet frames: 14 bytes
  839. * (destination address, source address, ethertype / length)
  840. * 2. Max of:
  841. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  842. * b. IPv6 header, up through the Traffic Class: 2 bytes
  843. * 3. 802.1Q VLAN header: 4 bytes
  844. * 4. LLC/SNAP header: 8 bytes
  845. */
  846. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  847. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  848. #define HTT_TX_HDR_SIZE_ETHERNET 14
  849. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  850. A_COMPILE_TIME_ASSERT(
  851. htt_encap_hdr_size_max_check_nwifi,
  852. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  853. A_COMPILE_TIME_ASSERT(
  854. htt_encap_hdr_size_max_check_enet,
  855. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  856. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  857. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  858. #define HTT_TX_HDR_SIZE_802_1Q 4
  859. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  860. #define HTT_COMMON_TX_FRM_HDR_LEN \
  861. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  862. HTT_TX_HDR_SIZE_802_1Q + \
  863. HTT_TX_HDR_SIZE_LLC_SNAP)
  864. #define HTT_HL_TX_FRM_HDR_LEN \
  865. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  866. #define HTT_LL_TX_FRM_HDR_LEN \
  867. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  868. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  869. /* dword 0 */
  870. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  871. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  872. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  873. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  874. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  875. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  876. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  877. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  878. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  879. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  880. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  881. #define HTT_TX_DESC_PKT_TYPE_S 13
  882. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  883. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  884. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  885. #define HTT_TX_DESC_VDEV_ID_S 16
  886. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  887. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  888. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  889. #define HTT_TX_DESC_EXT_TID_S 22
  890. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  891. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  892. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  893. #define HTT_TX_DESC_POSTPONED_S 27
  894. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  895. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  896. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  897. #define HTT_TX_DESC_EXTENSION_S 28
  898. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  899. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  900. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  901. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  902. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  903. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  904. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  905. #define HTT_TX_DESC_TX_COMP_S 31
  906. /* dword 1 */
  907. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  908. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  909. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  910. #define HTT_TX_DESC_FRM_LEN_S 0
  911. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  912. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  913. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  914. #define HTT_TX_DESC_FRM_ID_S 16
  915. /* dword 2 */
  916. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  917. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  918. /* for systems using 64-bit format for bus addresses */
  919. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  920. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  921. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  922. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  923. /* for systems using 32-bit format for bus addresses */
  924. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  925. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  926. /* dword 3 */
  927. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  928. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  929. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  930. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  931. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  932. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  933. #if HTT_PADDR64
  934. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  935. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  936. #else
  937. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  938. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  939. #endif
  940. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  941. #define HTT_TX_DESC_PEER_ID_S 0
  942. /*
  943. * TEMPORARY:
  944. * The original definitions for the PEER_ID fields contained typos
  945. * (with _DESC_PADDR appended to this PEER_ID field name).
  946. * Retain deprecated original names for PEER_ID fields until all code that
  947. * refers to them has been updated.
  948. */
  949. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  950. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  951. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  952. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  953. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  954. HTT_TX_DESC_PEER_ID_M
  955. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  956. HTT_TX_DESC_PEER_ID_S
  957. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  958. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  959. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  960. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  961. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  962. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  963. #if HTT_PADDR64
  964. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  965. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  966. #else
  967. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  968. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  969. #endif
  970. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  971. #define HTT_TX_DESC_CHAN_FREQ_S 16
  972. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  973. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  974. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  975. do { \
  976. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  977. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  978. } while (0)
  979. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  980. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  981. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  982. do { \
  983. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  984. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  985. } while (0)
  986. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  987. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  988. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  989. do { \
  990. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  991. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  992. } while (0)
  993. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  994. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  995. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  996. do { \
  997. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  998. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  999. } while (0)
  1000. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1001. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1002. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1003. do { \
  1004. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1005. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1006. } while (0)
  1007. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1008. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1009. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1010. do { \
  1011. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1012. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1013. } while (0)
  1014. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1015. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1016. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1017. do { \
  1018. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1019. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1020. } while (0)
  1021. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1022. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1023. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1024. do { \
  1025. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1026. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1027. } while (0)
  1028. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1029. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1030. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1031. do { \
  1032. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1033. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1034. } while (0)
  1035. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1036. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1037. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1038. do { \
  1039. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1040. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1041. } while (0)
  1042. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1043. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1044. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1045. do { \
  1046. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1047. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1048. } while (0)
  1049. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1050. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1051. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1052. do { \
  1053. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1054. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1055. } while (0)
  1056. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1057. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1058. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1059. do { \
  1060. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1061. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1062. } while (0)
  1063. /* enums used in the HTT tx MSDU extension descriptor */
  1064. enum {
  1065. htt_tx_guard_interval_regular = 0,
  1066. htt_tx_guard_interval_short = 1,
  1067. };
  1068. enum {
  1069. htt_tx_preamble_type_ofdm = 0,
  1070. htt_tx_preamble_type_cck = 1,
  1071. htt_tx_preamble_type_ht = 2,
  1072. htt_tx_preamble_type_vht = 3,
  1073. };
  1074. enum {
  1075. htt_tx_bandwidth_5MHz = 0,
  1076. htt_tx_bandwidth_10MHz = 1,
  1077. htt_tx_bandwidth_20MHz = 2,
  1078. htt_tx_bandwidth_40MHz = 3,
  1079. htt_tx_bandwidth_80MHz = 4,
  1080. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1081. };
  1082. /**
  1083. * @brief HTT tx MSDU extension descriptor
  1084. * @details
  1085. * If the target supports HTT tx MSDU extension descriptors, the host has
  1086. * the option of appending the following struct following the regular
  1087. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1088. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1089. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1090. * tx specs for each frame.
  1091. */
  1092. PREPACK struct htt_tx_msdu_desc_ext_t {
  1093. /* DWORD 0: flags */
  1094. A_UINT32
  1095. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1096. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1097. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1098. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1099. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1100. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1101. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1102. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1103. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1104. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1105. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1106. /* DWORD 1: tx power, tx rate, tx BW */
  1107. A_UINT32
  1108. /* pwr -
  1109. * Specify what power the tx frame needs to be transmitted at.
  1110. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1111. * The value needs to be appropriately sign-extended when extracting
  1112. * the value from the message and storing it in a variable that is
  1113. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1114. * automatically handles this sign-extension.)
  1115. * If the transmission uses multiple tx chains, this power spec is
  1116. * the total transmit power, assuming incoherent combination of
  1117. * per-chain power to produce the total power.
  1118. */
  1119. pwr: 8,
  1120. /* mcs_mask -
  1121. * Specify the allowable values for MCS index (modulation and coding)
  1122. * to use for transmitting the frame.
  1123. *
  1124. * For HT / VHT preamble types, this mask directly corresponds to
  1125. * the HT or VHT MCS indices that are allowed. For each bit N set
  1126. * within the mask, MCS index N is allowed for transmitting the frame.
  1127. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1128. * rates versus OFDM rates, so the host has the option of specifying
  1129. * that the target must transmit the frame with CCK or OFDM rates
  1130. * (not HT or VHT), but leaving the decision to the target whether
  1131. * to use CCK or OFDM.
  1132. *
  1133. * For CCK and OFDM, the bits within this mask are interpreted as
  1134. * follows:
  1135. * bit 0 -> CCK 1 Mbps rate is allowed
  1136. * bit 1 -> CCK 2 Mbps rate is allowed
  1137. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1138. * bit 3 -> CCK 11 Mbps rate is allowed
  1139. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1140. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1141. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1142. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1143. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1144. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1145. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1146. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1147. *
  1148. * The MCS index specification needs to be compatible with the
  1149. * bandwidth mask specification. For example, a MCS index == 9
  1150. * specification is inconsistent with a preamble type == VHT,
  1151. * Nss == 1, and channel bandwidth == 20 MHz.
  1152. *
  1153. * Furthermore, the host has only a limited ability to specify to
  1154. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1155. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1156. */
  1157. mcs_mask: 12,
  1158. /* nss_mask -
  1159. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1160. * Each bit in this mask corresponds to a Nss value:
  1161. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1162. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1163. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1164. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1165. * The values in the Nss mask must be suitable for the recipient, e.g.
  1166. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1167. * recipient which only supports 2x2 MIMO.
  1168. */
  1169. nss_mask: 4,
  1170. /* guard_interval -
  1171. * Specify a htt_tx_guard_interval enum value to indicate whether
  1172. * the transmission should use a regular guard interval or a
  1173. * short guard interval.
  1174. */
  1175. guard_interval: 1,
  1176. /* preamble_type_mask -
  1177. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1178. * may choose from for transmitting this frame.
  1179. * The bits in this mask correspond to the values in the
  1180. * htt_tx_preamble_type enum. For example, to allow the target
  1181. * to transmit the frame as either CCK or OFDM, this field would
  1182. * be set to
  1183. * (1 << htt_tx_preamble_type_ofdm) |
  1184. * (1 << htt_tx_preamble_type_cck)
  1185. */
  1186. preamble_type_mask: 4,
  1187. reserved1_31_29: 3; /* unused, set to 0x0 */
  1188. /* DWORD 2: tx chain mask, tx retries */
  1189. A_UINT32
  1190. /* chain_mask - specify which chains to transmit from */
  1191. chain_mask: 4,
  1192. /* retry_limit -
  1193. * Specify the maximum number of transmissions, including the
  1194. * initial transmission, to attempt before giving up if no ack
  1195. * is received.
  1196. * If the tx rate is specified, then all retries shall use the
  1197. * same rate as the initial transmission.
  1198. * If no tx rate is specified, the target can choose whether to
  1199. * retain the original rate during the retransmissions, or to
  1200. * fall back to a more robust rate.
  1201. */
  1202. retry_limit: 4,
  1203. /* bandwidth_mask -
  1204. * Specify what channel widths may be used for the transmission.
  1205. * A value of zero indicates "don't care" - the target may choose
  1206. * the transmission bandwidth.
  1207. * The bits within this mask correspond to the htt_tx_bandwidth
  1208. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1209. * The bandwidth_mask must be consistent with the preamble_type_mask
  1210. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1211. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1212. */
  1213. bandwidth_mask: 6,
  1214. reserved2_31_14: 18; /* unused, set to 0x0 */
  1215. /* DWORD 3: tx expiry time (TSF) LSBs */
  1216. A_UINT32 expire_tsf_lo;
  1217. /* DWORD 4: tx expiry time (TSF) MSBs */
  1218. A_UINT32 expire_tsf_hi;
  1219. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1220. } POSTPACK;
  1221. /* DWORD 0 */
  1222. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1223. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1224. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1225. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1226. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1227. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1228. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1229. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1230. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1231. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1232. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1233. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1234. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1235. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1236. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1237. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1238. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1239. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1240. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1241. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1242. /* DWORD 1 */
  1243. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1244. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1245. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1246. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1247. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1248. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1249. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1250. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1251. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1252. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1253. /* DWORD 2 */
  1254. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1255. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1256. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1257. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1258. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1259. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1260. /* DWORD 0 */
  1261. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1262. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1263. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1264. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1265. do { \
  1266. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1267. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1268. } while (0)
  1269. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1270. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1271. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1272. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1273. do { \
  1274. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1275. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1276. } while (0)
  1277. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1278. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1279. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1280. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1281. do { \
  1282. HTT_CHECK_SET_VAL( \
  1283. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1284. ((_var) |= ((_val) \
  1285. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1286. } while (0)
  1287. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1288. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1289. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1290. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1291. do { \
  1292. HTT_CHECK_SET_VAL( \
  1293. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1294. ((_var) |= ((_val) \
  1295. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1296. } while (0)
  1297. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1298. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1299. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1300. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1301. do { \
  1302. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1303. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1304. } while (0)
  1305. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1306. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1307. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1308. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1309. do { \
  1310. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1311. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1312. } while (0)
  1313. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1314. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1315. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1316. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1317. do { \
  1318. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1319. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1320. } while (0)
  1321. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1322. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1323. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1324. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1325. do { \
  1326. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1327. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1328. } while (0)
  1329. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1330. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1331. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1332. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1333. do { \
  1334. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1335. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1336. } while (0)
  1337. /* DWORD 1 */
  1338. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1339. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1340. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1341. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1342. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1343. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1344. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1345. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1346. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1347. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1348. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1349. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1350. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1351. do { \
  1352. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1353. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1354. } while (0)
  1355. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1356. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1357. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1358. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1359. do { \
  1360. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1361. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1362. } while (0)
  1363. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1364. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1365. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1366. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1367. do { \
  1368. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1369. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1370. } while (0)
  1371. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1372. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1373. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1374. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1375. do { \
  1376. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1377. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1378. } while (0)
  1379. /* DWORD 2 */
  1380. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1381. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1382. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1383. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1384. do { \
  1385. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1386. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1387. } while (0)
  1388. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1389. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1390. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1391. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1392. do { \
  1393. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1394. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1395. } while (0)
  1396. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1397. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1398. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1399. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1400. do { \
  1401. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1402. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1403. } while (0)
  1404. typedef enum {
  1405. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1406. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1407. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1408. } htt_11ax_ltf_subtype_t;
  1409. typedef enum {
  1410. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1411. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1412. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1413. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1414. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1415. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1416. } htt_tx_ext2_preamble_type_t;
  1417. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1418. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1419. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1420. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1421. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1422. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1423. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1424. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1425. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1426. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1427. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1428. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1429. /**
  1430. * @brief HTT tx MSDU extension descriptor v2
  1431. * @details
  1432. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1433. * is received as tcl_exit_base->host_meta_info in firmware.
  1434. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1435. * are already part of tcl_exit_base.
  1436. */
  1437. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1438. /* DWORD 0: flags */
  1439. A_UINT32
  1440. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1441. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1442. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1443. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1444. valid_retries : 1, /* if set, tx retries spec is valid */
  1445. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1446. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1447. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1448. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1449. valid_key_flags : 1, /* if set, key flags is valid */
  1450. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1451. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1452. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1453. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1454. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1455. 1 = ENCRYPT,
  1456. 2 ~ 3 - Reserved */
  1457. /* retry_limit -
  1458. * Specify the maximum number of transmissions, including the
  1459. * initial transmission, to attempt before giving up if no ack
  1460. * is received.
  1461. * If the tx rate is specified, then all retries shall use the
  1462. * same rate as the initial transmission.
  1463. * If no tx rate is specified, the target can choose whether to
  1464. * retain the original rate during the retransmissions, or to
  1465. * fall back to a more robust rate.
  1466. */
  1467. retry_limit : 4,
  1468. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1469. * Valid only for 11ax preamble types HE_SU
  1470. * and HE_EXT_SU
  1471. */
  1472. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1473. * Valid only for 11ax preamble types HE_SU
  1474. * and HE_EXT_SU
  1475. */
  1476. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1477. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1478. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1479. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1480. */
  1481. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1482. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1483. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1484. * Use cases:
  1485. * Any time firmware uses TQM-BYPASS for Data
  1486. * TID, firmware expect host to set this bit.
  1487. */
  1488. /* DWORD 1: tx power, tx rate */
  1489. A_UINT32
  1490. power : 8, /* unit of the power field is 0.5 dbm
  1491. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1492. * signed value ranging from -64dbm to 63.5 dbm
  1493. */
  1494. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1495. * Setting more than one MCS 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 MCS values.
  1500. */
  1501. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1502. * Setting more than one Nss isn't currently
  1503. * supported by the target (but is supported
  1504. * in the interface in case in the future
  1505. * the target supports specifications of
  1506. * a limited set of Nss values.
  1507. */
  1508. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1509. update_peer_cache : 1; /* When set these custom values will be
  1510. * used for all packets, until the next
  1511. * update via this ext header.
  1512. * This is to make sure not all packets
  1513. * need to include this header.
  1514. */
  1515. /* DWORD 2: tx chain mask, tx retries */
  1516. A_UINT32
  1517. /* chain_mask - specify which chains to transmit from */
  1518. chain_mask : 8,
  1519. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1520. * TODO: Update Enum values for key_flags
  1521. */
  1522. /*
  1523. * Channel frequency: This identifies the desired channel
  1524. * frequency (in MHz) for tx frames. This is used by FW to help
  1525. * determine when it is safe to transmit or drop frames for
  1526. * off-channel operation.
  1527. * The default value of zero indicates to FW that the corresponding
  1528. * VDEV's home channel (if there is one) is the desired channel
  1529. * frequency.
  1530. */
  1531. chanfreq : 16;
  1532. /* DWORD 3: tx expiry time (TSF) LSBs */
  1533. A_UINT32 expire_tsf_lo;
  1534. /* DWORD 4: tx expiry time (TSF) MSBs */
  1535. A_UINT32 expire_tsf_hi;
  1536. /* DWORD 5: flags to control routing / processing of the MSDU */
  1537. A_UINT32
  1538. /* learning_frame
  1539. * When this flag is set, this frame will be dropped by FW
  1540. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1541. */
  1542. learning_frame : 1,
  1543. /* send_as_standalone
  1544. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1545. * i.e. with no A-MSDU or A-MPDU aggregation.
  1546. * The scope is extended to other use-cases.
  1547. */
  1548. send_as_standalone : 1,
  1549. /* is_host_opaque_valid
  1550. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1551. * with valid information.
  1552. */
  1553. is_host_opaque_valid : 1,
  1554. rsvd0 : 29;
  1555. /* DWORD 6 : Host opaque cookie for special frames */
  1556. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1557. rsvd1 : 16;
  1558. /*
  1559. * This structure can be expanded further up to 40 bytes
  1560. * by adding further DWORDs as needed.
  1561. */
  1562. } POSTPACK;
  1563. /* DWORD 0 */
  1564. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1565. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1566. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1567. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1568. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1569. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1570. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1571. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1572. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1573. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1574. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1575. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1576. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1577. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1578. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1579. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1580. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1581. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1582. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1583. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1584. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1585. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1586. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1587. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1588. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1589. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1590. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1591. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1592. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1593. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1594. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1595. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1596. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1597. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1598. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1599. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1600. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1601. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1602. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1603. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1604. /* DWORD 1 */
  1605. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1606. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1607. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1608. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1609. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1610. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1611. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1612. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1613. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1614. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1615. /* DWORD 2 */
  1616. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1617. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1618. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1619. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1620. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1621. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1622. /* DWORD 5 */
  1623. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1624. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1625. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1626. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1627. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1628. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1629. /* DWORD 6 */
  1630. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1631. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1632. /* DWORD 0 */
  1633. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1634. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1635. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1636. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1637. do { \
  1638. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1639. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1640. } while (0)
  1641. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1642. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1643. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1644. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1645. do { \
  1646. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1647. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1648. } while (0)
  1649. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1650. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1651. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1652. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1653. do { \
  1654. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1655. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1656. } while (0)
  1657. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1658. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1659. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1660. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1661. do { \
  1662. HTT_CHECK_SET_VAL( \
  1663. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1664. ((_var) |= ((_val) \
  1665. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1666. } while (0)
  1667. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1668. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1669. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1670. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1671. do { \
  1672. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1673. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1674. } while (0)
  1675. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1676. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1677. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1678. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1679. do { \
  1680. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1681. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1682. } while (0)
  1683. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1684. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1685. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1686. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1687. do { \
  1688. HTT_CHECK_SET_VAL( \
  1689. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1690. ((_var) |= ((_val) \
  1691. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1692. } while (0)
  1693. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1694. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1695. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1696. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1697. do { \
  1698. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1699. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1700. } while (0)
  1701. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1702. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1703. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1704. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1705. do { \
  1706. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1707. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1708. } while (0)
  1709. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1710. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1711. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1712. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1713. do { \
  1714. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1715. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1716. } while (0)
  1717. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1718. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1719. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1720. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1721. do { \
  1722. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1723. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1724. } while (0)
  1725. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1726. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1727. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1728. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1729. do { \
  1730. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1731. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1732. } while (0)
  1733. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1734. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1735. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1736. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1737. do { \
  1738. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1739. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1740. } while (0)
  1741. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1742. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1743. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1744. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1745. do { \
  1746. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1747. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1748. } while (0)
  1749. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1750. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1751. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1752. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1753. do { \
  1754. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1755. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1756. } while (0)
  1757. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1758. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1759. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1760. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1761. do { \
  1762. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  1763. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  1764. } while (0)
  1765. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1766. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1767. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1768. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1769. do { \
  1770. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  1771. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  1772. } while (0)
  1773. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1774. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1775. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1776. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1777. do { \
  1778. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  1779. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1780. } while (0)
  1781. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1782. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1783. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1784. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1785. do { \
  1786. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1787. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  1788. } while (0)
  1789. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1790. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1791. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1792. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1793. do { \
  1794. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  1795. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1796. } while (0)
  1797. /* DWORD 1 */
  1798. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1799. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1800. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1801. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1802. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1803. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1804. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1805. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1806. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  1807. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  1808. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  1809. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  1810. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  1811. do { \
  1812. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  1813. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  1814. } while (0)
  1815. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  1816. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  1817. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  1818. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  1819. do { \
  1820. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  1821. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  1822. } while (0)
  1823. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  1824. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  1825. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  1826. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  1827. do { \
  1828. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  1829. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  1830. } while (0)
  1831. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  1832. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  1833. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  1834. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  1835. do { \
  1836. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  1837. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  1838. } while (0)
  1839. /* DWORD 2 */
  1840. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  1841. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  1842. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  1843. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  1844. do { \
  1845. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  1846. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  1847. } while (0)
  1848. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  1849. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  1850. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  1851. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  1852. do { \
  1853. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  1854. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  1855. } while (0)
  1856. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  1857. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  1858. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  1859. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  1860. do { \
  1861. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  1862. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  1863. } while (0)
  1864. /* DWORD 5 */
  1865. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  1866. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  1867. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  1868. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  1869. do { \
  1870. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  1871. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  1872. } while (0)
  1873. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  1874. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  1875. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  1876. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  1877. do { \
  1878. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  1879. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  1880. } while (0)
  1881. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  1882. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  1883. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  1884. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  1885. do { \
  1886. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  1887. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  1888. } while (0)
  1889. /* DWORD 6 */
  1890. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  1891. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  1892. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  1893. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  1894. do { \
  1895. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  1896. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  1897. } while (0)
  1898. typedef enum {
  1899. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  1900. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  1901. } htt_tcl_metadata_type;
  1902. /**
  1903. * @brief HTT TCL command number format
  1904. * @details
  1905. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  1906. * available to firmware as tcl_exit_base->tcl_status_number.
  1907. * For regular / multicast packets host will send vdev and mac id and for
  1908. * NAWDS packets, host will send peer id.
  1909. * A_UINT32 is used to avoid endianness conversion problems.
  1910. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  1911. */
  1912. typedef struct {
  1913. A_UINT32
  1914. type: 1, /* vdev_id based or peer_id based */
  1915. rsvd: 31;
  1916. } htt_tx_tcl_vdev_or_peer_t;
  1917. typedef struct {
  1918. A_UINT32
  1919. type: 1, /* vdev_id based or peer_id based */
  1920. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1921. vdev_id: 8,
  1922. pdev_id: 2,
  1923. host_inspected:1,
  1924. rsvd: 19;
  1925. } htt_tx_tcl_vdev_metadata;
  1926. typedef struct {
  1927. A_UINT32
  1928. type: 1, /* vdev_id based or peer_id based */
  1929. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1930. peer_id: 14,
  1931. rsvd: 16;
  1932. } htt_tx_tcl_peer_metadata;
  1933. PREPACK struct htt_tx_tcl_metadata {
  1934. union {
  1935. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  1936. htt_tx_tcl_vdev_metadata vdev_meta;
  1937. htt_tx_tcl_peer_metadata peer_meta;
  1938. };
  1939. } POSTPACK;
  1940. /* DWORD 0 */
  1941. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  1942. #define HTT_TX_TCL_METADATA_TYPE_S 0
  1943. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  1944. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  1945. /* VDEV metadata */
  1946. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  1947. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  1948. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  1949. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  1950. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  1951. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  1952. /* PEER metadata */
  1953. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  1954. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  1955. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  1956. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  1957. HTT_TX_TCL_METADATA_TYPE_S)
  1958. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  1959. do { \
  1960. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  1961. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  1962. } while (0)
  1963. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  1964. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  1965. HTT_TX_TCL_METADATA_VALID_HTT_S)
  1966. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  1967. do { \
  1968. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  1969. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  1970. } while (0)
  1971. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  1972. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  1973. HTT_TX_TCL_METADATA_VDEV_ID_S)
  1974. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  1975. do { \
  1976. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  1977. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  1978. } while (0)
  1979. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  1980. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  1981. HTT_TX_TCL_METADATA_PDEV_ID_S)
  1982. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  1983. do { \
  1984. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  1985. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  1986. } while (0)
  1987. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  1988. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  1989. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  1990. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  1991. do { \
  1992. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  1993. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  1994. } while (0)
  1995. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  1996. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  1997. HTT_TX_TCL_METADATA_PEER_ID_S)
  1998. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  1999. do { \
  2000. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2001. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2002. } while (0)
  2003. typedef enum {
  2004. HTT_TX_FW2WBM_TX_STATUS_OK,
  2005. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2006. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2007. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2008. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2009. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2010. HTT_TX_FW2WBM_TX_STATUS_MAX
  2011. } htt_tx_fw2wbm_tx_status_t;
  2012. typedef enum {
  2013. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2014. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2015. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2016. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2017. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2018. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2019. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2020. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2021. } htt_tx_fw2wbm_reinject_reason_t;
  2022. /**
  2023. * @brief HTT TX WBM Completion from firmware to host
  2024. * @details
  2025. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2026. * DWORD 3 and 4 for software based completions (Exception frames and
  2027. * TQM bypass frames)
  2028. * For software based completions, wbm_release_ring->release_source_module will
  2029. * be set to release_source_fw
  2030. */
  2031. PREPACK struct htt_tx_wbm_completion {
  2032. A_UINT32
  2033. sch_cmd_id: 24,
  2034. exception_frame: 1, /* If set, this packet was queued via exception path */
  2035. rsvd0_31_25: 7;
  2036. A_UINT32
  2037. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2038. * reception of an ACK or BA, this field indicates
  2039. * the RSSI of the received ACK or BA frame.
  2040. * When the frame is removed as result of a direct
  2041. * remove command from the SW, this field is set
  2042. * to 0x0 (which is never a valid value when real
  2043. * RSSI is available).
  2044. * Units: dB w.r.t noise floor
  2045. */
  2046. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2047. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2048. rsvd1_31_16: 16;
  2049. } POSTPACK;
  2050. /* DWORD 0 */
  2051. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2052. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2053. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2054. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2055. /* DWORD 1 */
  2056. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2057. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2058. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2059. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2060. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2061. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2062. /* DWORD 0 */
  2063. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2064. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2065. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2066. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2067. do { \
  2068. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2069. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2070. } while (0)
  2071. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2072. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2073. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2074. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2075. do { \
  2076. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2077. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2078. } while (0)
  2079. /* DWORD 1 */
  2080. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2081. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2082. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2083. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2084. do { \
  2085. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2086. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2087. } while (0)
  2088. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2089. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2090. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2091. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2092. do { \
  2093. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2094. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2095. } while (0)
  2096. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2097. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2098. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2099. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2100. do { \
  2101. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2102. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2103. } while (0)
  2104. /**
  2105. * @brief HTT TX WBM Completion from firmware to host
  2106. * @details
  2107. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2108. * (WBM) offload HW.
  2109. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2110. * For software based completions, release_source_module will
  2111. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2112. * struct wbm_release_ring and then switch to this after looking at
  2113. * release_source_module.
  2114. */
  2115. PREPACK struct htt_tx_wbm_completion_v2 {
  2116. A_UINT32
  2117. used_by_hw0; /* Refer to struct wbm_release_ring */
  2118. A_UINT32
  2119. used_by_hw1; /* Refer to struct wbm_release_ring */
  2120. A_UINT32
  2121. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2122. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2123. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2124. exception_frame: 1,
  2125. rsvd0: 12, /* For future use */
  2126. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2127. rsvd1: 1; /* For future use */
  2128. A_UINT32
  2129. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2130. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2131. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2132. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2133. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2134. */
  2135. A_UINT32
  2136. data1: 32;
  2137. A_UINT32
  2138. data2: 32;
  2139. A_UINT32
  2140. used_by_hw3; /* Refer to struct wbm_release_ring */
  2141. } POSTPACK;
  2142. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2143. /* DWORD 3 */
  2144. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2145. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2146. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2147. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2148. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2149. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2150. /* DWORD 3 */
  2151. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2152. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2153. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2154. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2155. do { \
  2156. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2157. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2158. } while (0)
  2159. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2160. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2161. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2162. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2163. do { \
  2164. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2165. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2166. } while (0)
  2167. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2168. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2169. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2170. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2171. do { \
  2172. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2173. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2174. } while (0)
  2175. /**
  2176. * @brief HTT TX WBM transmit status from firmware to host
  2177. * @details
  2178. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2179. * (WBM) offload HW.
  2180. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2181. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2182. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2183. */
  2184. PREPACK struct htt_tx_wbm_transmit_status {
  2185. A_UINT32
  2186. sch_cmd_id: 24,
  2187. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2188. * reception of an ACK or BA, this field indicates
  2189. * the RSSI of the received ACK or BA frame.
  2190. * When the frame is removed as result of a direct
  2191. * remove command from the SW, this field is set
  2192. * to 0x0 (which is never a valid value when real
  2193. * RSSI is available).
  2194. * Units: dB w.r.t noise floor
  2195. */
  2196. A_UINT32
  2197. sw_peer_id: 16,
  2198. tid_num: 5,
  2199. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2200. * and tid_num fields contain valid data.
  2201. * If this "valid" flag is not set, the
  2202. * sw_peer_id and tid_num fields must be ignored.
  2203. */
  2204. mcast: 1,
  2205. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2206. * contains valid data.
  2207. */
  2208. reserved0: 8;
  2209. A_UINT32
  2210. reserved1: 32;
  2211. } POSTPACK;
  2212. /* DWORD 4 */
  2213. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2214. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2215. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2216. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2217. /* DWORD 5 */
  2218. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2219. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2220. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2221. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2222. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2223. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2224. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2225. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2226. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2227. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2228. /* DWORD 4 */
  2229. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2230. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2231. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2232. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2233. do { \
  2234. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2235. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2236. } while (0)
  2237. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2238. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2239. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2240. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2241. do { \
  2242. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2243. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2244. } while (0)
  2245. /* DWORD 5 */
  2246. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2247. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2248. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2249. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2250. do { \
  2251. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2252. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2253. } while (0)
  2254. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2255. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2256. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2257. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2258. do { \
  2259. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2260. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2261. } while (0)
  2262. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2263. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2264. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2265. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2266. do { \
  2267. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2268. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2269. } while (0)
  2270. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2271. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2272. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2273. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2274. do { \
  2275. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2276. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2277. } while (0)
  2278. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2279. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2280. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2281. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2282. do { \
  2283. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2284. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2285. } while (0)
  2286. /**
  2287. * @brief HTT TX WBM reinject status from firmware to host
  2288. * @details
  2289. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2290. * (WBM) offload HW.
  2291. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2292. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2293. */
  2294. PREPACK struct htt_tx_wbm_reinject_status {
  2295. A_UINT32
  2296. reserved0: 32;
  2297. A_UINT32
  2298. reserved1: 32;
  2299. A_UINT32
  2300. reserved2: 32;
  2301. } POSTPACK;
  2302. /**
  2303. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2304. * @details
  2305. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2306. * (WBM) offload HW.
  2307. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2308. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2309. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2310. * STA side.
  2311. */
  2312. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2313. A_UINT32
  2314. mec_sa_addr_31_0;
  2315. A_UINT32
  2316. mec_sa_addr_47_32: 16,
  2317. sa_ast_index: 16;
  2318. A_UINT32
  2319. vdev_id: 8,
  2320. reserved0: 24;
  2321. } POSTPACK;
  2322. /* DWORD 4 - mec_sa_addr_31_0 */
  2323. /* DWORD 5 */
  2324. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2325. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2326. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2327. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2328. /* DWORD 6 */
  2329. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2330. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2331. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2332. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2333. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2334. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2335. do { \
  2336. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2337. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2338. } while (0)
  2339. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2340. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2341. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2342. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2343. do { \
  2344. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2345. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2346. } while (0)
  2347. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2348. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2349. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2350. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2351. do { \
  2352. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2353. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2354. } while (0)
  2355. typedef enum {
  2356. TX_FLOW_PRIORITY_BE,
  2357. TX_FLOW_PRIORITY_HIGH,
  2358. TX_FLOW_PRIORITY_LOW,
  2359. } htt_tx_flow_priority_t;
  2360. typedef enum {
  2361. TX_FLOW_LATENCY_SENSITIVE,
  2362. TX_FLOW_LATENCY_INSENSITIVE,
  2363. } htt_tx_flow_latency_t;
  2364. typedef enum {
  2365. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2366. TX_FLOW_INTERACTIVE_TRAFFIC,
  2367. TX_FLOW_PERIODIC_TRAFFIC,
  2368. TX_FLOW_BURSTY_TRAFFIC,
  2369. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2370. } htt_tx_flow_traffic_pattern_t;
  2371. /**
  2372. * @brief HTT TX Flow search metadata format
  2373. * @details
  2374. * Host will set this metadata in flow table's flow search entry along with
  2375. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2376. * firmware and TQM ring if the flow search entry wins.
  2377. * This metadata is available to firmware in that first MSDU's
  2378. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2379. * to one of the available flows for specific tid and returns the tqm flow
  2380. * pointer as part of htt_tx_map_flow_info message.
  2381. */
  2382. PREPACK struct htt_tx_flow_metadata {
  2383. A_UINT32
  2384. rsvd0_1_0: 2,
  2385. tid: 4,
  2386. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2387. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2388. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2389. * Else choose final tid based on latency, priority.
  2390. */
  2391. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2392. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2393. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2394. } POSTPACK;
  2395. /* DWORD 0 */
  2396. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2397. #define HTT_TX_FLOW_METADATA_TID_S 2
  2398. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2399. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2400. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2401. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2402. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2403. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2404. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2405. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2406. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2407. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2408. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2409. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2410. /* DWORD 0 */
  2411. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2412. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2413. HTT_TX_FLOW_METADATA_TID_S)
  2414. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2415. do { \
  2416. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2417. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2418. } while (0)
  2419. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2420. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2421. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2422. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2423. do { \
  2424. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2425. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2426. } while (0)
  2427. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2428. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2429. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2430. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2431. do { \
  2432. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2433. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2434. } while (0)
  2435. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2436. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2437. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2438. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2439. do { \
  2440. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2441. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2442. } while (0)
  2443. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2444. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2445. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2446. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2447. do { \
  2448. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2449. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2450. } while (0)
  2451. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2452. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2453. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2454. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2455. do { \
  2456. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2457. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2458. } while (0)
  2459. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2460. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2461. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2462. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2463. do { \
  2464. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2465. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2466. } while (0)
  2467. /**
  2468. * @brief Used in HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY and HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY messages
  2469. *
  2470. * @details
  2471. * HTT wds entry from source port learning
  2472. * Host will learn wds entries from rx and send this message to firmware
  2473. * to enable firmware to configure/delete AST entries for wds clients.
  2474. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2475. * and when SA's entry is deleted, firmware removes this AST entry
  2476. *
  2477. * The message would appear as follows:
  2478. *
  2479. * |31 30|29 |17 16|15 8|7 0|
  2480. * |----------------+----------------+----------------+----------------|
  2481. * | rsvd0 |PDVID| vdev_id | msg_type |
  2482. * |-------------------------------------------------------------------|
  2483. * | sa_addr_31_0 |
  2484. * |-------------------------------------------------------------------|
  2485. * | | ta_peer_id | sa_addr_47_32 |
  2486. * |-------------------------------------------------------------------|
  2487. * Where PDVID = pdev_id
  2488. *
  2489. * The message is interpreted as follows:
  2490. *
  2491. * dword0 - b'0:7 - msg_type: This will be set to
  2492. * HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY or
  2493. * HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2494. *
  2495. * dword0 - b'8:15 - vdev_id
  2496. *
  2497. * dword0 - b'16:17 - pdev_id
  2498. *
  2499. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2500. *
  2501. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2502. *
  2503. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2504. *
  2505. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2506. */
  2507. PREPACK struct htt_wds_entry {
  2508. A_UINT32
  2509. msg_type: 8,
  2510. vdev_id: 8,
  2511. pdev_id: 2,
  2512. rsvd0: 14;
  2513. A_UINT32 sa_addr_31_0;
  2514. A_UINT32
  2515. sa_addr_47_32: 16,
  2516. ta_peer_id: 14,
  2517. rsvd2: 2;
  2518. } POSTPACK;
  2519. /* DWORD 0 */
  2520. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2521. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2522. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2523. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2524. /* DWORD 2 */
  2525. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2526. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2527. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2528. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2529. /* DWORD 0 */
  2530. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2531. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2532. HTT_WDS_ENTRY_VDEV_ID_S)
  2533. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2534. do { \
  2535. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2536. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2537. } while (0)
  2538. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2539. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2540. HTT_WDS_ENTRY_PDEV_ID_S)
  2541. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2542. do { \
  2543. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2544. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2545. } while (0)
  2546. /* DWORD 2 */
  2547. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2548. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2549. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2550. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2551. do { \
  2552. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2553. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2554. } while (0)
  2555. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2556. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2557. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2558. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2559. do { \
  2560. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2561. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2562. } while (0)
  2563. /**
  2564. * @brief MAC DMA rx ring setup specification
  2565. * @details
  2566. * To allow for dynamic rx ring reconfiguration and to avoid race
  2567. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2568. * it uses. Instead, it sends this message to the target, indicating how
  2569. * the rx ring used by the host should be set up and maintained.
  2570. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2571. * specifications.
  2572. *
  2573. * |31 16|15 8|7 0|
  2574. * |---------------------------------------------------------------|
  2575. * header: | reserved | num rings | msg type |
  2576. * |---------------------------------------------------------------|
  2577. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2578. #if HTT_PADDR64
  2579. * | FW_IDX shadow register physical address (bits 63:32) |
  2580. #endif
  2581. * |---------------------------------------------------------------|
  2582. * | rx ring base physical address (bits 31:0) |
  2583. #if HTT_PADDR64
  2584. * | rx ring base physical address (bits 63:32) |
  2585. #endif
  2586. * |---------------------------------------------------------------|
  2587. * | rx ring buffer size | rx ring length |
  2588. * |---------------------------------------------------------------|
  2589. * | FW_IDX initial value | enabled flags |
  2590. * |---------------------------------------------------------------|
  2591. * | MSDU payload offset | 802.11 header offset |
  2592. * |---------------------------------------------------------------|
  2593. * | PPDU end offset | PPDU start offset |
  2594. * |---------------------------------------------------------------|
  2595. * | MPDU end offset | MPDU start offset |
  2596. * |---------------------------------------------------------------|
  2597. * | MSDU end offset | MSDU start offset |
  2598. * |---------------------------------------------------------------|
  2599. * | frag info offset | rx attention offset |
  2600. * |---------------------------------------------------------------|
  2601. * payload 2, if present, has the same format as payload 1
  2602. * Header fields:
  2603. * - MSG_TYPE
  2604. * Bits 7:0
  2605. * Purpose: identifies this as an rx ring configuration message
  2606. * Value: 0x2
  2607. * - NUM_RINGS
  2608. * Bits 15:8
  2609. * Purpose: indicates whether the host is setting up one rx ring or two
  2610. * Value: 1 or 2
  2611. * Payload:
  2612. * for systems using 64-bit format for bus addresses:
  2613. * - IDX_SHADOW_REG_PADDR_LO
  2614. * Bits 31:0
  2615. * Value: lower 4 bytes of physical address of the host's
  2616. * FW_IDX shadow register
  2617. * - IDX_SHADOW_REG_PADDR_HI
  2618. * Bits 31:0
  2619. * Value: upper 4 bytes of physical address of the host's
  2620. * FW_IDX shadow register
  2621. * - RING_BASE_PADDR_LO
  2622. * Bits 31:0
  2623. * Value: lower 4 bytes of physical address of the host's rx ring
  2624. * - RING_BASE_PADDR_HI
  2625. * Bits 31:0
  2626. * Value: uppper 4 bytes of physical address of the host's rx ring
  2627. * for systems using 32-bit format for bus addresses:
  2628. * - IDX_SHADOW_REG_PADDR
  2629. * Bits 31:0
  2630. * Value: physical address of the host's FW_IDX shadow register
  2631. * - RING_BASE_PADDR
  2632. * Bits 31:0
  2633. * Value: physical address of the host's rx ring
  2634. * - RING_LEN
  2635. * Bits 15:0
  2636. * Value: number of elements in the rx ring
  2637. * - RING_BUF_SZ
  2638. * Bits 31:16
  2639. * Value: size of the buffers referenced by the rx ring, in byte units
  2640. * - ENABLED_FLAGS
  2641. * Bits 15:0
  2642. * Value: 1-bit flags to show whether different rx fields are enabled
  2643. * bit 0: 802.11 header enabled (1) or disabled (0)
  2644. * bit 1: MSDU payload enabled (1) or disabled (0)
  2645. * bit 2: PPDU start enabled (1) or disabled (0)
  2646. * bit 3: PPDU end enabled (1) or disabled (0)
  2647. * bit 4: MPDU start enabled (1) or disabled (0)
  2648. * bit 5: MPDU end enabled (1) or disabled (0)
  2649. * bit 6: MSDU start enabled (1) or disabled (0)
  2650. * bit 7: MSDU end enabled (1) or disabled (0)
  2651. * bit 8: rx attention enabled (1) or disabled (0)
  2652. * bit 9: frag info enabled (1) or disabled (0)
  2653. * bit 10: unicast rx enabled (1) or disabled (0)
  2654. * bit 11: multicast rx enabled (1) or disabled (0)
  2655. * bit 12: ctrl rx enabled (1) or disabled (0)
  2656. * bit 13: mgmt rx enabled (1) or disabled (0)
  2657. * bit 14: null rx enabled (1) or disabled (0)
  2658. * bit 15: phy data rx enabled (1) or disabled (0)
  2659. * - IDX_INIT_VAL
  2660. * Bits 31:16
  2661. * Purpose: Specify the initial value for the FW_IDX.
  2662. * Value: the number of buffers initially present in the host's rx ring
  2663. * - OFFSET_802_11_HDR
  2664. * Bits 15:0
  2665. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2666. * - OFFSET_MSDU_PAYLOAD
  2667. * Bits 31:16
  2668. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2669. * - OFFSET_PPDU_START
  2670. * Bits 15:0
  2671. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2672. * - OFFSET_PPDU_END
  2673. * Bits 31:16
  2674. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2675. * - OFFSET_MPDU_START
  2676. * Bits 15:0
  2677. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2678. * - OFFSET_MPDU_END
  2679. * Bits 31:16
  2680. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2681. * - OFFSET_MSDU_START
  2682. * Bits 15:0
  2683. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2684. * - OFFSET_MSDU_END
  2685. * Bits 31:16
  2686. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2687. * - OFFSET_RX_ATTN
  2688. * Bits 15:0
  2689. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2690. * - OFFSET_FRAG_INFO
  2691. * Bits 31:16
  2692. * Value: offset in QUAD-bytes of frag info table
  2693. */
  2694. /* header fields */
  2695. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2696. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2697. /* payload fields */
  2698. /* for systems using a 64-bit format for bus addresses */
  2699. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2700. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2701. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2702. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2703. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2704. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2705. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2706. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2707. /* for systems using a 32-bit format for bus addresses */
  2708. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2709. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2710. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2711. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2712. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2713. #define HTT_RX_RING_CFG_LEN_S 0
  2714. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2715. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2716. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2717. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2718. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2719. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2720. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2721. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2722. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2723. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2724. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2725. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2726. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2727. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2728. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2729. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2730. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2731. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2732. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2733. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2734. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2735. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2736. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2737. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2738. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2739. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2740. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2741. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2742. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2743. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2744. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2745. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2746. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2747. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2748. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2749. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2750. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2751. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2752. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2753. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2754. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2755. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2756. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2757. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2758. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2759. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2760. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2761. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2762. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2763. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2764. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2765. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2766. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2767. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2768. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2769. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2770. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2771. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2772. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2773. #if HTT_PADDR64
  2774. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2775. #else
  2776. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2777. #endif
  2778. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2779. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2780. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2781. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2782. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2783. do { \
  2784. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2785. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2786. } while (0)
  2787. /* degenerate case for 32-bit fields */
  2788. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  2789. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  2790. ((_var) = (_val))
  2791. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  2792. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  2793. ((_var) = (_val))
  2794. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  2795. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  2796. ((_var) = (_val))
  2797. /* degenerate case for 32-bit fields */
  2798. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  2799. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  2800. ((_var) = (_val))
  2801. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  2802. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  2803. ((_var) = (_val))
  2804. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  2805. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  2806. ((_var) = (_val))
  2807. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  2808. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  2809. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  2810. do { \
  2811. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  2812. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  2813. } while (0)
  2814. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  2815. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  2816. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  2817. do { \
  2818. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  2819. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  2820. } while (0)
  2821. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  2822. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  2823. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  2824. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  2825. do { \
  2826. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  2827. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  2828. } while (0)
  2829. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  2830. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  2831. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  2832. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  2833. do { \
  2834. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  2835. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  2836. } while (0)
  2837. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  2838. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  2839. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  2840. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  2841. do { \
  2842. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  2843. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  2844. } while (0)
  2845. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  2846. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  2847. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  2848. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  2849. do { \
  2850. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  2851. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  2852. } while (0)
  2853. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  2854. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  2855. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  2856. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  2857. do { \
  2858. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  2859. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  2860. } while (0)
  2861. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  2862. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  2863. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  2864. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  2865. do { \
  2866. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  2867. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  2868. } while (0)
  2869. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  2870. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  2871. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  2872. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  2873. do { \
  2874. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  2875. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  2876. } while (0)
  2877. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  2878. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  2879. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  2880. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  2881. do { \
  2882. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  2883. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  2884. } while (0)
  2885. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  2886. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  2887. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  2888. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  2889. do { \
  2890. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  2891. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  2892. } while (0)
  2893. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  2894. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  2895. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  2896. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  2897. do { \
  2898. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  2899. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  2900. } while (0)
  2901. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  2902. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  2903. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  2904. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  2905. do { \
  2906. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  2907. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  2908. } while (0)
  2909. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  2910. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  2911. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  2912. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  2913. do { \
  2914. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  2915. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  2916. } while (0)
  2917. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  2918. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  2919. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  2920. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  2921. do { \
  2922. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  2923. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  2924. } while (0)
  2925. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  2926. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  2927. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  2928. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  2929. do { \
  2930. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  2931. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  2932. } while (0)
  2933. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  2934. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  2935. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  2936. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  2937. do { \
  2938. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  2939. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  2940. } while (0)
  2941. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  2942. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  2943. HTT_RX_RING_CFG_ENABLED_NULL_S)
  2944. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  2945. do { \
  2946. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  2947. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  2948. } while (0)
  2949. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  2950. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  2951. HTT_RX_RING_CFG_ENABLED_PHY_S)
  2952. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  2953. do { \
  2954. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  2955. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  2956. } while (0)
  2957. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  2958. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  2959. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  2960. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  2961. do { \
  2962. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  2963. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  2964. } while (0)
  2965. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  2966. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  2967. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  2968. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  2969. do { \
  2970. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  2971. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  2972. } while (0)
  2973. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  2974. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  2975. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  2976. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  2977. do { \
  2978. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  2979. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  2980. } while (0)
  2981. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  2982. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  2983. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  2984. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  2985. do { \
  2986. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  2987. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  2988. } while (0)
  2989. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  2990. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  2991. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  2992. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  2993. do { \
  2994. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  2995. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  2996. } while (0)
  2997. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  2998. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  2999. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3000. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3001. do { \
  3002. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3003. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3004. } while (0)
  3005. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3006. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3007. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3008. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3009. do { \
  3010. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3011. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3012. } while (0)
  3013. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3014. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3015. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3016. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3017. do { \
  3018. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3019. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3020. } while (0)
  3021. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3022. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3023. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3024. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3025. do { \
  3026. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3027. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3028. } while (0)
  3029. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3030. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3031. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3032. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3033. do { \
  3034. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3035. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3036. } while (0)
  3037. /**
  3038. * @brief host -> target FW statistics retrieve
  3039. *
  3040. * @details
  3041. * The following field definitions describe the format of the HTT host
  3042. * to target FW stats retrieve message. The message specifies the type of
  3043. * stats host wants to retrieve.
  3044. *
  3045. * |31 24|23 16|15 8|7 0|
  3046. * |-----------------------------------------------------------|
  3047. * | stats types request bitmask | msg type |
  3048. * |-----------------------------------------------------------|
  3049. * | stats types reset bitmask | reserved |
  3050. * |-----------------------------------------------------------|
  3051. * | stats type | config value |
  3052. * |-----------------------------------------------------------|
  3053. * | cookie LSBs |
  3054. * |-----------------------------------------------------------|
  3055. * | cookie MSBs |
  3056. * |-----------------------------------------------------------|
  3057. * Header fields:
  3058. * - MSG_TYPE
  3059. * Bits 7:0
  3060. * Purpose: identifies this is a stats upload request message
  3061. * Value: 0x3
  3062. * - UPLOAD_TYPES
  3063. * Bits 31:8
  3064. * Purpose: identifies which types of FW statistics to upload
  3065. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3066. * - RESET_TYPES
  3067. * Bits 31:8
  3068. * Purpose: identifies which types of FW statistics to reset
  3069. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3070. * - CFG_VAL
  3071. * Bits 23:0
  3072. * Purpose: give an opaque configuration value to the specified stats type
  3073. * Value: stats-type specific configuration value
  3074. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3075. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3076. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3077. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3078. * - CFG_STAT_TYPE
  3079. * Bits 31:24
  3080. * Purpose: specify which stats type (if any) the config value applies to
  3081. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3082. * a valid configuration specification
  3083. * - COOKIE_LSBS
  3084. * Bits 31:0
  3085. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3086. * message with its preceding host->target stats request message.
  3087. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3088. * - COOKIE_MSBS
  3089. * Bits 31:0
  3090. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3091. * message with its preceding host->target stats request message.
  3092. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3093. */
  3094. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3095. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3096. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3097. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3098. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3099. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3100. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3101. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3102. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3103. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3104. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3105. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3106. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3107. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3108. do { \
  3109. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3110. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3111. } while (0)
  3112. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3113. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3114. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3115. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3116. do { \
  3117. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3118. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3119. } while (0)
  3120. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3121. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3122. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3123. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3124. do { \
  3125. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3126. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3127. } while (0)
  3128. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3129. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3130. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3131. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3132. do { \
  3133. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3134. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3135. } while (0)
  3136. /**
  3137. * @brief host -> target HTT out-of-band sync request
  3138. *
  3139. * @details
  3140. * The HTT SYNC tells the target to suspend processing of subsequent
  3141. * HTT host-to-target messages until some other target agent locally
  3142. * informs the target HTT FW that the current sync counter is equal to
  3143. * or greater than (in a modulo sense) the sync counter specified in
  3144. * the SYNC message.
  3145. * This allows other host-target components to synchronize their operation
  3146. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3147. * security key has been downloaded to and activated by the target.
  3148. * In the absence of any explicit synchronization counter value
  3149. * specification, the target HTT FW will use zero as the default current
  3150. * sync value.
  3151. *
  3152. * |31 24|23 16|15 8|7 0|
  3153. * |-----------------------------------------------------------|
  3154. * | reserved | sync count | msg type |
  3155. * |-----------------------------------------------------------|
  3156. * Header fields:
  3157. * - MSG_TYPE
  3158. * Bits 7:0
  3159. * Purpose: identifies this as a sync message
  3160. * Value: 0x4
  3161. * - SYNC_COUNT
  3162. * Bits 15:8
  3163. * Purpose: specifies what sync value the HTT FW will wait for from
  3164. * an out-of-band specification to resume its operation
  3165. * Value: in-band sync counter value to compare against the out-of-band
  3166. * counter spec.
  3167. * The HTT target FW will suspend its host->target message processing
  3168. * as long as
  3169. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3170. */
  3171. #define HTT_H2T_SYNC_MSG_SZ 4
  3172. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3173. #define HTT_H2T_SYNC_COUNT_S 8
  3174. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3175. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3176. HTT_H2T_SYNC_COUNT_S)
  3177. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3178. do { \
  3179. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3180. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3181. } while (0)
  3182. /**
  3183. * @brief HTT aggregation configuration
  3184. */
  3185. #define HTT_AGGR_CFG_MSG_SZ 4
  3186. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3187. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3188. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3189. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3190. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3191. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3192. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3193. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3194. do { \
  3195. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3196. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3197. } while (0)
  3198. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3199. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3200. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3201. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3202. do { \
  3203. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3204. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3205. } while (0)
  3206. /**
  3207. * @brief host -> target HTT configure max amsdu info per vdev
  3208. *
  3209. * @details
  3210. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3211. *
  3212. * |31 21|20 16|15 8|7 0|
  3213. * |-----------------------------------------------------------|
  3214. * | reserved | vdev id | max amsdu | msg type |
  3215. * |-----------------------------------------------------------|
  3216. * Header fields:
  3217. * - MSG_TYPE
  3218. * Bits 7:0
  3219. * Purpose: identifies this as a aggr cfg ex message
  3220. * Value: 0xa
  3221. * - MAX_NUM_AMSDU_SUBFRM
  3222. * Bits 15:8
  3223. * Purpose: max MSDUs per A-MSDU
  3224. * - VDEV_ID
  3225. * Bits 20:16
  3226. * Purpose: ID of the vdev to which this limit is applied
  3227. */
  3228. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3229. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3230. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3231. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3232. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3233. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3234. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3235. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3236. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3237. do { \
  3238. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3239. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3240. } while (0)
  3241. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3242. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3243. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3244. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3245. do { \
  3246. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3247. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3248. } while (0)
  3249. /**
  3250. * @brief HTT WDI_IPA Config Message
  3251. *
  3252. * @details
  3253. * The HTT WDI_IPA config message is created/sent by host at driver
  3254. * init time. It contains information about data structures used on
  3255. * WDI_IPA TX and RX path.
  3256. * TX CE ring is used for pushing packet metadata from IPA uC
  3257. * to WLAN FW
  3258. * TX Completion ring is used for generating TX completions from
  3259. * WLAN FW to IPA uC
  3260. * RX Indication ring is used for indicating RX packets from FW
  3261. * to IPA uC
  3262. * RX Ring2 is used as either completion ring or as second
  3263. * indication ring. when Ring2 is used as completion ring, IPA uC
  3264. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3265. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3266. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3267. * indicated in RX Indication ring. Please see WDI_IPA specification
  3268. * for more details.
  3269. * |31 24|23 16|15 8|7 0|
  3270. * |----------------+----------------+----------------+----------------|
  3271. * | tx pkt pool size | Rsvd | msg_type |
  3272. * |-------------------------------------------------------------------|
  3273. * | tx comp ring base (bits 31:0) |
  3274. #if HTT_PADDR64
  3275. * | tx comp ring base (bits 63:32) |
  3276. #endif
  3277. * |-------------------------------------------------------------------|
  3278. * | tx comp ring size |
  3279. * |-------------------------------------------------------------------|
  3280. * | tx comp WR_IDX physical address (bits 31:0) |
  3281. #if HTT_PADDR64
  3282. * | tx comp WR_IDX physical address (bits 63:32) |
  3283. #endif
  3284. * |-------------------------------------------------------------------|
  3285. * | tx CE WR_IDX physical address (bits 31:0) |
  3286. #if HTT_PADDR64
  3287. * | tx CE WR_IDX physical address (bits 63:32) |
  3288. #endif
  3289. * |-------------------------------------------------------------------|
  3290. * | rx indication ring base (bits 31:0) |
  3291. #if HTT_PADDR64
  3292. * | rx indication ring base (bits 63:32) |
  3293. #endif
  3294. * |-------------------------------------------------------------------|
  3295. * | rx indication ring size |
  3296. * |-------------------------------------------------------------------|
  3297. * | rx ind RD_IDX physical address (bits 31:0) |
  3298. #if HTT_PADDR64
  3299. * | rx ind RD_IDX physical address (bits 63:32) |
  3300. #endif
  3301. * |-------------------------------------------------------------------|
  3302. * | rx ind WR_IDX physical address (bits 31:0) |
  3303. #if HTT_PADDR64
  3304. * | rx ind WR_IDX physical address (bits 63:32) |
  3305. #endif
  3306. * |-------------------------------------------------------------------|
  3307. * |-------------------------------------------------------------------|
  3308. * | rx ring2 base (bits 31:0) |
  3309. #if HTT_PADDR64
  3310. * | rx ring2 base (bits 63:32) |
  3311. #endif
  3312. * |-------------------------------------------------------------------|
  3313. * | rx ring2 size |
  3314. * |-------------------------------------------------------------------|
  3315. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3316. #if HTT_PADDR64
  3317. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3318. #endif
  3319. * |-------------------------------------------------------------------|
  3320. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3321. #if HTT_PADDR64
  3322. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3323. #endif
  3324. * |-------------------------------------------------------------------|
  3325. *
  3326. * Header fields:
  3327. * Header fields:
  3328. * - MSG_TYPE
  3329. * Bits 7:0
  3330. * Purpose: Identifies this as WDI_IPA config message
  3331. * value: = 0x8
  3332. * - TX_PKT_POOL_SIZE
  3333. * Bits 15:0
  3334. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3335. * WDI_IPA TX path
  3336. * For systems using 32-bit format for bus addresses:
  3337. * - TX_COMP_RING_BASE_ADDR
  3338. * Bits 31:0
  3339. * Purpose: TX Completion Ring base address in DDR
  3340. * - TX_COMP_RING_SIZE
  3341. * Bits 31:0
  3342. * Purpose: TX Completion Ring size (must be power of 2)
  3343. * - TX_COMP_WR_IDX_ADDR
  3344. * Bits 31:0
  3345. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3346. * updates the Write Index for WDI_IPA TX completion ring
  3347. * - TX_CE_WR_IDX_ADDR
  3348. * Bits 31:0
  3349. * Purpose: DDR address where IPA uC
  3350. * updates the WR Index for TX CE ring
  3351. * (needed for fusion platforms)
  3352. * - RX_IND_RING_BASE_ADDR
  3353. * Bits 31:0
  3354. * Purpose: RX Indication Ring base address in DDR
  3355. * - RX_IND_RING_SIZE
  3356. * Bits 31:0
  3357. * Purpose: RX Indication Ring size
  3358. * - RX_IND_RD_IDX_ADDR
  3359. * Bits 31:0
  3360. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3361. * RX indication ring
  3362. * - RX_IND_WR_IDX_ADDR
  3363. * Bits 31:0
  3364. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3365. * updates the Write Index for WDI_IPA RX indication ring
  3366. * - RX_RING2_BASE_ADDR
  3367. * Bits 31:0
  3368. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3369. * - RX_RING2_SIZE
  3370. * Bits 31:0
  3371. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3372. * - RX_RING2_RD_IDX_ADDR
  3373. * Bits 31:0
  3374. * Purpose: If Second RX ring is Indication ring, DDR address where
  3375. * IPA uC updates the Read Index for Ring2.
  3376. * If Second RX ring is completion ring, this is NOT used
  3377. * - RX_RING2_WR_IDX_ADDR
  3378. * Bits 31:0
  3379. * Purpose: If Second RX ring is Indication ring, DDR address where
  3380. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3381. * If second RX ring is completion ring, DDR address where
  3382. * IPA uC updates the Write Index for Ring 2.
  3383. * For systems using 64-bit format for bus addresses:
  3384. * - TX_COMP_RING_BASE_ADDR_LO
  3385. * Bits 31:0
  3386. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3387. * - TX_COMP_RING_BASE_ADDR_HI
  3388. * Bits 31:0
  3389. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3390. * - TX_COMP_RING_SIZE
  3391. * Bits 31:0
  3392. * Purpose: TX Completion Ring size (must be power of 2)
  3393. * - TX_COMP_WR_IDX_ADDR_LO
  3394. * Bits 31:0
  3395. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3396. * Lower 4 bytes of DDR address where WIFI FW
  3397. * updates the Write Index for WDI_IPA TX completion ring
  3398. * - TX_COMP_WR_IDX_ADDR_HI
  3399. * Bits 31:0
  3400. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3401. * Higher 4 bytes of DDR address where WIFI FW
  3402. * updates the Write Index for WDI_IPA TX completion ring
  3403. * - TX_CE_WR_IDX_ADDR_LO
  3404. * Bits 31:0
  3405. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3406. * updates the WR Index for TX CE ring
  3407. * (needed for fusion platforms)
  3408. * - TX_CE_WR_IDX_ADDR_HI
  3409. * Bits 31:0
  3410. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3411. * updates the WR Index for TX CE ring
  3412. * (needed for fusion platforms)
  3413. * - RX_IND_RING_BASE_ADDR_LO
  3414. * Bits 31:0
  3415. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3416. * - RX_IND_RING_BASE_ADDR_HI
  3417. * Bits 31:0
  3418. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3419. * - RX_IND_RING_SIZE
  3420. * Bits 31:0
  3421. * Purpose: RX Indication Ring size
  3422. * - RX_IND_RD_IDX_ADDR_LO
  3423. * Bits 31:0
  3424. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3425. * for WDI_IPA RX indication ring
  3426. * - RX_IND_RD_IDX_ADDR_HI
  3427. * Bits 31:0
  3428. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3429. * for WDI_IPA RX indication ring
  3430. * - RX_IND_WR_IDX_ADDR_LO
  3431. * Bits 31:0
  3432. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3433. * Lower 4 bytes of DDR address where WIFI FW
  3434. * updates the Write Index for WDI_IPA RX indication ring
  3435. * - RX_IND_WR_IDX_ADDR_HI
  3436. * Bits 31:0
  3437. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3438. * Higher 4 bytes of DDR address where WIFI FW
  3439. * updates the Write Index for WDI_IPA RX indication ring
  3440. * - RX_RING2_BASE_ADDR_LO
  3441. * Bits 31:0
  3442. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3443. * - RX_RING2_BASE_ADDR_HI
  3444. * Bits 31:0
  3445. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3446. * - RX_RING2_SIZE
  3447. * Bits 31:0
  3448. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3449. * - RX_RING2_RD_IDX_ADDR_LO
  3450. * Bits 31:0
  3451. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3452. * DDR address where IPA uC updates the Read Index for Ring2.
  3453. * If Second RX ring is completion ring, this is NOT used
  3454. * - RX_RING2_RD_IDX_ADDR_HI
  3455. * Bits 31:0
  3456. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3457. * DDR address where IPA uC updates the Read Index for Ring2.
  3458. * If Second RX ring is completion ring, this is NOT used
  3459. * - RX_RING2_WR_IDX_ADDR_LO
  3460. * Bits 31:0
  3461. * Purpose: If Second RX ring is Indication ring, lower 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, lower 4 bytes of
  3465. * DDR address where IPA uC updates the Write Index for Ring 2.
  3466. * - RX_RING2_WR_IDX_ADDR_HI
  3467. * Bits 31:0
  3468. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3469. * DDR address where WIFI FW updates the Write Index
  3470. * for WDI_IPA RX ring2
  3471. * If second RX ring is completion ring, higher 4 bytes of
  3472. * DDR address where IPA uC updates the Write Index for Ring 2.
  3473. */
  3474. #if HTT_PADDR64
  3475. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3476. #else
  3477. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3478. #endif
  3479. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3480. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3481. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3482. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3483. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3484. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3485. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3486. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3487. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3488. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3489. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3490. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3491. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3492. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3493. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3494. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3495. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3496. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3497. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3498. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3499. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3500. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3501. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3502. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3503. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3504. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3505. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3506. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3507. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3508. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3509. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3510. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3511. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3512. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3513. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3514. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3515. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3516. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3517. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3518. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3519. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3520. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3521. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3522. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3523. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3524. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3525. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3526. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3527. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3528. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3529. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3530. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3531. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3532. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3533. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3534. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3535. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3536. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3537. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3538. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3539. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3540. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3541. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3542. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3543. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3544. do { \
  3545. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3546. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3547. } while (0)
  3548. /* for systems using 32-bit format for bus addr */
  3549. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3550. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3551. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3552. do { \
  3553. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3554. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3555. } while (0)
  3556. /* for systems using 64-bit format for bus addr */
  3557. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3558. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3559. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3560. do { \
  3561. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3562. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3563. } while (0)
  3564. /* for systems using 64-bit format for bus addr */
  3565. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3566. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3567. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3568. do { \
  3569. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3570. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3571. } while (0)
  3572. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3573. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3574. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3575. do { \
  3576. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3577. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3578. } while (0)
  3579. /* for systems using 32-bit format for bus addr */
  3580. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3581. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3582. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3583. do { \
  3584. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3585. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3586. } while (0)
  3587. /* for systems using 64-bit format for bus addr */
  3588. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3589. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3590. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3591. do { \
  3592. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3593. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3594. } while (0)
  3595. /* for systems using 64-bit format for bus addr */
  3596. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3597. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3598. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3599. do { \
  3600. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3601. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3602. } while (0)
  3603. /* for systems using 32-bit format for bus addr */
  3604. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3605. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3606. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3607. do { \
  3608. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3609. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3610. } while (0)
  3611. /* for systems using 64-bit format for bus addr */
  3612. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3613. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3614. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3615. do { \
  3616. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3617. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3618. } while (0)
  3619. /* for systems using 64-bit format for bus addr */
  3620. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3621. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3622. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3623. do { \
  3624. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3625. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3626. } while (0)
  3627. /* for systems using 32-bit format for bus addr */
  3628. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3629. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3630. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3631. do { \
  3632. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3633. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3634. } while (0)
  3635. /* for systems using 64-bit format for bus addr */
  3636. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3637. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3638. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3639. do { \
  3640. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3641. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3642. } while (0)
  3643. /* for systems using 64-bit format for bus addr */
  3644. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3645. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3646. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3647. do { \
  3648. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3649. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3650. } while (0)
  3651. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3652. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3653. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3654. do { \
  3655. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3656. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3657. } while (0)
  3658. /* for systems using 32-bit format for bus addr */
  3659. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3660. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3661. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3662. do { \
  3663. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3664. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3665. } while (0)
  3666. /* for systems using 64-bit format for bus addr */
  3667. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3668. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3669. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3670. do { \
  3671. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3672. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3673. } while (0)
  3674. /* for systems using 64-bit format for bus addr */
  3675. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3676. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3677. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3678. do { \
  3679. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3680. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3681. } while (0)
  3682. /* for systems using 32-bit format for bus addr */
  3683. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3684. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3685. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3686. do { \
  3687. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3688. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3689. } while (0)
  3690. /* for systems using 64-bit format for bus addr */
  3691. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3692. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3693. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3694. do { \
  3695. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3696. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3697. } while (0)
  3698. /* for systems using 64-bit format for bus addr */
  3699. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3700. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3701. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3702. do { \
  3703. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3704. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3705. } while (0)
  3706. /* for systems using 32-bit format for bus addr */
  3707. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3708. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3709. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3710. do { \
  3711. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3712. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3713. } while (0)
  3714. /* for systems using 64-bit format for bus addr */
  3715. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3716. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3717. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3718. do { \
  3719. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3720. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3721. } while (0)
  3722. /* for systems using 64-bit format for bus addr */
  3723. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3724. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3725. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3726. do { \
  3727. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3728. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3729. } while (0)
  3730. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3731. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3732. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3733. do { \
  3734. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3735. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3736. } while (0)
  3737. /* for systems using 32-bit format for bus addr */
  3738. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3739. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3740. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3741. do { \
  3742. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3743. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3744. } while (0)
  3745. /* for systems using 64-bit format for bus addr */
  3746. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3747. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3748. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3749. do { \
  3750. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3751. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3752. } while (0)
  3753. /* for systems using 64-bit format for bus addr */
  3754. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3755. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3756. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3757. do { \
  3758. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3759. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3760. } while (0)
  3761. /* for systems using 32-bit format for bus addr */
  3762. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3763. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3764. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3765. do { \
  3766. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3767. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3768. } while (0)
  3769. /* for systems using 64-bit format for bus addr */
  3770. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3771. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3772. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3773. do { \
  3774. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3775. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3776. } while (0)
  3777. /* for systems using 64-bit format for bus addr */
  3778. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  3779. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  3780. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  3781. do { \
  3782. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  3783. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  3784. } while (0)
  3785. /*
  3786. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  3787. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  3788. * addresses are stored in a XXX-bit field.
  3789. * This macro is used to define both htt_wdi_ipa_config32_t and
  3790. * htt_wdi_ipa_config64_t structs.
  3791. */
  3792. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  3793. _paddr__tx_comp_ring_base_addr_, \
  3794. _paddr__tx_comp_wr_idx_addr_, \
  3795. _paddr__tx_ce_wr_idx_addr_, \
  3796. _paddr__rx_ind_ring_base_addr_, \
  3797. _paddr__rx_ind_rd_idx_addr_, \
  3798. _paddr__rx_ind_wr_idx_addr_, \
  3799. _paddr__rx_ring2_base_addr_,\
  3800. _paddr__rx_ring2_rd_idx_addr_,\
  3801. _paddr__rx_ring2_wr_idx_addr_) \
  3802. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  3803. { \
  3804. /* DWORD 0: flags and meta-data */ \
  3805. A_UINT32 \
  3806. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  3807. reserved: 8, \
  3808. tx_pkt_pool_size: 16;\
  3809. /* DWORD 1 */\
  3810. _paddr__tx_comp_ring_base_addr_;\
  3811. /* DWORD 2 (or 3)*/\
  3812. A_UINT32 tx_comp_ring_size;\
  3813. /* DWORD 3 (or 4)*/\
  3814. _paddr__tx_comp_wr_idx_addr_;\
  3815. /* DWORD 4 (or 6)*/\
  3816. _paddr__tx_ce_wr_idx_addr_;\
  3817. /* DWORD 5 (or 8)*/\
  3818. _paddr__rx_ind_ring_base_addr_;\
  3819. /* DWORD 6 (or 10)*/\
  3820. A_UINT32 rx_ind_ring_size;\
  3821. /* DWORD 7 (or 11)*/\
  3822. _paddr__rx_ind_rd_idx_addr_;\
  3823. /* DWORD 8 (or 13)*/\
  3824. _paddr__rx_ind_wr_idx_addr_;\
  3825. /* DWORD 9 (or 15)*/\
  3826. _paddr__rx_ring2_base_addr_;\
  3827. /* DWORD 10 (or 17) */\
  3828. A_UINT32 rx_ring2_size;\
  3829. /* DWORD 11 (or 18) */\
  3830. _paddr__rx_ring2_rd_idx_addr_;\
  3831. /* DWORD 12 (or 20) */\
  3832. _paddr__rx_ring2_wr_idx_addr_;\
  3833. } POSTPACK
  3834. /* define a htt_wdi_ipa_config32_t type */
  3835. 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));
  3836. /* define a htt_wdi_ipa_config64_t type */
  3837. 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));
  3838. #if HTT_PADDR64
  3839. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  3840. #else
  3841. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  3842. #endif
  3843. enum htt_wdi_ipa_op_code {
  3844. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  3845. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  3846. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  3847. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  3848. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  3849. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  3850. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  3851. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  3852. /* keep this last */
  3853. HTT_WDI_IPA_OPCODE_MAX
  3854. };
  3855. /**
  3856. * @brief HTT WDI_IPA Operation Request Message
  3857. *
  3858. * @details
  3859. * HTT WDI_IPA Operation Request message is sent by host
  3860. * to either suspend or resume WDI_IPA TX or RX path.
  3861. * |31 24|23 16|15 8|7 0|
  3862. * |----------------+----------------+----------------+----------------|
  3863. * | op_code | Rsvd | msg_type |
  3864. * |-------------------------------------------------------------------|
  3865. *
  3866. * Header fields:
  3867. * - MSG_TYPE
  3868. * Bits 7:0
  3869. * Purpose: Identifies this as WDI_IPA Operation Request message
  3870. * value: = 0x9
  3871. * - OP_CODE
  3872. * Bits 31:16
  3873. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  3874. * value: = enum htt_wdi_ipa_op_code
  3875. */
  3876. PREPACK struct htt_wdi_ipa_op_request_t
  3877. {
  3878. /* DWORD 0: flags and meta-data */
  3879. A_UINT32
  3880. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  3881. reserved: 8,
  3882. op_code: 16;
  3883. } POSTPACK;
  3884. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  3885. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  3886. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  3887. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  3888. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  3889. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  3890. do { \
  3891. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  3892. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  3893. } while (0)
  3894. /*
  3895. * @brief host -> target HTT_SRING_SETUP message
  3896. *
  3897. * @details
  3898. * After target is booted up, Host can send SRING setup message for
  3899. * each host facing LMAC SRING. Target setups up HW registers based
  3900. * on setup message and confirms back to Host if response_required is set.
  3901. * Host should wait for confirmation message before sending new SRING
  3902. * setup message
  3903. *
  3904. * The message would appear as follows:
  3905. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  3906. * |--------------- +-----------------+-----------------+-----------------|
  3907. * | ring_type | ring_id | pdev_id | msg_type |
  3908. * |----------------------------------------------------------------------|
  3909. * | ring_base_addr_lo |
  3910. * |----------------------------------------------------------------------|
  3911. * | ring_base_addr_hi |
  3912. * |----------------------------------------------------------------------|
  3913. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  3914. * |----------------------------------------------------------------------|
  3915. * | ring_head_offset32_remote_addr_lo |
  3916. * |----------------------------------------------------------------------|
  3917. * | ring_head_offset32_remote_addr_hi |
  3918. * |----------------------------------------------------------------------|
  3919. * | ring_tail_offset32_remote_addr_lo |
  3920. * |----------------------------------------------------------------------|
  3921. * | ring_tail_offset32_remote_addr_hi |
  3922. * |----------------------------------------------------------------------|
  3923. * | ring_msi_addr_lo |
  3924. * |----------------------------------------------------------------------|
  3925. * | ring_msi_addr_hi |
  3926. * |----------------------------------------------------------------------|
  3927. * | ring_msi_data |
  3928. * |----------------------------------------------------------------------|
  3929. * | intr_timer_th |IM| intr_batch_counter_th |
  3930. * |----------------------------------------------------------------------|
  3931. * | reserved |ID|RR| PTCF| intr_low_threshold |
  3932. * |----------------------------------------------------------------------|
  3933. * | reserved |IPA drop thres hi|IPA drop thres lo|
  3934. * |----------------------------------------------------------------------|
  3935. * Where
  3936. * IM = sw_intr_mode
  3937. * RR = response_required
  3938. * PTCF = prefetch_timer_cfg
  3939. * IP = IPA drop flag
  3940. *
  3941. * The message is interpreted as follows:
  3942. * dword0 - b'0:7 - msg_type: This will be set to
  3943. * HTT_H2T_MSG_TYPE_SRING_SETUP
  3944. * b'8:15 - pdev_id:
  3945. * 0 (for rings at SOC/UMAC level),
  3946. * 1/2/3 mac id (for rings at LMAC level)
  3947. * b'16:23 - ring_id: identify which ring is to setup,
  3948. * more details can be got from enum htt_srng_ring_id
  3949. * b'24:31 - ring_type: identify type of host rings,
  3950. * more details can be got from enum htt_srng_ring_type
  3951. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  3952. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  3953. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  3954. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  3955. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  3956. * SW_TO_HW_RING.
  3957. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  3958. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  3959. * Lower 32 bits of memory address of the remote variable
  3960. * storing the 4-byte word offset that identifies the head
  3961. * element within the ring.
  3962. * (The head offset variable has type A_UINT32.)
  3963. * Valid for HW_TO_SW and SW_TO_SW rings.
  3964. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  3965. * Upper 32 bits of memory address of the remote variable
  3966. * storing the 4-byte word offset that identifies the head
  3967. * element within the ring.
  3968. * (The head offset variable has type A_UINT32.)
  3969. * Valid for HW_TO_SW and SW_TO_SW rings.
  3970. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  3971. * Lower 32 bits of memory address of the remote variable
  3972. * storing the 4-byte word offset that identifies the tail
  3973. * element within the ring.
  3974. * (The tail offset variable has type A_UINT32.)
  3975. * Valid for HW_TO_SW and SW_TO_SW rings.
  3976. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  3977. * Upper 32 bits of memory address of the remote variable
  3978. * storing the 4-byte word offset that identifies the tail
  3979. * element within the ring.
  3980. * (The tail offset variable has type A_UINT32.)
  3981. * Valid for HW_TO_SW and SW_TO_SW rings.
  3982. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  3983. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3984. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  3985. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3986. * dword10 - b'0:31 - ring_msi_data: MSI data
  3987. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  3988. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3989. * dword11 - b'0:14 - intr_batch_counter_th:
  3990. * batch counter threshold is in units of 4-byte words.
  3991. * HW internally maintains and increments batch count.
  3992. * (see SRING spec for detail description).
  3993. * When batch count reaches threshold value, an interrupt
  3994. * is generated by HW.
  3995. * b'15 - sw_intr_mode:
  3996. * This configuration shall be static.
  3997. * Only programmed at power up.
  3998. * 0: generate pulse style sw interrupts
  3999. * 1: generate level style sw interrupts
  4000. * b'16:31 - intr_timer_th:
  4001. * The timer init value when timer is idle or is
  4002. * initialized to start downcounting.
  4003. * In 8us units (to cover a range of 0 to 524 ms)
  4004. * dword12 - b'0:15 - intr_low_threshold:
  4005. * Used only by Consumer ring to generate ring_sw_int_p.
  4006. * Ring entries low threshold water mark, that is used
  4007. * in combination with the interrupt timer as well as
  4008. * the the clearing of the level interrupt.
  4009. * b'16:18 - prefetch_timer_cfg:
  4010. * Used only by Consumer ring to set timer mode to
  4011. * support Application prefetch handling.
  4012. * The external tail offset/pointer will be updated
  4013. * at following intervals:
  4014. * 3'b000: (Prefetch feature disabled; used only for debug)
  4015. * 3'b001: 1 usec
  4016. * 3'b010: 4 usec
  4017. * 3'b011: 8 usec (default)
  4018. * 3'b100: 16 usec
  4019. * Others: Reserverd
  4020. * b'19 - response_required:
  4021. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4022. * b'20 - ipa_drop_flag:
  4023. Indicates that host will config ipa drop threshold percentage
  4024. * b'21:31 - reserved: reserved for future use
  4025. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4026. * b'8:15 - ipa drop high threshold percentage:
  4027. * b'16:31 - Reserved
  4028. */
  4029. PREPACK struct htt_sring_setup_t {
  4030. A_UINT32 msg_type: 8,
  4031. pdev_id: 8,
  4032. ring_id: 8,
  4033. ring_type: 8;
  4034. A_UINT32 ring_base_addr_lo;
  4035. A_UINT32 ring_base_addr_hi;
  4036. A_UINT32 ring_size: 16,
  4037. ring_entry_size: 8,
  4038. ring_misc_cfg_flag: 8;
  4039. A_UINT32 ring_head_offset32_remote_addr_lo;
  4040. A_UINT32 ring_head_offset32_remote_addr_hi;
  4041. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4042. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4043. A_UINT32 ring_msi_addr_lo;
  4044. A_UINT32 ring_msi_addr_hi;
  4045. A_UINT32 ring_msi_data;
  4046. A_UINT32 intr_batch_counter_th: 15,
  4047. sw_intr_mode: 1,
  4048. intr_timer_th: 16;
  4049. A_UINT32 intr_low_threshold: 16,
  4050. prefetch_timer_cfg: 3,
  4051. response_required: 1,
  4052. ipa_drop_flag: 1,
  4053. reserved1: 11;
  4054. A_UINT32 ipa_drop_low_threshold: 8,
  4055. ipa_drop_high_threshold: 8,
  4056. reserved: 16;
  4057. } POSTPACK;
  4058. enum htt_srng_ring_type {
  4059. HTT_HW_TO_SW_RING = 0,
  4060. HTT_SW_TO_HW_RING,
  4061. HTT_SW_TO_SW_RING,
  4062. /* Insert new ring types above this line */
  4063. };
  4064. enum htt_srng_ring_id {
  4065. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4066. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4067. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4068. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4069. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4070. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4071. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4072. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4073. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4074. /* Add Other SRING which can't be directly configured by host software above this line */
  4075. };
  4076. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4077. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4078. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4079. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4080. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4081. HTT_SRING_SETUP_PDEV_ID_S)
  4082. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4083. do { \
  4084. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4085. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4086. } while (0)
  4087. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4088. #define HTT_SRING_SETUP_RING_ID_S 16
  4089. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4090. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4091. HTT_SRING_SETUP_RING_ID_S)
  4092. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4093. do { \
  4094. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4095. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4096. } while (0)
  4097. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4098. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4099. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4100. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4101. HTT_SRING_SETUP_RING_TYPE_S)
  4102. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4103. do { \
  4104. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4105. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4106. } while (0)
  4107. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4108. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4109. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4110. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4111. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4112. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4113. do { \
  4114. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4115. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4116. } while (0)
  4117. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4118. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4119. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4120. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4121. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4122. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4123. do { \
  4124. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4125. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4126. } while (0)
  4127. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4128. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4129. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4130. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4131. HTT_SRING_SETUP_RING_SIZE_S)
  4132. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4133. do { \
  4134. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4135. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4136. } while (0)
  4137. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4138. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4139. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4140. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4141. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4142. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4143. do { \
  4144. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4145. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4146. } while (0)
  4147. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4148. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4149. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4150. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4151. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4152. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4153. do { \
  4154. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4155. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4156. } while (0)
  4157. /* This control bit is applicable to only Producer, which updates Ring ID field
  4158. * of each descriptor before pushing into the ring.
  4159. * 0: updates ring_id(default)
  4160. * 1: ring_id updating disabled */
  4161. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4162. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4163. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4164. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4165. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4166. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4167. do { \
  4168. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4169. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4170. } while (0)
  4171. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4172. * of each descriptor before pushing into the ring.
  4173. * 0: updates Loopcnt(default)
  4174. * 1: Loopcnt updating disabled */
  4175. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4176. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4177. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4178. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4179. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4180. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4181. do { \
  4182. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4183. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4184. } while (0)
  4185. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4186. * into security_id port of GXI/AXI. */
  4187. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4188. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4189. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4190. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4191. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4192. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4193. do { \
  4194. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4195. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4196. } while (0)
  4197. /* During MSI write operation, SRNG drives value of this register bit into
  4198. * swap bit of GXI/AXI. */
  4199. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4200. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4201. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4202. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4203. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4204. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4205. do { \
  4206. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4207. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4208. } while (0)
  4209. /* During Pointer write operation, SRNG drives value of this register bit into
  4210. * swap bit of GXI/AXI. */
  4211. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4212. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4213. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4214. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4215. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4216. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4217. do { \
  4218. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4219. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4220. } while (0)
  4221. /* During any data or TLV write operation, SRNG drives value of this register
  4222. * bit into swap bit of GXI/AXI. */
  4223. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4224. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4225. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4226. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4227. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4228. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4229. do { \
  4230. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4231. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4232. } while (0)
  4233. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4234. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4235. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4236. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4237. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4238. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4239. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4240. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4241. do { \
  4242. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4243. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4244. } while (0)
  4245. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4246. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4247. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4248. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4249. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4250. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4251. do { \
  4252. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4253. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4254. } while (0)
  4255. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4256. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4257. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4258. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4259. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4260. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4261. do { \
  4262. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4263. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4264. } while (0)
  4265. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4266. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4267. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4268. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4269. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4270. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4271. do { \
  4272. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4273. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4274. } while (0)
  4275. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4276. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4277. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4278. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4279. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4280. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4281. do { \
  4282. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4283. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4284. } while (0)
  4285. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4286. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4287. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4288. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4289. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4290. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4291. do { \
  4292. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4293. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4294. } while (0)
  4295. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4296. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4297. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4298. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4299. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4300. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4301. do { \
  4302. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4303. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4304. } while (0)
  4305. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4306. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4307. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4308. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4309. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4310. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4311. do { \
  4312. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4313. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4314. } while (0)
  4315. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4316. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4317. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4318. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4319. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4320. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4321. do { \
  4322. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4323. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4324. } while (0)
  4325. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4326. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4327. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4328. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4329. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4330. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4331. do { \
  4332. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4333. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4334. } while (0)
  4335. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4336. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4337. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4338. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4339. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4340. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4341. do { \
  4342. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4343. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4344. } while (0)
  4345. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4346. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4347. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4348. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4349. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4350. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4351. do { \
  4352. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4353. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4354. } while (0)
  4355. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4356. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4357. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4358. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4359. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4360. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4361. do { \
  4362. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4363. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4364. } while (0)
  4365. /**
  4366. * @brief HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG Message
  4367. *
  4368. * @details
  4369. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4370. * configure RXDMA rings.
  4371. * The configuration is per ring based and includes both packet subtypes
  4372. * and PPDU/MPDU TLVs.
  4373. *
  4374. * The message would appear as follows:
  4375. *
  4376. * |31 28|27|26|25|24|23 16|15 |9 8|7 0|
  4377. * |-----+--+--+--+--+----------------+------------+---+---------------|
  4378. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  4379. * |-------------------------------------------------------------------|
  4380. * | rsvd2 | ring_buffer_size |
  4381. * |-------------------------------------------------------------------|
  4382. * | packet_type_enable_flags_0 |
  4383. * |-------------------------------------------------------------------|
  4384. * | packet_type_enable_flags_1 |
  4385. * |-------------------------------------------------------------------|
  4386. * | packet_type_enable_flags_2 |
  4387. * |-------------------------------------------------------------------|
  4388. * | packet_type_enable_flags_3 |
  4389. * |-------------------------------------------------------------------|
  4390. * | tlv_filter_in_flags |
  4391. * |-------------------------------------------------------------------|
  4392. * | rx_header_offset | rx_packet_offset |
  4393. * |-------------------------------------------------------------------|
  4394. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  4395. * |-------------------------------------------------------------------|
  4396. * | rx_msdu_start_offset | rx_msdu_end_offset |
  4397. * |-------------------------------------------------------------------|
  4398. * | rsvd3 | rx_attention_offset |
  4399. * |-------------------------------------------------------------------|
  4400. * | rsvd4 | rx_drop_threshold |
  4401. * |-------------------------------------------------------------------|
  4402. * Where:
  4403. * PS = pkt_swap
  4404. * SS = status_swap
  4405. * OV = rx_offsets_valid
  4406. * DT = drop_thresh_valid
  4407. * The message is interpreted as follows:
  4408. * dword0 - b'0:7 - msg_type: This will be set to
  4409. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4410. * b'8:15 - pdev_id:
  4411. * 0 (for rings at SOC/UMAC level),
  4412. * 1/2/3 mac id (for rings at LMAC level)
  4413. * b'16:23 - ring_id : Identify the ring to configure.
  4414. * More details can be got from enum htt_srng_ring_id
  4415. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  4416. * BUF_RING_CFG_0 defs within HW .h files,
  4417. * e.g. wmac_top_reg_seq_hwioreg.h
  4418. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  4419. * BUF_RING_CFG_0 defs within HW .h files,
  4420. * e.g. wmac_top_reg_seq_hwioreg.h
  4421. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  4422. * configuration fields are valid
  4423. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  4424. * rx_drop_threshold field is valid
  4425. * b'28:31 - rsvd1: reserved for future use
  4426. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4427. * in byte units.
  4428. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4429. * - b'16:31 - rsvd2: Reserved for future use
  4430. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4431. * Enable MGMT packet from 0b0000 to 0b1001
  4432. * bits from low to high: FP, MD, MO - 3 bits
  4433. * FP: Filter_Pass
  4434. * MD: Monitor_Direct
  4435. * MO: Monitor_Other
  4436. * 10 mgmt subtypes * 3 bits -> 30 bits
  4437. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4438. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4439. * Enable MGMT packet from 0b1010 to 0b1111
  4440. * bits from low to high: FP, MD, MO - 3 bits
  4441. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4442. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4443. * Enable CTRL packet from 0b0000 to 0b1001
  4444. * bits from low to high: FP, MD, MO - 3 bits
  4445. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4446. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4447. * Enable CTRL packet from 0b1010 to 0b1111,
  4448. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4449. * bits from low to high: FP, MD, MO - 3 bits
  4450. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4451. * dword6 - b'0:31 - tlv_filter_in_flags:
  4452. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4453. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4454. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  4455. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4456. * A value of 0 will be considered as ignore this config.
  4457. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4458. * e.g. wmac_top_reg_seq_hwioreg.h
  4459. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  4460. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4461. * A value of 0 will be considered as ignore this config.
  4462. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4463. * e.g. wmac_top_reg_seq_hwioreg.h
  4464. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  4465. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4466. * A value of 0 will be considered as ignore this config.
  4467. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4468. * e.g. wmac_top_reg_seq_hwioreg.h
  4469. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  4470. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4471. * A value of 0 will be considered as ignore this config.
  4472. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4473. * e.g. wmac_top_reg_seq_hwioreg.h
  4474. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  4475. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4476. * A value of 0 will be considered as ignore this config.
  4477. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4478. * e.g. wmac_top_reg_seq_hwioreg.h
  4479. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  4480. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4481. * A value of 0 will be considered as ignore this config.
  4482. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4483. * e.g. wmac_top_reg_seq_hwioreg.h
  4484. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  4485. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4486. * A value of 0 will be considered as ignore this config.
  4487. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  4488. * e.g. wmac_top_reg_seq_hwioreg.h
  4489. * - b'16:31 - rsvd3 for future use
  4490. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  4491. * to source rings. Consumer drops packets if the available
  4492. * words in the ring falls below the configured threshold
  4493. * value.
  4494. */
  4495. PREPACK struct htt_rx_ring_selection_cfg_t {
  4496. A_UINT32 msg_type: 8,
  4497. pdev_id: 8,
  4498. ring_id: 8,
  4499. status_swap: 1,
  4500. pkt_swap: 1,
  4501. rx_offsets_valid: 1,
  4502. drop_thresh_valid: 1,
  4503. rsvd1: 4;
  4504. A_UINT32 ring_buffer_size: 16,
  4505. rsvd2: 16;
  4506. A_UINT32 packet_type_enable_flags_0;
  4507. A_UINT32 packet_type_enable_flags_1;
  4508. A_UINT32 packet_type_enable_flags_2;
  4509. A_UINT32 packet_type_enable_flags_3;
  4510. A_UINT32 tlv_filter_in_flags;
  4511. A_UINT32 rx_packet_offset: 16,
  4512. rx_header_offset: 16;
  4513. A_UINT32 rx_mpdu_end_offset: 16,
  4514. rx_mpdu_start_offset: 16;
  4515. A_UINT32 rx_msdu_end_offset: 16,
  4516. rx_msdu_start_offset: 16;
  4517. A_UINT32 rx_attn_offset: 16,
  4518. rsvd3: 16;
  4519. A_UINT32 rx_drop_threshold: 10,
  4520. rsvd4: 22;
  4521. } POSTPACK;
  4522. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4523. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4524. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4525. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4526. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4527. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4528. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4529. do { \
  4530. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4531. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4532. } while (0)
  4533. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4534. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4535. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4536. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4537. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4538. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4539. do { \
  4540. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4541. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4542. } while (0)
  4543. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4544. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4545. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4546. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4547. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4548. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4549. do { \
  4550. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  4551. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4552. } while (0)
  4553. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4554. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4555. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4556. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4557. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4558. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4559. do { \
  4560. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  4561. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4562. } while (0)
  4563. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  4564. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  4565. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  4566. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  4567. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  4568. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  4569. do { \
  4570. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  4571. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  4572. } while (0)
  4573. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  4574. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  4575. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  4576. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  4577. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  4578. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  4579. do { \
  4580. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  4581. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  4582. } while (0)
  4583. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4584. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4585. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4586. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4587. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4588. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4589. do { \
  4590. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  4591. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4592. } while (0)
  4593. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4594. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4595. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4596. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4597. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4598. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4599. do { \
  4600. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  4601. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4602. } while (0)
  4603. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4604. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4605. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4606. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4607. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4608. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4609. do { \
  4610. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  4611. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4612. } while (0)
  4613. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4614. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4615. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4616. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4617. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4618. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4619. do { \
  4620. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  4621. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4622. } while (0)
  4623. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4624. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4625. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4626. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4627. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4628. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4629. do { \
  4630. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  4631. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4632. } while (0)
  4633. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4634. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4635. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4636. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4637. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4638. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4639. do { \
  4640. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4641. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4642. } while (0)
  4643. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  4644. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  4645. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  4646. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  4647. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  4648. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  4649. do { \
  4650. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  4651. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  4652. } while (0)
  4653. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  4654. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  4655. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  4656. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  4657. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  4658. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  4659. do { \
  4660. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  4661. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  4662. } while (0)
  4663. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  4664. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  4665. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  4666. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  4667. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  4668. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  4669. do { \
  4670. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  4671. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  4672. } while (0)
  4673. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  4674. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  4675. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  4676. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  4677. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  4678. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  4679. do { \
  4680. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  4681. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  4682. } while (0)
  4683. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  4684. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  4685. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  4686. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  4687. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  4688. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  4689. do { \
  4690. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  4691. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  4692. } while (0)
  4693. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  4694. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  4695. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  4696. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  4697. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  4698. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  4699. do { \
  4700. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  4701. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  4702. } while (0)
  4703. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  4704. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  4705. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  4706. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  4707. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  4708. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  4709. do { \
  4710. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  4711. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  4712. } while (0)
  4713. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  4714. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  4715. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  4716. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  4717. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  4718. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  4719. do { \
  4720. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  4721. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  4722. } while (0)
  4723. /*
  4724. * Subtype based MGMT frames enable bits.
  4725. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4726. */
  4727. /* association request */
  4728. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  4729. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4730. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  4731. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4732. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  4733. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4734. /* association response */
  4735. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  4736. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4737. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  4738. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4739. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  4740. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4741. /* Reassociation request */
  4742. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  4743. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  4744. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  4745. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  4746. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  4747. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  4748. /* Reassociation response */
  4749. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  4750. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  4751. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  4752. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  4753. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  4754. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  4755. /* Probe request */
  4756. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  4757. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  4758. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  4759. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  4760. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  4761. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  4762. /* Probe response */
  4763. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  4764. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  4765. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  4766. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  4767. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  4768. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  4769. /* Timing Advertisement */
  4770. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  4771. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  4772. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  4773. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  4774. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  4775. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  4776. /* Reserved */
  4777. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  4778. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  4779. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  4780. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  4781. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  4782. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  4783. /* Beacon */
  4784. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  4785. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  4786. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  4787. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  4788. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  4789. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  4790. /* ATIM */
  4791. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  4792. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  4793. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  4794. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  4795. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  4796. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  4797. /* Disassociation */
  4798. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  4799. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  4800. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  4801. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  4802. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  4803. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  4804. /* Authentication */
  4805. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  4806. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  4807. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  4808. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  4809. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  4810. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  4811. /* Deauthentication */
  4812. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  4813. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  4814. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  4815. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  4816. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  4817. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  4818. /* Action */
  4819. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  4820. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  4821. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  4822. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  4823. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  4824. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  4825. /* Action No Ack */
  4826. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  4827. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  4828. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  4829. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  4830. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  4831. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  4832. /* Reserved */
  4833. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  4834. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  4835. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  4836. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  4837. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  4838. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  4839. /*
  4840. * Subtype based CTRL frames enable bits.
  4841. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  4842. */
  4843. /* Reserved */
  4844. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  4845. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  4846. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  4847. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  4848. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  4849. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  4850. /* Reserved */
  4851. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  4852. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  4853. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  4854. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  4855. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  4856. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  4857. /* Reserved */
  4858. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  4859. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  4860. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  4861. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  4862. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  4863. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  4864. /* Reserved */
  4865. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  4866. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  4867. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  4868. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  4869. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  4870. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  4871. /* Reserved */
  4872. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  4873. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  4874. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  4875. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  4876. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  4877. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  4878. /* Reserved */
  4879. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  4880. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  4881. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  4882. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  4883. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  4884. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  4885. /* Reserved */
  4886. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  4887. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  4888. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  4889. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  4890. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  4891. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  4892. /* Control Wrapper */
  4893. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  4894. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  4895. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  4896. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  4897. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  4898. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  4899. /* Block Ack Request */
  4900. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  4901. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  4902. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  4903. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  4904. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  4905. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  4906. /* Block Ack*/
  4907. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  4908. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  4909. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  4910. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  4911. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  4912. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  4913. /* PS-POLL */
  4914. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  4915. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  4916. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  4917. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  4918. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  4919. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  4920. /* RTS */
  4921. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  4922. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  4923. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  4924. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  4925. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  4926. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  4927. /* CTS */
  4928. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  4929. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  4930. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  4931. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  4932. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  4933. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  4934. /* ACK */
  4935. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  4936. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  4937. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  4938. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  4939. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  4940. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  4941. /* CF-END */
  4942. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  4943. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  4944. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  4945. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  4946. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  4947. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  4948. /* CF-END + CF-ACK */
  4949. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  4950. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  4951. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  4952. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  4953. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  4954. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  4955. /* Multicast data */
  4956. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  4957. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  4958. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  4959. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  4960. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  4961. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  4962. /* Unicast data */
  4963. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  4964. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  4965. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  4966. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  4967. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  4968. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  4969. /* NULL data */
  4970. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  4971. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  4972. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  4973. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  4974. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  4975. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  4976. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  4977. do { \
  4978. HTT_CHECK_SET_VAL(httsym, value); \
  4979. (word) |= (value) << httsym##_S; \
  4980. } while (0)
  4981. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  4982. (((word) & httsym##_M) >> httsym##_S)
  4983. #define htt_rx_ring_pkt_enable_subtype_set( \
  4984. word, flag, mode, type, subtype, val) \
  4985. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  4986. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  4987. #define htt_rx_ring_pkt_enable_subtype_get( \
  4988. word, flag, mode, type, subtype) \
  4989. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  4990. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  4991. /* Definition to filter in TLVs */
  4992. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  4993. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  4994. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  4995. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  4996. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  4997. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  4998. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  4999. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  5000. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  5001. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  5002. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  5003. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  5004. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  5005. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  5006. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  5007. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  5008. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  5009. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  5010. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  5011. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  5012. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  5013. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  5014. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  5015. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  5016. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  5017. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  5018. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  5019. do { \
  5020. HTT_CHECK_SET_VAL(httsym, enable); \
  5021. (word) |= (enable) << httsym##_S; \
  5022. } while (0)
  5023. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  5024. (((word) & httsym##_M) >> httsym##_S)
  5025. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  5026. HTT_RX_RING_TLV_ENABLE_SET( \
  5027. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  5028. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  5029. HTT_RX_RING_TLV_ENABLE_GET( \
  5030. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  5031. /**
  5032. * @brief HTT_H2T_MSG_TYPE_RFS_CONFIG
  5033. * host --> target Receive Flow Steering configuration message definition.
  5034. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5035. * The reason for this is we want RFS to be configured and ready before MAC
  5036. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5037. *
  5038. * |31 24|23 16|15 9|8|7 0|
  5039. * |----------------+----------------+----------------+----------------|
  5040. * | reserved |E| msg type |
  5041. * |-------------------------------------------------------------------|
  5042. * Where E = RFS enable flag
  5043. *
  5044. * The RFS_CONFIG message consists of a single 4-byte word.
  5045. *
  5046. * Header fields:
  5047. * - MSG_TYPE
  5048. * Bits 7:0
  5049. * Purpose: identifies this as a RFS config msg
  5050. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  5051. * - RFS_CONFIG
  5052. * Bit 8
  5053. * Purpose: Tells target whether to enable (1) or disable (0)
  5054. * flow steering feature when sending rx indication messages to host
  5055. */
  5056. #define HTT_H2T_RFS_CONFIG_M 0x100
  5057. #define HTT_H2T_RFS_CONFIG_S 8
  5058. #define HTT_RX_RFS_CONFIG_GET(_var) \
  5059. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  5060. HTT_H2T_RFS_CONFIG_S)
  5061. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  5062. do { \
  5063. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  5064. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  5065. } while (0)
  5066. #define HTT_RFS_CFG_REQ_BYTES 4
  5067. /**
  5068. * @brief host -> target FW extended statistics retrieve
  5069. *
  5070. * @details
  5071. * The following field definitions describe the format of the HTT host
  5072. * to target FW extended stats retrieve message.
  5073. * The message specifies the type of stats the host wants to retrieve.
  5074. *
  5075. * |31 24|23 16|15 8|7 0|
  5076. * |-----------------------------------------------------------|
  5077. * | reserved | stats type | pdev_mask | msg type |
  5078. * |-----------------------------------------------------------|
  5079. * | config param [0] |
  5080. * |-----------------------------------------------------------|
  5081. * | config param [1] |
  5082. * |-----------------------------------------------------------|
  5083. * | config param [2] |
  5084. * |-----------------------------------------------------------|
  5085. * | config param [3] |
  5086. * |-----------------------------------------------------------|
  5087. * | reserved |
  5088. * |-----------------------------------------------------------|
  5089. * | cookie LSBs |
  5090. * |-----------------------------------------------------------|
  5091. * | cookie MSBs |
  5092. * |-----------------------------------------------------------|
  5093. * Header fields:
  5094. * - MSG_TYPE
  5095. * Bits 7:0
  5096. * Purpose: identifies this is a extended stats upload request message
  5097. * Value: 0x10
  5098. * - PDEV_MASK
  5099. * Bits 8:15
  5100. * Purpose: identifies the mask of PDEVs to retrieve stats from
  5101. * Value: This is a overloaded field, refer to usage and interpretation of
  5102. * PDEV in interface document.
  5103. * Bit 8 : Reserved for SOC stats
  5104. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5105. * Indicates MACID_MASK in DBS
  5106. * - STATS_TYPE
  5107. * Bits 23:16
  5108. * Purpose: identifies which FW statistics to upload
  5109. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  5110. * - Reserved
  5111. * Bits 31:24
  5112. * - CONFIG_PARAM [0]
  5113. * Bits 31:0
  5114. * Purpose: give an opaque configuration value to the specified stats type
  5115. * Value: stats-type specific configuration value
  5116. * Refer to htt_stats.h for interpretation for each stats sub_type
  5117. * - CONFIG_PARAM [1]
  5118. * Bits 31:0
  5119. * Purpose: give an opaque configuration value to the specified stats type
  5120. * Value: stats-type specific configuration value
  5121. * Refer to htt_stats.h for interpretation for each stats sub_type
  5122. * - CONFIG_PARAM [2]
  5123. * Bits 31:0
  5124. * Purpose: give an opaque configuration value to the specified stats type
  5125. * Value: stats-type specific configuration value
  5126. * Refer to htt_stats.h for interpretation for each stats sub_type
  5127. * - CONFIG_PARAM [3]
  5128. * Bits 31:0
  5129. * Purpose: give an opaque configuration value to the specified stats type
  5130. * Value: stats-type specific configuration value
  5131. * Refer to htt_stats.h for interpretation for each stats sub_type
  5132. * - Reserved [31:0] for future use.
  5133. * - COOKIE_LSBS
  5134. * Bits 31:0
  5135. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5136. * message with its preceding host->target stats request message.
  5137. * Value: LSBs of the opaque cookie specified by the host-side requestor
  5138. * - COOKIE_MSBS
  5139. * Bits 31:0
  5140. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5141. * message with its preceding host->target stats request message.
  5142. * Value: MSBs of the opaque cookie specified by the host-side requestor
  5143. */
  5144. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  5145. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  5146. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  5147. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  5148. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  5149. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  5150. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  5151. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  5152. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  5153. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  5154. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  5155. do { \
  5156. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  5157. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  5158. } while (0)
  5159. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  5160. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  5161. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  5162. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  5163. do { \
  5164. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  5165. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  5166. } while (0)
  5167. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  5168. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  5169. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  5170. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  5171. do { \
  5172. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  5173. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  5174. } while (0)
  5175. /**
  5176. * @brief host -> target FW PPDU_STATS request message
  5177. *
  5178. * @details
  5179. * The following field definitions describe the format of the HTT host
  5180. * to target FW for PPDU_STATS_CFG msg.
  5181. * The message allows the host to configure the PPDU_STATS_IND messages
  5182. * produced by the target.
  5183. *
  5184. * |31 24|23 16|15 8|7 0|
  5185. * |-----------------------------------------------------------|
  5186. * | REQ bit mask | pdev_mask | msg type |
  5187. * |-----------------------------------------------------------|
  5188. * Header fields:
  5189. * - MSG_TYPE
  5190. * Bits 7:0
  5191. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  5192. * Value: 0x11
  5193. * - PDEV_MASK
  5194. * Bits 8:15
  5195. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  5196. * Value: This is a overloaded field, refer to usage and interpretation of
  5197. * PDEV in interface document.
  5198. * Bit 8 : Reserved for SOC stats
  5199. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5200. * Indicates MACID_MASK in DBS
  5201. * - REQ_TLV_BIT_MASK
  5202. * Bits 16:31
  5203. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  5204. * needs to be included in the target's PPDU_STATS_IND messages.
  5205. * Value: refer htt_ppdu_stats_tlv_tag_t
  5206. *
  5207. */
  5208. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  5209. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  5210. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  5211. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  5212. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  5213. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  5214. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  5215. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  5216. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  5217. do { \
  5218. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  5219. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  5220. } while (0)
  5221. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  5222. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  5223. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  5224. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  5225. do { \
  5226. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  5227. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  5228. } while (0)
  5229. /**
  5230. * @brief Host-->target HTT RX FSE setup message
  5231. * @details
  5232. * Through this message, the host will provide details of the flow tables
  5233. * in host DDR along with hash keys.
  5234. * This message can be sent per SOC or per PDEV, which is differentiated
  5235. * by pdev id values.
  5236. * The host will allocate flow search table and sends table size,
  5237. * physical DMA address of flow table, and hash keys to firmware to
  5238. * program into the RXOLE FSE HW block.
  5239. *
  5240. * The following field definitions describe the format of the RX FSE setup
  5241. * message sent from the host to target
  5242. *
  5243. * Header fields:
  5244. * dword0 - b'7:0 - msg_type: This will be set to
  5245. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  5246. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5247. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  5248. * pdev's LMAC ring.
  5249. * b'31:16 - reserved : Reserved for future use
  5250. * dword1 - b'19:0 - number of records: This field indicates the number of
  5251. * entries in the flow table. For example: 8k number of
  5252. * records is equivalent to
  5253. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  5254. * b'27:20 - max search: This field specifies the skid length to FSE
  5255. * parser HW module whenever match is not found at the
  5256. * exact index pointed by hash.
  5257. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  5258. * Refer htt_ip_da_sa_prefix below for more details.
  5259. * b'31:30 - reserved: Reserved for future use
  5260. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  5261. * table allocated by host in DDR
  5262. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  5263. * table allocated by host in DDR
  5264. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  5265. * entry hashing
  5266. *
  5267. *
  5268. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  5269. * |---------------------------------------------------------------|
  5270. * | reserved | pdev_id | MSG_TYPE |
  5271. * |---------------------------------------------------------------|
  5272. * |resvd|IPDSA| max_search | Number of records |
  5273. * |---------------------------------------------------------------|
  5274. * | base address lo |
  5275. * |---------------------------------------------------------------|
  5276. * | base address high |
  5277. * |---------------------------------------------------------------|
  5278. * | toeplitz key 31_0 |
  5279. * |---------------------------------------------------------------|
  5280. * | toeplitz key 63_32 |
  5281. * |---------------------------------------------------------------|
  5282. * | toeplitz key 95_64 |
  5283. * |---------------------------------------------------------------|
  5284. * | toeplitz key 127_96 |
  5285. * |---------------------------------------------------------------|
  5286. * | toeplitz key 159_128 |
  5287. * |---------------------------------------------------------------|
  5288. * | toeplitz key 191_160 |
  5289. * |---------------------------------------------------------------|
  5290. * | toeplitz key 223_192 |
  5291. * |---------------------------------------------------------------|
  5292. * | toeplitz key 255_224 |
  5293. * |---------------------------------------------------------------|
  5294. * | toeplitz key 287_256 |
  5295. * |---------------------------------------------------------------|
  5296. * | reserved | toeplitz key 314_288(26:0 bits) |
  5297. * |---------------------------------------------------------------|
  5298. * where:
  5299. * IPDSA = ip_da_sa
  5300. */
  5301. /**
  5302. * @brief: htt_ip_da_sa_prefix
  5303. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  5304. * IPv6 addresses beginning with 0x20010db8 are reserved for
  5305. * documentation per RFC3849
  5306. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  5307. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  5308. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  5309. */
  5310. enum htt_ip_da_sa_prefix {
  5311. HTT_RX_IPV6_20010db8,
  5312. HTT_RX_IPV4_MAPPED_IPV6,
  5313. HTT_RX_IPV4_COMPATIBLE_IPV6,
  5314. HTT_RX_IPV6_64FF9B,
  5315. };
  5316. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  5317. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  5318. pdev_id:8,
  5319. reserved0:16;
  5320. A_UINT32 num_records:20,
  5321. max_search:8,
  5322. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  5323. reserved1:2;
  5324. A_UINT32 base_addr_lo;
  5325. A_UINT32 base_addr_hi;
  5326. A_UINT32 toeplitz31_0;
  5327. A_UINT32 toeplitz63_32;
  5328. A_UINT32 toeplitz95_64;
  5329. A_UINT32 toeplitz127_96;
  5330. A_UINT32 toeplitz159_128;
  5331. A_UINT32 toeplitz191_160;
  5332. A_UINT32 toeplitz223_192;
  5333. A_UINT32 toeplitz255_224;
  5334. A_UINT32 toeplitz287_256;
  5335. A_UINT32 toeplitz314_288:27,
  5336. reserved2:5;
  5337. } POSTPACK;
  5338. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  5339. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  5340. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  5341. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  5342. /* DWORD 0: Pdev ID */
  5343. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  5344. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  5345. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  5346. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  5347. HTT_RX_FSE_SETUP_PDEV_ID_S)
  5348. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  5349. do { \
  5350. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  5351. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  5352. } while (0)
  5353. /* DWORD 1:num of records */
  5354. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  5355. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  5356. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  5357. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  5358. HTT_RX_FSE_SETUP_NUM_REC_S)
  5359. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  5360. do { \
  5361. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  5362. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  5363. } while (0)
  5364. /* DWORD 1:max_search */
  5365. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  5366. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  5367. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  5368. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  5369. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  5370. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  5371. do { \
  5372. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  5373. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  5374. } while (0)
  5375. /* DWORD 1:ip_da_sa prefix */
  5376. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  5377. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  5378. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  5379. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  5380. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  5381. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  5382. do { \
  5383. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  5384. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  5385. } while (0)
  5386. /* DWORD 2: Base Address LO */
  5387. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  5388. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  5389. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  5390. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  5391. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  5392. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  5393. do { \
  5394. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  5395. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  5396. } while (0)
  5397. /* DWORD 3: Base Address High */
  5398. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  5399. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  5400. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  5401. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  5402. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  5403. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  5404. do { \
  5405. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  5406. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  5407. } while (0)
  5408. /* DWORD 4-12: Hash Value */
  5409. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  5410. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  5411. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  5412. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  5413. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  5414. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  5415. do { \
  5416. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  5417. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  5418. } while (0)
  5419. /* DWORD 13: Hash Value 314:288 bits */
  5420. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  5421. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  5422. HTT_RX_FSE_SETUP_HASH_314_288_S)
  5423. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  5424. do { \
  5425. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  5426. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  5427. } while (0)
  5428. /**
  5429. * @brief Host-->target HTT RX FSE operation message
  5430. * @details
  5431. * The host will send this Flow Search Engine (FSE) operation message for
  5432. * every flow add/delete operation.
  5433. * The FSE operation includes FSE full cache invalidation or individual entry
  5434. * invalidation.
  5435. * This message can be sent per SOC or per PDEV which is differentiated
  5436. * by pdev id values.
  5437. *
  5438. * |31 16|15 8|7 1|0|
  5439. * |-------------------------------------------------------------|
  5440. * | reserved | pdev_id | MSG_TYPE |
  5441. * |-------------------------------------------------------------|
  5442. * | reserved | operation |I|
  5443. * |-------------------------------------------------------------|
  5444. * | ip_src_addr_31_0 |
  5445. * |-------------------------------------------------------------|
  5446. * | ip_src_addr_63_32 |
  5447. * |-------------------------------------------------------------|
  5448. * | ip_src_addr_95_64 |
  5449. * |-------------------------------------------------------------|
  5450. * | ip_src_addr_127_96 |
  5451. * |-------------------------------------------------------------|
  5452. * | ip_dst_addr_31_0 |
  5453. * |-------------------------------------------------------------|
  5454. * | ip_dst_addr_63_32 |
  5455. * |-------------------------------------------------------------|
  5456. * | ip_dst_addr_95_64 |
  5457. * |-------------------------------------------------------------|
  5458. * | ip_dst_addr_127_96 |
  5459. * |-------------------------------------------------------------|
  5460. * | l4_dst_port | l4_src_port |
  5461. * | (32-bit SPI incase of IPsec) |
  5462. * |-------------------------------------------------------------|
  5463. * | reserved | l4_proto |
  5464. * |-------------------------------------------------------------|
  5465. *
  5466. * where I is 1-bit ipsec_valid.
  5467. *
  5468. * The following field definitions describe the format of the RX FSE operation
  5469. * message sent from the host to target for every add/delete flow entry to flow
  5470. * table.
  5471. *
  5472. * Header fields:
  5473. * dword0 - b'7:0 - msg_type: This will be set to
  5474. * HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  5475. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5476. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  5477. * specified pdev's LMAC ring.
  5478. * b'31:16 - reserved : Reserved for future use
  5479. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  5480. * (Internet Protocol Security).
  5481. * IPsec describes the framework for providing security at
  5482. * IP layer. IPsec is defined for both versions of IP:
  5483. * IPV4 and IPV6.
  5484. * Please refer to htt_rx_flow_proto enumeration below for
  5485. * more info.
  5486. * ipsec_valid = 1 for IPSEC packets
  5487. * ipsec_valid = 0 for IP Packets
  5488. * b'7:1 - operation: This indicates types of FSE operation.
  5489. * Refer to htt_rx_fse_operation enumeration:
  5490. * 0 - No Cache Invalidation required
  5491. * 1 - Cache invalidate only one entry given by IP
  5492. * src/dest address at DWORD[2:9]
  5493. * 2 - Complete FSE Cache Invalidation
  5494. * 3 - FSE Disable
  5495. * 4 - FSE Enable
  5496. * b'31:8 - reserved: Reserved for future use
  5497. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  5498. * for per flow addition/deletion
  5499. * For IPV4 src/dest addresses, the first A_UINT32 is used
  5500. * and the subsequent 3 A_UINT32 will be padding bytes.
  5501. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  5502. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  5503. * from 0 to 65535 but only 0 to 1023 are designated as
  5504. * well-known ports. Refer to [RFC1700] for more details.
  5505. * This field is valid only if
  5506. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  5507. * - L4 dest port (31:16): 16-bit Destination Port numbers
  5508. * range from 0 to 65535 but only 0 to 1023 are designated
  5509. * as well-known ports. Refer to [RFC1700] for more details.
  5510. * This field is valid only if
  5511. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  5512. * - SPI (31:0): Security Parameters Index is an
  5513. * identification tag added to the header while using IPsec
  5514. * for tunneling the IP traffici.
  5515. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  5516. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  5517. * Assigned Internet Protocol Numbers.
  5518. * l4_proto numbers for standard protocol like UDP/TCP
  5519. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  5520. * l4_proto = 17 for UDP etc.
  5521. * b'31:8 - reserved: Reserved for future use.
  5522. *
  5523. */
  5524. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  5525. A_UINT32 msg_type:8,
  5526. pdev_id:8,
  5527. reserved0:16;
  5528. A_UINT32 ipsec_valid:1,
  5529. operation:7,
  5530. reserved1:24;
  5531. A_UINT32 ip_src_addr_31_0;
  5532. A_UINT32 ip_src_addr_63_32;
  5533. A_UINT32 ip_src_addr_95_64;
  5534. A_UINT32 ip_src_addr_127_96;
  5535. A_UINT32 ip_dest_addr_31_0;
  5536. A_UINT32 ip_dest_addr_63_32;
  5537. A_UINT32 ip_dest_addr_95_64;
  5538. A_UINT32 ip_dest_addr_127_96;
  5539. union {
  5540. A_UINT32 spi;
  5541. struct {
  5542. A_UINT32 l4_src_port:16,
  5543. l4_dest_port:16;
  5544. } ip;
  5545. } u;
  5546. A_UINT32 l4_proto:8,
  5547. reserved:24;
  5548. } POSTPACK;
  5549. /**
  5550. * Enumeration for IP Protocol or IPSEC Protocol
  5551. * IPsec describes the framework for providing security at IP layer.
  5552. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  5553. */
  5554. enum htt_rx_flow_proto {
  5555. HTT_RX_FLOW_IP_PROTO,
  5556. HTT_RX_FLOW_IPSEC_PROTO,
  5557. };
  5558. /**
  5559. * Enumeration for FSE Cache Invalidation
  5560. * 0 - No Cache Invalidation required
  5561. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  5562. * 2 - Complete FSE Cache Invalidation
  5563. * 3 - FSE Disable
  5564. * 4 - FSE Enable
  5565. */
  5566. enum htt_rx_fse_operation {
  5567. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  5568. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  5569. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  5570. HTT_RX_FSE_DISABLE,
  5571. HTT_RX_FSE_ENABLE,
  5572. };
  5573. /* DWORD 0: Pdev ID */
  5574. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  5575. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  5576. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  5577. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  5578. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  5579. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  5580. do { \
  5581. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  5582. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  5583. } while (0)
  5584. /* DWORD 1:IP PROTO or IPSEC */
  5585. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  5586. #define HTT_RX_FSE_IPSEC_VALID_S 0
  5587. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  5588. do { \
  5589. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  5590. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  5591. } while (0)
  5592. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  5593. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  5594. /* DWORD 1:FSE Operation */
  5595. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  5596. #define HTT_RX_FSE_OPERATION_S 1
  5597. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  5598. do { \
  5599. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  5600. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  5601. } while (0)
  5602. #define HTT_RX_FSE_OPERATION_GET(word) \
  5603. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  5604. /* DWORD 2-9:IP Address */
  5605. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  5606. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  5607. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  5608. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  5609. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  5610. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  5611. do { \
  5612. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  5613. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  5614. } while (0)
  5615. /* DWORD 10:Source Port Number */
  5616. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  5617. #define HTT_RX_FSE_SOURCEPORT_S 0
  5618. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  5619. do { \
  5620. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  5621. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  5622. } while (0)
  5623. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  5624. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  5625. /* DWORD 11:Destination Port Number */
  5626. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  5627. #define HTT_RX_FSE_DESTPORT_S 16
  5628. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  5629. do { \
  5630. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  5631. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  5632. } while (0)
  5633. #define HTT_RX_FSE_DESTPORT_GET(word) \
  5634. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  5635. /* DWORD 10-11:SPI (In case of IPSEC) */
  5636. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  5637. #define HTT_RX_FSE_OPERATION_SPI_S 0
  5638. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  5639. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  5640. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  5641. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  5642. do { \
  5643. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  5644. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  5645. } while (0)
  5646. /* DWORD 12:L4 PROTO */
  5647. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  5648. #define HTT_RX_FSE_L4_PROTO_S 0
  5649. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  5650. do { \
  5651. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  5652. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  5653. } while (0)
  5654. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  5655. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  5656. /*=== target -> host messages ===============================================*/
  5657. enum htt_t2h_msg_type {
  5658. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  5659. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  5660. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  5661. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  5662. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  5663. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  5664. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  5665. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  5666. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  5667. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  5668. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  5669. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  5670. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  5671. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  5672. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  5673. /* only used for HL, add HTT MSG for HTT CREDIT update */
  5674. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  5675. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  5676. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  5677. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  5678. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  5679. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  5680. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  5681. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  5682. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  5683. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  5684. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  5685. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  5686. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  5687. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  5688. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  5689. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  5690. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  5691. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  5692. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  5693. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  5694. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  5695. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  5696. /* TX_OFFLOAD_DELIVER_IND:
  5697. * Forward the target's locally-generated packets to the host,
  5698. * to provide to the monitor mode interface.
  5699. */
  5700. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  5701. HTT_T2H_MSG_TYPE_TEST,
  5702. /* keep this last */
  5703. HTT_T2H_NUM_MSGS
  5704. };
  5705. /*
  5706. * HTT target to host message type -
  5707. * stored in bits 7:0 of the first word of the message
  5708. */
  5709. #define HTT_T2H_MSG_TYPE_M 0xff
  5710. #define HTT_T2H_MSG_TYPE_S 0
  5711. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  5712. do { \
  5713. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  5714. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  5715. } while (0)
  5716. #define HTT_T2H_MSG_TYPE_GET(word) \
  5717. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  5718. /**
  5719. * @brief target -> host version number confirmation message definition
  5720. *
  5721. * |31 24|23 16|15 8|7 0|
  5722. * |----------------+----------------+----------------+----------------|
  5723. * | reserved | major number | minor number | msg type |
  5724. * |-------------------------------------------------------------------|
  5725. * : option request TLV (optional) |
  5726. * :...................................................................:
  5727. *
  5728. * The VER_CONF message may consist of a single 4-byte word, or may be
  5729. * extended with TLVs that specify HTT options selected by the target.
  5730. * The following option TLVs may be appended to the VER_CONF message:
  5731. * - LL_BUS_ADDR_SIZE
  5732. * - HL_SUPPRESS_TX_COMPL_IND
  5733. * - MAX_TX_QUEUE_GROUPS
  5734. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  5735. * may be appended to the VER_CONF message (but only one TLV of each type).
  5736. *
  5737. * Header fields:
  5738. * - MSG_TYPE
  5739. * Bits 7:0
  5740. * Purpose: identifies this as a version number confirmation message
  5741. * Value: 0x0
  5742. * - VER_MINOR
  5743. * Bits 15:8
  5744. * Purpose: Specify the minor number of the HTT message library version
  5745. * in use by the target firmware.
  5746. * The minor number specifies the specific revision within a range
  5747. * of fundamentally compatible HTT message definition revisions.
  5748. * Compatible revisions involve adding new messages or perhaps
  5749. * adding new fields to existing messages, in a backwards-compatible
  5750. * manner.
  5751. * Incompatible revisions involve changing the message type values,
  5752. * or redefining existing messages.
  5753. * Value: minor number
  5754. * - VER_MAJOR
  5755. * Bits 15:8
  5756. * Purpose: Specify the major number of the HTT message library version
  5757. * in use by the target firmware.
  5758. * The major number specifies the family of minor revisions that are
  5759. * fundamentally compatible with each other, but not with prior or
  5760. * later families.
  5761. * Value: major number
  5762. */
  5763. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  5764. #define HTT_VER_CONF_MINOR_S 8
  5765. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  5766. #define HTT_VER_CONF_MAJOR_S 16
  5767. #define HTT_VER_CONF_MINOR_SET(word, value) \
  5768. do { \
  5769. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  5770. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  5771. } while (0)
  5772. #define HTT_VER_CONF_MINOR_GET(word) \
  5773. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  5774. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  5775. do { \
  5776. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  5777. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  5778. } while (0)
  5779. #define HTT_VER_CONF_MAJOR_GET(word) \
  5780. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  5781. #define HTT_VER_CONF_BYTES 4
  5782. /**
  5783. * @brief - target -> host HTT Rx In order indication message
  5784. *
  5785. * @details
  5786. *
  5787. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  5788. * |----------------+-------------------+---------------------+---------------|
  5789. * | peer ID | P| F| O| ext TID | msg type |
  5790. * |--------------------------------------------------------------------------|
  5791. * | MSDU count | Reserved | vdev id |
  5792. * |--------------------------------------------------------------------------|
  5793. * | MSDU 0 bus address (bits 31:0) |
  5794. #if HTT_PADDR64
  5795. * | MSDU 0 bus address (bits 63:32) |
  5796. #endif
  5797. * |--------------------------------------------------------------------------|
  5798. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  5799. * |--------------------------------------------------------------------------|
  5800. * | MSDU 1 bus address (bits 31:0) |
  5801. #if HTT_PADDR64
  5802. * | MSDU 1 bus address (bits 63:32) |
  5803. #endif
  5804. * |--------------------------------------------------------------------------|
  5805. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  5806. * |--------------------------------------------------------------------------|
  5807. */
  5808. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  5809. *
  5810. * @details
  5811. * bits
  5812. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  5813. * |-----+----+-------+--------+--------+---------+---------+-----------|
  5814. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  5815. * | | frag | | | | fail |chksum fail|
  5816. * |-----+----+-------+--------+--------+---------+---------+-----------|
  5817. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  5818. */
  5819. struct htt_rx_in_ord_paddr_ind_hdr_t
  5820. {
  5821. A_UINT32 /* word 0 */
  5822. msg_type: 8,
  5823. ext_tid: 5,
  5824. offload: 1,
  5825. frag: 1,
  5826. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  5827. peer_id: 16;
  5828. A_UINT32 /* word 1 */
  5829. vap_id: 8,
  5830. /* NOTE:
  5831. * This reserved_1 field is not truly reserved - certain targets use
  5832. * this field internally to store debug information, and do not zero
  5833. * out the contents of the field before uploading the message to the
  5834. * host. Thus, any host-target communication supported by this field
  5835. * is limited to using values that are never used by the debug
  5836. * information stored by certain targets in the reserved_1 field.
  5837. * In particular, the targets in question don't use the value 0x3
  5838. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  5839. * so this previously-unused value within these bits is available to
  5840. * use as the host / target PKT_CAPTURE_MODE flag.
  5841. */
  5842. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  5843. /* if pkt_capture_mode == 0x3, host should
  5844. * send rx frames to monitor mode interface
  5845. */
  5846. msdu_cnt: 16;
  5847. };
  5848. struct htt_rx_in_ord_paddr_ind_msdu32_t
  5849. {
  5850. A_UINT32 dma_addr;
  5851. A_UINT32
  5852. length: 16,
  5853. fw_desc: 8,
  5854. msdu_info:8;
  5855. };
  5856. struct htt_rx_in_ord_paddr_ind_msdu64_t
  5857. {
  5858. A_UINT32 dma_addr_lo;
  5859. A_UINT32 dma_addr_hi;
  5860. A_UINT32
  5861. length: 16,
  5862. fw_desc: 8,
  5863. msdu_info:8;
  5864. };
  5865. #if HTT_PADDR64
  5866. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  5867. #else
  5868. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  5869. #endif
  5870. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  5871. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  5872. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  5873. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  5874. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  5875. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  5876. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  5877. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  5878. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  5879. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  5880. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  5881. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  5882. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  5883. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  5884. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  5885. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  5886. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  5887. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  5888. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  5889. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  5890. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  5891. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  5892. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  5893. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  5894. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  5895. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  5896. /* for systems using 64-bit format for bus addresses */
  5897. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  5898. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  5899. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  5900. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  5901. /* for systems using 32-bit format for bus addresses */
  5902. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  5903. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  5904. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  5905. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  5906. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  5907. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  5908. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  5909. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  5910. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  5911. do { \
  5912. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  5913. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  5914. } while (0)
  5915. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  5916. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  5917. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  5918. do { \
  5919. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  5920. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  5921. } while (0)
  5922. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  5923. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  5924. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  5925. do { \
  5926. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  5927. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  5928. } while (0)
  5929. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  5930. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  5931. /*
  5932. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  5933. * deliver the rx frames to the monitor mode interface.
  5934. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  5935. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  5936. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  5937. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  5938. */
  5939. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  5940. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  5941. do { \
  5942. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  5943. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  5944. } while (0)
  5945. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  5946. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  5947. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  5948. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  5949. do { \
  5950. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  5951. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  5952. } while (0)
  5953. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  5954. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  5955. /* for systems using 64-bit format for bus addresses */
  5956. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  5957. do { \
  5958. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  5959. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  5960. } while (0)
  5961. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  5962. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  5963. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  5964. do { \
  5965. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  5966. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  5967. } while (0)
  5968. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  5969. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  5970. /* for systems using 32-bit format for bus addresses */
  5971. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  5972. do { \
  5973. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  5974. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  5975. } while (0)
  5976. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  5977. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  5978. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  5979. do { \
  5980. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  5981. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  5982. } while (0)
  5983. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  5984. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  5985. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  5986. do { \
  5987. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  5988. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  5989. } while (0)
  5990. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  5991. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  5992. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  5993. do { \
  5994. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  5995. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  5996. } while (0)
  5997. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  5998. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  5999. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  6000. do { \
  6001. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  6002. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  6003. } while (0)
  6004. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  6005. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  6006. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  6007. do { \
  6008. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  6009. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  6010. } while (0)
  6011. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  6012. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  6013. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  6014. do { \
  6015. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  6016. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  6017. } while (0)
  6018. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  6019. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  6020. /* definitions used within target -> host rx indication message */
  6021. PREPACK struct htt_rx_ind_hdr_prefix_t
  6022. {
  6023. A_UINT32 /* word 0 */
  6024. msg_type: 8,
  6025. ext_tid: 5,
  6026. release_valid: 1,
  6027. flush_valid: 1,
  6028. reserved0: 1,
  6029. peer_id: 16;
  6030. A_UINT32 /* word 1 */
  6031. flush_start_seq_num: 6,
  6032. flush_end_seq_num: 6,
  6033. release_start_seq_num: 6,
  6034. release_end_seq_num: 6,
  6035. num_mpdu_ranges: 8;
  6036. } POSTPACK;
  6037. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  6038. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  6039. #define HTT_TGT_RSSI_INVALID 0x80
  6040. PREPACK struct htt_rx_ppdu_desc_t
  6041. {
  6042. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  6043. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  6044. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  6045. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  6046. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  6047. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  6048. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  6049. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  6050. A_UINT32 /* word 0 */
  6051. rssi_cmb: 8,
  6052. timestamp_submicrosec: 8,
  6053. phy_err_code: 8,
  6054. phy_err: 1,
  6055. legacy_rate: 4,
  6056. legacy_rate_sel: 1,
  6057. end_valid: 1,
  6058. start_valid: 1;
  6059. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  6060. union {
  6061. A_UINT32 /* word 1 */
  6062. rssi0_pri20: 8,
  6063. rssi0_ext20: 8,
  6064. rssi0_ext40: 8,
  6065. rssi0_ext80: 8;
  6066. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  6067. } u0;
  6068. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  6069. union {
  6070. A_UINT32 /* word 2 */
  6071. rssi1_pri20: 8,
  6072. rssi1_ext20: 8,
  6073. rssi1_ext40: 8,
  6074. rssi1_ext80: 8;
  6075. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  6076. } u1;
  6077. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  6078. union {
  6079. A_UINT32 /* word 3 */
  6080. rssi2_pri20: 8,
  6081. rssi2_ext20: 8,
  6082. rssi2_ext40: 8,
  6083. rssi2_ext80: 8;
  6084. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  6085. } u2;
  6086. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  6087. union {
  6088. A_UINT32 /* word 4 */
  6089. rssi3_pri20: 8,
  6090. rssi3_ext20: 8,
  6091. rssi3_ext40: 8,
  6092. rssi3_ext80: 8;
  6093. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  6094. } u3;
  6095. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  6096. A_UINT32 tsf32; /* word 5 */
  6097. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  6098. A_UINT32 timestamp_microsec; /* word 6 */
  6099. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  6100. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  6101. A_UINT32 /* word 7 */
  6102. vht_sig_a1: 24,
  6103. preamble_type: 8;
  6104. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  6105. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  6106. A_UINT32 /* word 8 */
  6107. vht_sig_a2: 24,
  6108. /* sa_ant_matrix
  6109. * For cases where a single rx chain has options to be connected to
  6110. * different rx antennas, show which rx antennas were in use during
  6111. * receipt of a given PPDU.
  6112. * This sa_ant_matrix provides a bitmask of the antennas used while
  6113. * receiving this frame.
  6114. */
  6115. sa_ant_matrix: 8;
  6116. } POSTPACK;
  6117. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  6118. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  6119. PREPACK struct htt_rx_ind_hdr_suffix_t
  6120. {
  6121. A_UINT32 /* word 0 */
  6122. fw_rx_desc_bytes: 16,
  6123. reserved0: 16;
  6124. } POSTPACK;
  6125. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  6126. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  6127. PREPACK struct htt_rx_ind_hdr_t
  6128. {
  6129. struct htt_rx_ind_hdr_prefix_t prefix;
  6130. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  6131. struct htt_rx_ind_hdr_suffix_t suffix;
  6132. } POSTPACK;
  6133. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  6134. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  6135. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  6136. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  6137. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  6138. /*
  6139. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  6140. * the offset into the HTT rx indication message at which the
  6141. * FW rx PPDU descriptor resides
  6142. */
  6143. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  6144. /*
  6145. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  6146. * the offset into the HTT rx indication message at which the
  6147. * header suffix (FW rx MSDU byte count) resides
  6148. */
  6149. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  6150. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  6151. /*
  6152. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  6153. * the offset into the HTT rx indication message at which the per-MSDU
  6154. * information starts
  6155. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  6156. * per-MSDU information portion of the message. The per-MSDU info itself
  6157. * starts at byte 12.
  6158. */
  6159. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  6160. /**
  6161. * @brief target -> host rx indication message definition
  6162. *
  6163. * @details
  6164. * The following field definitions describe the format of the rx indication
  6165. * message sent from the target to the host.
  6166. * The message consists of three major sections:
  6167. * 1. a fixed-length header
  6168. * 2. a variable-length list of firmware rx MSDU descriptors
  6169. * 3. one or more 4-octet MPDU range information elements
  6170. * The fixed length header itself has two sub-sections
  6171. * 1. the message meta-information, including identification of the
  6172. * sender and type of the received data, and a 4-octet flush/release IE
  6173. * 2. the firmware rx PPDU descriptor
  6174. *
  6175. * The format of the message is depicted below.
  6176. * in this depiction, the following abbreviations are used for information
  6177. * elements within the message:
  6178. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  6179. * elements associated with the PPDU start are valid.
  6180. * Specifically, the following fields are valid only if SV is set:
  6181. * RSSI (all variants), L, legacy rate, preamble type, service,
  6182. * VHT-SIG-A
  6183. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  6184. * elements associated with the PPDU end are valid.
  6185. * Specifically, the following fields are valid only if EV is set:
  6186. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  6187. * - L - Legacy rate selector - if legacy rates are used, this flag
  6188. * indicates whether the rate is from a CCK (L == 1) or OFDM
  6189. * (L == 0) PHY.
  6190. * - P - PHY error flag - boolean indication of whether the rx frame had
  6191. * a PHY error
  6192. *
  6193. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  6194. * |----------------+-------------------+---------------------+---------------|
  6195. * | peer ID | |RV|FV| ext TID | msg type |
  6196. * |--------------------------------------------------------------------------|
  6197. * | num | release | release | flush | flush |
  6198. * | MPDU | end | start | end | start |
  6199. * | ranges | seq num | seq num | seq num | seq num |
  6200. * |==========================================================================|
  6201. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  6202. * |V|V| | rate | | | timestamp | RSSI |
  6203. * |--------------------------------------------------------------------------|
  6204. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  6205. * |--------------------------------------------------------------------------|
  6206. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  6207. * |--------------------------------------------------------------------------|
  6208. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  6209. * |--------------------------------------------------------------------------|
  6210. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  6211. * |--------------------------------------------------------------------------|
  6212. * | TSF LSBs |
  6213. * |--------------------------------------------------------------------------|
  6214. * | microsec timestamp |
  6215. * |--------------------------------------------------------------------------|
  6216. * | preamble type | HT-SIG / VHT-SIG-A1 |
  6217. * |--------------------------------------------------------------------------|
  6218. * | service | HT-SIG / VHT-SIG-A2 |
  6219. * |==========================================================================|
  6220. * | reserved | FW rx desc bytes |
  6221. * |--------------------------------------------------------------------------|
  6222. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  6223. * | desc B3 | desc B2 | desc B1 | desc B0 |
  6224. * |--------------------------------------------------------------------------|
  6225. * : : :
  6226. * |--------------------------------------------------------------------------|
  6227. * | alignment | MSDU Rx |
  6228. * | padding | desc Bn |
  6229. * |--------------------------------------------------------------------------|
  6230. * | reserved | MPDU range status | MPDU count |
  6231. * |--------------------------------------------------------------------------|
  6232. * : reserved : MPDU range status : MPDU count :
  6233. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  6234. *
  6235. * Header fields:
  6236. * - MSG_TYPE
  6237. * Bits 7:0
  6238. * Purpose: identifies this as an rx indication message
  6239. * Value: 0x1
  6240. * - EXT_TID
  6241. * Bits 12:8
  6242. * Purpose: identify the traffic ID of the rx data, including
  6243. * special "extended" TID values for multicast, broadcast, and
  6244. * non-QoS data frames
  6245. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  6246. * - FLUSH_VALID (FV)
  6247. * Bit 13
  6248. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  6249. * is valid
  6250. * Value:
  6251. * 1 -> flush IE is valid and needs to be processed
  6252. * 0 -> flush IE is not valid and should be ignored
  6253. * - REL_VALID (RV)
  6254. * Bit 13
  6255. * Purpose: indicate whether the release IE (start/end sequence numbers)
  6256. * is valid
  6257. * Value:
  6258. * 1 -> release IE is valid and needs to be processed
  6259. * 0 -> release IE is not valid and should be ignored
  6260. * - PEER_ID
  6261. * Bits 31:16
  6262. * Purpose: Identify, by ID, which peer sent the rx data
  6263. * Value: ID of the peer who sent the rx data
  6264. * - FLUSH_SEQ_NUM_START
  6265. * Bits 5:0
  6266. * Purpose: Indicate the start of a series of MPDUs to flush
  6267. * Not all MPDUs within this series are necessarily valid - the host
  6268. * must check each sequence number within this range to see if the
  6269. * corresponding MPDU is actually present.
  6270. * This field is only valid if the FV bit is set.
  6271. * Value:
  6272. * The sequence number for the first MPDUs to check to flush.
  6273. * The sequence number is masked by 0x3f.
  6274. * - FLUSH_SEQ_NUM_END
  6275. * Bits 11:6
  6276. * Purpose: Indicate the end of a series of MPDUs to flush
  6277. * Value:
  6278. * The sequence number one larger than the sequence number of the
  6279. * last MPDU to check to flush.
  6280. * The sequence number is masked by 0x3f.
  6281. * Not all MPDUs within this series are necessarily valid - the host
  6282. * must check each sequence number within this range to see if the
  6283. * corresponding MPDU is actually present.
  6284. * This field is only valid if the FV bit is set.
  6285. * - REL_SEQ_NUM_START
  6286. * Bits 17:12
  6287. * Purpose: Indicate the start of a series of MPDUs to release.
  6288. * All MPDUs within this series are present and valid - the host
  6289. * need not check each sequence number within this range to see if
  6290. * the corresponding MPDU is actually present.
  6291. * This field is only valid if the RV bit is set.
  6292. * Value:
  6293. * The sequence number for the first MPDUs to check to release.
  6294. * The sequence number is masked by 0x3f.
  6295. * - REL_SEQ_NUM_END
  6296. * Bits 23:18
  6297. * Purpose: Indicate the end of a series of MPDUs to release.
  6298. * Value:
  6299. * The sequence number one larger than the sequence number of the
  6300. * last MPDU to check to release.
  6301. * The sequence number is masked by 0x3f.
  6302. * All MPDUs within this series are present and valid - the host
  6303. * need not check each sequence number within this range to see if
  6304. * the corresponding MPDU is actually present.
  6305. * This field is only valid if the RV bit is set.
  6306. * - NUM_MPDU_RANGES
  6307. * Bits 31:24
  6308. * Purpose: Indicate how many ranges of MPDUs are present.
  6309. * Each MPDU range consists of a series of contiguous MPDUs within the
  6310. * rx frame sequence which all have the same MPDU status.
  6311. * Value: 1-63 (typically a small number, like 1-3)
  6312. *
  6313. * Rx PPDU descriptor fields:
  6314. * - RSSI_CMB
  6315. * Bits 7:0
  6316. * Purpose: Combined RSSI from all active rx chains, across the active
  6317. * bandwidth.
  6318. * Value: RSSI dB units w.r.t. noise floor
  6319. * - TIMESTAMP_SUBMICROSEC
  6320. * Bits 15:8
  6321. * Purpose: high-resolution timestamp
  6322. * Value:
  6323. * Sub-microsecond time of PPDU reception.
  6324. * This timestamp ranges from [0,MAC clock MHz).
  6325. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  6326. * to form a high-resolution, large range rx timestamp.
  6327. * - PHY_ERR_CODE
  6328. * Bits 23:16
  6329. * Purpose:
  6330. * If the rx frame processing resulted in a PHY error, indicate what
  6331. * type of rx PHY error occurred.
  6332. * Value:
  6333. * This field is valid if the "P" (PHY_ERR) flag is set.
  6334. * TBD: document/specify the values for this field
  6335. * - PHY_ERR
  6336. * Bit 24
  6337. * Purpose: indicate whether the rx PPDU had a PHY error
  6338. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  6339. * - LEGACY_RATE
  6340. * Bits 28:25
  6341. * Purpose:
  6342. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  6343. * specify which rate was used.
  6344. * Value:
  6345. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  6346. * flag.
  6347. * If LEGACY_RATE_SEL is 0:
  6348. * 0x8: OFDM 48 Mbps
  6349. * 0x9: OFDM 24 Mbps
  6350. * 0xA: OFDM 12 Mbps
  6351. * 0xB: OFDM 6 Mbps
  6352. * 0xC: OFDM 54 Mbps
  6353. * 0xD: OFDM 36 Mbps
  6354. * 0xE: OFDM 18 Mbps
  6355. * 0xF: OFDM 9 Mbps
  6356. * If LEGACY_RATE_SEL is 1:
  6357. * 0x8: CCK 11 Mbps long preamble
  6358. * 0x9: CCK 5.5 Mbps long preamble
  6359. * 0xA: CCK 2 Mbps long preamble
  6360. * 0xB: CCK 1 Mbps long preamble
  6361. * 0xC: CCK 11 Mbps short preamble
  6362. * 0xD: CCK 5.5 Mbps short preamble
  6363. * 0xE: CCK 2 Mbps short preamble
  6364. * - LEGACY_RATE_SEL
  6365. * Bit 29
  6366. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  6367. * Value:
  6368. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  6369. * used a legacy rate.
  6370. * 0 -> OFDM, 1 -> CCK
  6371. * - END_VALID
  6372. * Bit 30
  6373. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  6374. * the start of the PPDU are valid. Specifically, the following
  6375. * fields are only valid if END_VALID is set:
  6376. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  6377. * TIMESTAMP_SUBMICROSEC
  6378. * Value:
  6379. * 0 -> rx PPDU desc end fields are not valid
  6380. * 1 -> rx PPDU desc end fields are valid
  6381. * - START_VALID
  6382. * Bit 31
  6383. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  6384. * the end of the PPDU are valid. Specifically, the following
  6385. * fields are only valid if START_VALID is set:
  6386. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  6387. * VHT-SIG-A
  6388. * Value:
  6389. * 0 -> rx PPDU desc start fields are not valid
  6390. * 1 -> rx PPDU desc start fields are valid
  6391. * - RSSI0_PRI20
  6392. * Bits 7:0
  6393. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  6394. * Value: RSSI dB units w.r.t. noise floor
  6395. *
  6396. * - RSSI0_EXT20
  6397. * Bits 7:0
  6398. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  6399. * (if the rx bandwidth was >= 40 MHz)
  6400. * Value: RSSI dB units w.r.t. noise floor
  6401. * - RSSI0_EXT40
  6402. * Bits 7:0
  6403. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  6404. * (if the rx bandwidth was >= 80 MHz)
  6405. * Value: RSSI dB units w.r.t. noise floor
  6406. * - RSSI0_EXT80
  6407. * Bits 7:0
  6408. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  6409. * (if the rx bandwidth was >= 160 MHz)
  6410. * Value: RSSI dB units w.r.t. noise floor
  6411. *
  6412. * - RSSI1_PRI20
  6413. * Bits 7:0
  6414. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  6415. * Value: RSSI dB units w.r.t. noise floor
  6416. * - RSSI1_EXT20
  6417. * Bits 7:0
  6418. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  6419. * (if the rx bandwidth was >= 40 MHz)
  6420. * Value: RSSI dB units w.r.t. noise floor
  6421. * - RSSI1_EXT40
  6422. * Bits 7:0
  6423. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  6424. * (if the rx bandwidth was >= 80 MHz)
  6425. * Value: RSSI dB units w.r.t. noise floor
  6426. * - RSSI1_EXT80
  6427. * Bits 7:0
  6428. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  6429. * (if the rx bandwidth was >= 160 MHz)
  6430. * Value: RSSI dB units w.r.t. noise floor
  6431. *
  6432. * - RSSI2_PRI20
  6433. * Bits 7:0
  6434. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  6435. * Value: RSSI dB units w.r.t. noise floor
  6436. * - RSSI2_EXT20
  6437. * Bits 7:0
  6438. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  6439. * (if the rx bandwidth was >= 40 MHz)
  6440. * Value: RSSI dB units w.r.t. noise floor
  6441. * - RSSI2_EXT40
  6442. * Bits 7:0
  6443. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  6444. * (if the rx bandwidth was >= 80 MHz)
  6445. * Value: RSSI dB units w.r.t. noise floor
  6446. * - RSSI2_EXT80
  6447. * Bits 7:0
  6448. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  6449. * (if the rx bandwidth was >= 160 MHz)
  6450. * Value: RSSI dB units w.r.t. noise floor
  6451. *
  6452. * - RSSI3_PRI20
  6453. * Bits 7:0
  6454. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  6455. * Value: RSSI dB units w.r.t. noise floor
  6456. * - RSSI3_EXT20
  6457. * Bits 7:0
  6458. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  6459. * (if the rx bandwidth was >= 40 MHz)
  6460. * Value: RSSI dB units w.r.t. noise floor
  6461. * - RSSI3_EXT40
  6462. * Bits 7:0
  6463. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  6464. * (if the rx bandwidth was >= 80 MHz)
  6465. * Value: RSSI dB units w.r.t. noise floor
  6466. * - RSSI3_EXT80
  6467. * Bits 7:0
  6468. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  6469. * (if the rx bandwidth was >= 160 MHz)
  6470. * Value: RSSI dB units w.r.t. noise floor
  6471. *
  6472. * - TSF32
  6473. * Bits 31:0
  6474. * Purpose: specify the time the rx PPDU was received, in TSF units
  6475. * Value: 32 LSBs of the TSF
  6476. * - TIMESTAMP_MICROSEC
  6477. * Bits 31:0
  6478. * Purpose: specify the time the rx PPDU was received, in microsecond units
  6479. * Value: PPDU rx time, in microseconds
  6480. * - VHT_SIG_A1
  6481. * Bits 23:0
  6482. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  6483. * from the rx PPDU
  6484. * Value:
  6485. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  6486. * VHT-SIG-A1 data.
  6487. * If PREAMBLE_TYPE specifies HT, then this field contains the
  6488. * first 24 bits of the HT-SIG data.
  6489. * Otherwise, this field is invalid.
  6490. * Refer to the the 802.11 protocol for the definition of the
  6491. * HT-SIG and VHT-SIG-A1 fields
  6492. * - VHT_SIG_A2
  6493. * Bits 23:0
  6494. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  6495. * from the rx PPDU
  6496. * Value:
  6497. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  6498. * VHT-SIG-A2 data.
  6499. * If PREAMBLE_TYPE specifies HT, then this field contains the
  6500. * last 24 bits of the HT-SIG data.
  6501. * Otherwise, this field is invalid.
  6502. * Refer to the the 802.11 protocol for the definition of the
  6503. * HT-SIG and VHT-SIG-A2 fields
  6504. * - PREAMBLE_TYPE
  6505. * Bits 31:24
  6506. * Purpose: indicate the PHY format of the received burst
  6507. * Value:
  6508. * 0x4: Legacy (OFDM/CCK)
  6509. * 0x8: HT
  6510. * 0x9: HT with TxBF
  6511. * 0xC: VHT
  6512. * 0xD: VHT with TxBF
  6513. * - SERVICE
  6514. * Bits 31:24
  6515. * Purpose: TBD
  6516. * Value: TBD
  6517. *
  6518. * Rx MSDU descriptor fields:
  6519. * - FW_RX_DESC_BYTES
  6520. * Bits 15:0
  6521. * Purpose: Indicate how many bytes in the Rx indication are used for
  6522. * FW Rx descriptors
  6523. *
  6524. * Payload fields:
  6525. * - MPDU_COUNT
  6526. * Bits 7:0
  6527. * Purpose: Indicate how many sequential MPDUs share the same status.
  6528. * All MPDUs within the indicated list are from the same RA-TA-TID.
  6529. * - MPDU_STATUS
  6530. * Bits 15:8
  6531. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  6532. * received successfully.
  6533. * Value:
  6534. * 0x1: success
  6535. * 0x2: FCS error
  6536. * 0x3: duplicate error
  6537. * 0x4: replay error
  6538. * 0x5: invalid peer
  6539. */
  6540. /* header fields */
  6541. #define HTT_RX_IND_EXT_TID_M 0x1f00
  6542. #define HTT_RX_IND_EXT_TID_S 8
  6543. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  6544. #define HTT_RX_IND_FLUSH_VALID_S 13
  6545. #define HTT_RX_IND_REL_VALID_M 0x4000
  6546. #define HTT_RX_IND_REL_VALID_S 14
  6547. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  6548. #define HTT_RX_IND_PEER_ID_S 16
  6549. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  6550. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  6551. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  6552. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  6553. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  6554. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  6555. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  6556. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  6557. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  6558. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  6559. /* rx PPDU descriptor fields */
  6560. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  6561. #define HTT_RX_IND_RSSI_CMB_S 0
  6562. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  6563. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  6564. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  6565. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  6566. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  6567. #define HTT_RX_IND_PHY_ERR_S 24
  6568. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  6569. #define HTT_RX_IND_LEGACY_RATE_S 25
  6570. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  6571. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  6572. #define HTT_RX_IND_END_VALID_M 0x40000000
  6573. #define HTT_RX_IND_END_VALID_S 30
  6574. #define HTT_RX_IND_START_VALID_M 0x80000000
  6575. #define HTT_RX_IND_START_VALID_S 31
  6576. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  6577. #define HTT_RX_IND_RSSI_PRI20_S 0
  6578. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  6579. #define HTT_RX_IND_RSSI_EXT20_S 8
  6580. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  6581. #define HTT_RX_IND_RSSI_EXT40_S 16
  6582. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  6583. #define HTT_RX_IND_RSSI_EXT80_S 24
  6584. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  6585. #define HTT_RX_IND_VHT_SIG_A1_S 0
  6586. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  6587. #define HTT_RX_IND_VHT_SIG_A2_S 0
  6588. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  6589. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  6590. #define HTT_RX_IND_SERVICE_M 0xff000000
  6591. #define HTT_RX_IND_SERVICE_S 24
  6592. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  6593. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  6594. /* rx MSDU descriptor fields */
  6595. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  6596. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  6597. /* payload fields */
  6598. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  6599. #define HTT_RX_IND_MPDU_COUNT_S 0
  6600. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  6601. #define HTT_RX_IND_MPDU_STATUS_S 8
  6602. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  6603. do { \
  6604. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  6605. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  6606. } while (0)
  6607. #define HTT_RX_IND_EXT_TID_GET(word) \
  6608. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  6609. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  6610. do { \
  6611. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  6612. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  6613. } while (0)
  6614. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  6615. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  6616. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  6617. do { \
  6618. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  6619. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  6620. } while (0)
  6621. #define HTT_RX_IND_REL_VALID_GET(word) \
  6622. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  6623. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  6624. do { \
  6625. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  6626. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  6627. } while (0)
  6628. #define HTT_RX_IND_PEER_ID_GET(word) \
  6629. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  6630. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  6631. do { \
  6632. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  6633. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  6634. } while (0)
  6635. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  6636. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  6637. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  6638. do { \
  6639. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  6640. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  6641. } while (0)
  6642. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  6643. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  6644. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  6645. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  6646. do { \
  6647. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  6648. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  6649. } while (0)
  6650. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  6651. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  6652. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  6653. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  6654. do { \
  6655. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  6656. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  6657. } while (0)
  6658. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  6659. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  6660. HTT_RX_IND_REL_SEQ_NUM_START_S)
  6661. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  6662. do { \
  6663. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  6664. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  6665. } while (0)
  6666. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  6667. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  6668. HTT_RX_IND_REL_SEQ_NUM_END_S)
  6669. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  6670. do { \
  6671. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  6672. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  6673. } while (0)
  6674. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  6675. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  6676. HTT_RX_IND_NUM_MPDU_RANGES_S)
  6677. /* FW rx PPDU descriptor fields */
  6678. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  6679. do { \
  6680. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  6681. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  6682. } while (0)
  6683. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  6684. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  6685. HTT_RX_IND_RSSI_CMB_S)
  6686. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  6687. do { \
  6688. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  6689. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  6690. } while (0)
  6691. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  6692. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  6693. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  6694. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  6695. do { \
  6696. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  6697. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  6698. } while (0)
  6699. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  6700. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  6701. HTT_RX_IND_PHY_ERR_CODE_S)
  6702. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  6703. do { \
  6704. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  6705. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  6706. } while (0)
  6707. #define HTT_RX_IND_PHY_ERR_GET(word) \
  6708. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  6709. HTT_RX_IND_PHY_ERR_S)
  6710. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  6711. do { \
  6712. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  6713. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  6714. } while (0)
  6715. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  6716. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  6717. HTT_RX_IND_LEGACY_RATE_S)
  6718. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  6719. do { \
  6720. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  6721. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  6722. } while (0)
  6723. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  6724. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  6725. HTT_RX_IND_LEGACY_RATE_SEL_S)
  6726. #define HTT_RX_IND_END_VALID_SET(word, value) \
  6727. do { \
  6728. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  6729. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  6730. } while (0)
  6731. #define HTT_RX_IND_END_VALID_GET(word) \
  6732. (((word) & HTT_RX_IND_END_VALID_M) >> \
  6733. HTT_RX_IND_END_VALID_S)
  6734. #define HTT_RX_IND_START_VALID_SET(word, value) \
  6735. do { \
  6736. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  6737. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  6738. } while (0)
  6739. #define HTT_RX_IND_START_VALID_GET(word) \
  6740. (((word) & HTT_RX_IND_START_VALID_M) >> \
  6741. HTT_RX_IND_START_VALID_S)
  6742. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  6743. do { \
  6744. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  6745. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  6746. } while (0)
  6747. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  6748. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  6749. HTT_RX_IND_RSSI_PRI20_S)
  6750. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  6751. do { \
  6752. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  6753. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  6754. } while (0)
  6755. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  6756. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  6757. HTT_RX_IND_RSSI_EXT20_S)
  6758. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  6759. do { \
  6760. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  6761. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  6762. } while (0)
  6763. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  6764. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  6765. HTT_RX_IND_RSSI_EXT40_S)
  6766. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  6767. do { \
  6768. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  6769. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  6770. } while (0)
  6771. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  6772. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  6773. HTT_RX_IND_RSSI_EXT80_S)
  6774. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  6775. do { \
  6776. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  6777. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  6778. } while (0)
  6779. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  6780. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  6781. HTT_RX_IND_VHT_SIG_A1_S)
  6782. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  6783. do { \
  6784. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  6785. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  6786. } while (0)
  6787. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  6788. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  6789. HTT_RX_IND_VHT_SIG_A2_S)
  6790. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  6791. do { \
  6792. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  6793. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  6794. } while (0)
  6795. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  6796. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  6797. HTT_RX_IND_PREAMBLE_TYPE_S)
  6798. #define HTT_RX_IND_SERVICE_SET(word, value) \
  6799. do { \
  6800. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  6801. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  6802. } while (0)
  6803. #define HTT_RX_IND_SERVICE_GET(word) \
  6804. (((word) & HTT_RX_IND_SERVICE_M) >> \
  6805. HTT_RX_IND_SERVICE_S)
  6806. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  6807. do { \
  6808. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  6809. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  6810. } while (0)
  6811. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  6812. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  6813. HTT_RX_IND_SA_ANT_MATRIX_S)
  6814. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  6815. do { \
  6816. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  6817. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  6818. } while (0)
  6819. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  6820. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  6821. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  6822. do { \
  6823. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  6824. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  6825. } while (0)
  6826. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  6827. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  6828. #define HTT_RX_IND_HL_BYTES \
  6829. (HTT_RX_IND_HDR_BYTES + \
  6830. 4 /* single FW rx MSDU descriptor */ + \
  6831. 4 /* single MPDU range information element */)
  6832. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  6833. /* Could we use one macro entry? */
  6834. #define HTT_WORD_SET(word, field, value) \
  6835. do { \
  6836. HTT_CHECK_SET_VAL(field, value); \
  6837. (word) |= ((value) << field ## _S); \
  6838. } while (0)
  6839. #define HTT_WORD_GET(word, field) \
  6840. (((word) & field ## _M) >> field ## _S)
  6841. PREPACK struct hl_htt_rx_ind_base {
  6842. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  6843. } POSTPACK;
  6844. /*
  6845. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  6846. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  6847. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  6848. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  6849. * htt_rx_ind_hl_rx_desc_t.
  6850. */
  6851. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  6852. struct htt_rx_ind_hl_rx_desc_t {
  6853. A_UINT8 ver;
  6854. A_UINT8 len;
  6855. struct {
  6856. A_UINT8
  6857. first_msdu: 1,
  6858. last_msdu: 1,
  6859. c3_failed: 1,
  6860. c4_failed: 1,
  6861. ipv6: 1,
  6862. tcp: 1,
  6863. udp: 1,
  6864. reserved: 1;
  6865. } flags;
  6866. /* NOTE: no reserved space - don't append any new fields here */
  6867. };
  6868. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  6869. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6870. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  6871. #define HTT_RX_IND_HL_RX_DESC_VER 0
  6872. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  6873. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6874. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  6875. #define HTT_RX_IND_HL_FLAG_OFFSET \
  6876. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6877. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  6878. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  6879. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  6880. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  6881. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  6882. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  6883. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  6884. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  6885. /* This structure is used in HL, the basic descriptor information
  6886. * used by host. the structure is translated by FW from HW desc
  6887. * or generated by FW. But in HL monitor mode, the host would use
  6888. * the same structure with LL.
  6889. */
  6890. PREPACK struct hl_htt_rx_desc_base {
  6891. A_UINT32
  6892. seq_num:12,
  6893. encrypted:1,
  6894. chan_info_present:1,
  6895. resv0:2,
  6896. mcast_bcast:1,
  6897. fragment:1,
  6898. key_id_oct:8,
  6899. resv1:6;
  6900. A_UINT32
  6901. pn_31_0;
  6902. union {
  6903. struct {
  6904. A_UINT16 pn_47_32;
  6905. A_UINT16 pn_63_48;
  6906. } pn16;
  6907. A_UINT32 pn_63_32;
  6908. } u0;
  6909. A_UINT32
  6910. pn_95_64;
  6911. A_UINT32
  6912. pn_127_96;
  6913. } POSTPACK;
  6914. /*
  6915. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  6916. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  6917. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  6918. * Please see htt_chan_change_t for description of the fields.
  6919. */
  6920. PREPACK struct htt_chan_info_t
  6921. {
  6922. A_UINT32 primary_chan_center_freq_mhz: 16,
  6923. contig_chan1_center_freq_mhz: 16;
  6924. A_UINT32 contig_chan2_center_freq_mhz: 16,
  6925. phy_mode: 8,
  6926. reserved: 8;
  6927. } POSTPACK;
  6928. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  6929. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  6930. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  6931. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  6932. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  6933. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  6934. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  6935. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  6936. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  6937. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  6938. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  6939. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  6940. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  6941. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  6942. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  6943. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  6944. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  6945. /* Channel information */
  6946. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  6947. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  6948. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  6949. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  6950. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  6951. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  6952. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  6953. #define HTT_CHAN_INFO_PHY_MODE_S 16
  6954. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  6955. do { \
  6956. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  6957. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  6958. } while (0)
  6959. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  6960. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  6961. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  6962. do { \
  6963. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  6964. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  6965. } while (0)
  6966. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  6967. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  6968. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  6969. do { \
  6970. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  6971. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  6972. } while (0)
  6973. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  6974. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  6975. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  6976. do { \
  6977. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  6978. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  6979. } while (0)
  6980. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  6981. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  6982. /*
  6983. * HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  6984. * @brief target -> host message definition for FW offloaded pkts
  6985. *
  6986. * @details
  6987. * The following field definitions describe the format of the firmware
  6988. * offload deliver message sent from the target to the host.
  6989. *
  6990. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  6991. *
  6992. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  6993. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  6994. * | reserved_1 | msg type |
  6995. * |--------------------------------------------------------------------------|
  6996. * | phy_timestamp_l32 |
  6997. * |--------------------------------------------------------------------------|
  6998. * | WORD2 (see below) |
  6999. * |--------------------------------------------------------------------------|
  7000. * | seqno | framectrl |
  7001. * |--------------------------------------------------------------------------|
  7002. * | reserved_3 | vdev_id | tid_num|
  7003. * |--------------------------------------------------------------------------|
  7004. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  7005. * |--------------------------------------------------------------------------|
  7006. *
  7007. * where:
  7008. * STAT = status
  7009. * F = format (802.3 vs. 802.11)
  7010. *
  7011. * definition for word 2
  7012. *
  7013. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  7014. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  7015. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  7016. * |--------------------------------------------------------------------------|
  7017. *
  7018. * where:
  7019. * PR = preamble
  7020. * BF = beamformed
  7021. */
  7022. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  7023. {
  7024. A_UINT32 /* word 0 */
  7025. msg_type:8, /* [ 7: 0] */
  7026. reserved_1:24; /* [31: 8] */
  7027. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  7028. A_UINT32 /* word 2 */
  7029. /* preamble:
  7030. * 0-OFDM,
  7031. * 1-CCk,
  7032. * 2-HT,
  7033. * 3-VHT
  7034. */
  7035. preamble: 2, /* [1:0] */
  7036. /* mcs:
  7037. * In case of HT preamble interpret
  7038. * MCS along with NSS.
  7039. * Valid values for HT are 0 to 7.
  7040. * HT mcs 0 with NSS 2 is mcs 8.
  7041. * Valid values for VHT are 0 to 9.
  7042. */
  7043. mcs: 4, /* [5:2] */
  7044. /* rate:
  7045. * This is applicable only for
  7046. * CCK and OFDM preamble type
  7047. * rate 0: OFDM 48 Mbps,
  7048. * 1: OFDM 24 Mbps,
  7049. * 2: OFDM 12 Mbps
  7050. * 3: OFDM 6 Mbps
  7051. * 4: OFDM 54 Mbps
  7052. * 5: OFDM 36 Mbps
  7053. * 6: OFDM 18 Mbps
  7054. * 7: OFDM 9 Mbps
  7055. * rate 0: CCK 11 Mbps Long
  7056. * 1: CCK 5.5 Mbps Long
  7057. * 2: CCK 2 Mbps Long
  7058. * 3: CCK 1 Mbps Long
  7059. * 4: CCK 11 Mbps Short
  7060. * 5: CCK 5.5 Mbps Short
  7061. * 6: CCK 2 Mbps Short
  7062. */
  7063. rate : 3, /* [ 8: 6] */
  7064. rssi : 8, /* [16: 9] units=dBm */
  7065. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  7066. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  7067. stbc : 1, /* [22] */
  7068. sgi : 1, /* [23] */
  7069. ldpc : 1, /* [24] */
  7070. beamformed: 1, /* [25] */
  7071. reserved_2: 6; /* [31:26] */
  7072. A_UINT32 /* word 3 */
  7073. framectrl:16, /* [15: 0] */
  7074. seqno:16; /* [31:16] */
  7075. A_UINT32 /* word 4 */
  7076. tid_num:5, /* [ 4: 0] actual TID number */
  7077. vdev_id:8, /* [12: 5] */
  7078. reserved_3:19; /* [31:13] */
  7079. A_UINT32 /* word 5 */
  7080. /* status:
  7081. * 0: tx_ok
  7082. * 1: retry
  7083. * 2: drop
  7084. * 3: filtered
  7085. * 4: abort
  7086. * 5: tid delete
  7087. * 6: sw abort
  7088. * 7: dropped by peer migration
  7089. */
  7090. status:3, /* [2:0] */
  7091. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  7092. tx_mpdu_bytes:16, /* [19:4] */
  7093. reserved_4:12; /* [31:20] */
  7094. } POSTPACK;
  7095. /* FW offload deliver ind message header fields */
  7096. /* DWORD one */
  7097. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  7098. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  7099. /* DWORD two */
  7100. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  7101. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  7102. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  7103. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  7104. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  7105. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  7106. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  7107. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  7108. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  7109. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  7110. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  7111. #define HTT_FW_OFFLOAD_IND_BW_S 19
  7112. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  7113. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  7114. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  7115. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  7116. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  7117. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  7118. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  7119. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  7120. /* DWORD three*/
  7121. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  7122. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  7123. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  7124. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  7125. /* DWORD four */
  7126. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  7127. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  7128. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  7129. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  7130. /* DWORD five */
  7131. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  7132. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  7133. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  7134. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  7135. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  7136. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  7137. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  7138. do { \
  7139. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  7140. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  7141. } while (0)
  7142. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  7143. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  7144. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  7145. do { \
  7146. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  7147. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  7148. } while (0)
  7149. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  7150. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  7151. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  7152. do { \
  7153. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  7154. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  7155. } while (0)
  7156. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  7157. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  7158. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  7159. do { \
  7160. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  7161. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  7162. } while (0)
  7163. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  7164. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  7165. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  7166. do { \
  7167. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  7168. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  7169. } while (0)
  7170. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  7171. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  7172. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  7173. do { \
  7174. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  7175. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  7176. } while (0)
  7177. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  7178. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  7179. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  7180. do { \
  7181. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  7182. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  7183. } while (0)
  7184. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  7185. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  7186. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  7187. do { \
  7188. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  7189. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  7190. } while (0)
  7191. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  7192. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  7193. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  7194. do { \
  7195. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  7196. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  7197. } while (0)
  7198. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  7199. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  7200. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  7201. do { \
  7202. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  7203. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  7204. } while (0)
  7205. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  7206. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  7207. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  7208. do { \
  7209. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  7210. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  7211. } while (0)
  7212. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  7213. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  7214. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  7215. do { \
  7216. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  7217. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  7218. } while (0)
  7219. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  7220. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  7221. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  7222. do { \
  7223. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  7224. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  7225. } while (0)
  7226. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  7227. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  7228. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  7229. do { \
  7230. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  7231. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  7232. } while (0)
  7233. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  7234. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  7235. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  7236. do { \
  7237. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  7238. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  7239. } while (0)
  7240. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  7241. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  7242. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  7243. do { \
  7244. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  7245. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  7246. } while (0)
  7247. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  7248. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  7249. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  7250. do { \
  7251. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  7252. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  7253. } while (0)
  7254. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  7255. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  7256. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  7257. do { \
  7258. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  7259. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  7260. } while (0)
  7261. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  7262. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  7263. /*
  7264. * @brief target -> host rx reorder flush message definition
  7265. *
  7266. * @details
  7267. * The following field definitions describe the format of the rx flush
  7268. * message sent from the target to the host.
  7269. * The message consists of a 4-octet header, followed by one or more
  7270. * 4-octet payload information elements.
  7271. *
  7272. * |31 24|23 8|7 0|
  7273. * |--------------------------------------------------------------|
  7274. * | TID | peer ID | msg type |
  7275. * |--------------------------------------------------------------|
  7276. * | seq num end | seq num start | MPDU status | reserved |
  7277. * |--------------------------------------------------------------|
  7278. * First DWORD:
  7279. * - MSG_TYPE
  7280. * Bits 7:0
  7281. * Purpose: identifies this as an rx flush message
  7282. * Value: 0x2
  7283. * - PEER_ID
  7284. * Bits 23:8 (only bits 18:8 actually used)
  7285. * Purpose: identify which peer's rx data is being flushed
  7286. * Value: (rx) peer ID
  7287. * - TID
  7288. * Bits 31:24 (only bits 27:24 actually used)
  7289. * Purpose: Specifies which traffic identifier's rx data is being flushed
  7290. * Value: traffic identifier
  7291. * Second DWORD:
  7292. * - MPDU_STATUS
  7293. * Bits 15:8
  7294. * Purpose:
  7295. * Indicate whether the flushed MPDUs should be discarded or processed.
  7296. * Value:
  7297. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  7298. * stages of rx processing
  7299. * other: discard the MPDUs
  7300. * It is anticipated that flush messages will always have
  7301. * MPDU status == 1, but the status flag is included for
  7302. * flexibility.
  7303. * - SEQ_NUM_START
  7304. * Bits 23:16
  7305. * Purpose:
  7306. * Indicate the start of a series of consecutive MPDUs being flushed.
  7307. * Not all MPDUs within this range are necessarily valid - the host
  7308. * must check each sequence number within this range to see if the
  7309. * corresponding MPDU is actually present.
  7310. * Value:
  7311. * The sequence number for the first MPDU in the sequence.
  7312. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  7313. * - SEQ_NUM_END
  7314. * Bits 30:24
  7315. * Purpose:
  7316. * Indicate the end of a series of consecutive MPDUs being flushed.
  7317. * Value:
  7318. * The sequence number one larger than the sequence number of the
  7319. * last MPDU being flushed.
  7320. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  7321. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  7322. * are to be released for further rx processing.
  7323. * Not all MPDUs within this range are necessarily valid - the host
  7324. * must check each sequence number within this range to see if the
  7325. * corresponding MPDU is actually present.
  7326. */
  7327. /* first DWORD */
  7328. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  7329. #define HTT_RX_FLUSH_PEER_ID_S 8
  7330. #define HTT_RX_FLUSH_TID_M 0xff000000
  7331. #define HTT_RX_FLUSH_TID_S 24
  7332. /* second DWORD */
  7333. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  7334. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  7335. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  7336. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  7337. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  7338. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  7339. #define HTT_RX_FLUSH_BYTES 8
  7340. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  7341. do { \
  7342. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  7343. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  7344. } while (0)
  7345. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  7346. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  7347. #define HTT_RX_FLUSH_TID_SET(word, value) \
  7348. do { \
  7349. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  7350. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  7351. } while (0)
  7352. #define HTT_RX_FLUSH_TID_GET(word) \
  7353. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  7354. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  7355. do { \
  7356. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  7357. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  7358. } while (0)
  7359. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  7360. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  7361. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  7362. do { \
  7363. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  7364. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  7365. } while (0)
  7366. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  7367. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  7368. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  7369. do { \
  7370. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  7371. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  7372. } while (0)
  7373. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  7374. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  7375. /*
  7376. * @brief target -> host rx pn check indication message
  7377. *
  7378. * @details
  7379. * The following field definitions describe the format of the Rx PN check
  7380. * indication message sent from the target to the host.
  7381. * The message consists of a 4-octet header, followed by the start and
  7382. * end sequence numbers to be released, followed by the PN IEs. Each PN
  7383. * IE is one octet containing the sequence number that failed the PN
  7384. * check.
  7385. *
  7386. * |31 24|23 8|7 0|
  7387. * |--------------------------------------------------------------|
  7388. * | TID | peer ID | msg type |
  7389. * |--------------------------------------------------------------|
  7390. * | Reserved | PN IE count | seq num end | seq num start|
  7391. * |--------------------------------------------------------------|
  7392. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  7393. * |--------------------------------------------------------------|
  7394. * First DWORD:
  7395. * - MSG_TYPE
  7396. * Bits 7:0
  7397. * Purpose: Identifies this as an rx pn check indication message
  7398. * Value: 0x2
  7399. * - PEER_ID
  7400. * Bits 23:8 (only bits 18:8 actually used)
  7401. * Purpose: identify which peer
  7402. * Value: (rx) peer ID
  7403. * - TID
  7404. * Bits 31:24 (only bits 27:24 actually used)
  7405. * Purpose: identify traffic identifier
  7406. * Value: traffic identifier
  7407. * Second DWORD:
  7408. * - SEQ_NUM_START
  7409. * Bits 7:0
  7410. * Purpose:
  7411. * Indicates the starting sequence number of the MPDU in this
  7412. * series of MPDUs that went though PN check.
  7413. * Value:
  7414. * The sequence number for the first MPDU in the sequence.
  7415. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  7416. * - SEQ_NUM_END
  7417. * Bits 15:8
  7418. * Purpose:
  7419. * Indicates the ending sequence number of the MPDU in this
  7420. * series of MPDUs that went though PN check.
  7421. * Value:
  7422. * The sequence number one larger then the sequence number of the last
  7423. * MPDU being flushed.
  7424. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  7425. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  7426. * for invalid PN numbers and are ready to be released for further processing.
  7427. * Not all MPDUs within this range are necessarily valid - the host
  7428. * must check each sequence number within this range to see if the
  7429. * corresponding MPDU is actually present.
  7430. * - PN_IE_COUNT
  7431. * Bits 23:16
  7432. * Purpose:
  7433. * Used to determine the variable number of PN information elements in this
  7434. * message
  7435. *
  7436. * PN information elements:
  7437. * - PN_IE_x-
  7438. * Purpose:
  7439. * Each PN information element contains the sequence number of the MPDU that
  7440. * has failed the target PN check.
  7441. * Value:
  7442. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  7443. * that failed the PN check.
  7444. */
  7445. /* first DWORD */
  7446. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  7447. #define HTT_RX_PN_IND_PEER_ID_S 8
  7448. #define HTT_RX_PN_IND_TID_M 0xff000000
  7449. #define HTT_RX_PN_IND_TID_S 24
  7450. /* second DWORD */
  7451. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  7452. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  7453. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  7454. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  7455. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  7456. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  7457. #define HTT_RX_PN_IND_BYTES 8
  7458. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  7459. do { \
  7460. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  7461. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  7462. } while (0)
  7463. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  7464. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  7465. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  7466. do { \
  7467. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  7468. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  7469. } while (0)
  7470. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  7471. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  7472. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  7473. do { \
  7474. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  7475. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  7476. } while (0)
  7477. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  7478. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  7479. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  7480. do { \
  7481. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  7482. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  7483. } while (0)
  7484. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  7485. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  7486. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  7487. do { \
  7488. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  7489. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  7490. } while (0)
  7491. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  7492. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  7493. /*
  7494. * @brief target -> host rx offload deliver message for LL system
  7495. *
  7496. * @details
  7497. * In a low latency system this message is sent whenever the offload
  7498. * manager flushes out the packets it has coalesced in its coalescing buffer.
  7499. * The DMA of the actual packets into host memory is done before sending out
  7500. * this message. This message indicates only how many MSDUs to reap. The
  7501. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  7502. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  7503. * DMA'd by the MAC directly into host memory these packets do not contain
  7504. * the MAC descriptors in the header portion of the packet. Instead they contain
  7505. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  7506. * message, the packets are delivered directly to the NW stack without going
  7507. * through the regular reorder buffering and PN checking path since it has
  7508. * already been done in target.
  7509. *
  7510. * |31 24|23 16|15 8|7 0|
  7511. * |-----------------------------------------------------------------------|
  7512. * | Total MSDU count | reserved | msg type |
  7513. * |-----------------------------------------------------------------------|
  7514. *
  7515. * @brief target -> host rx offload deliver message for HL system
  7516. *
  7517. * @details
  7518. * In a high latency system this message is sent whenever the offload manager
  7519. * flushes out the packets it has coalesced in its coalescing buffer. The
  7520. * actual packets are also carried along with this message. When the host
  7521. * receives this message, it is expected to deliver these packets to the NW
  7522. * stack directly instead of routing them through the reorder buffering and
  7523. * PN checking path since it has already been done in target.
  7524. *
  7525. * |31 24|23 16|15 8|7 0|
  7526. * |-----------------------------------------------------------------------|
  7527. * | Total MSDU count | reserved | msg type |
  7528. * |-----------------------------------------------------------------------|
  7529. * | peer ID | MSDU length |
  7530. * |-----------------------------------------------------------------------|
  7531. * | MSDU payload | FW Desc | tid | vdev ID |
  7532. * |-----------------------------------------------------------------------|
  7533. * | MSDU payload contd. |
  7534. * |-----------------------------------------------------------------------|
  7535. * | peer ID | MSDU length |
  7536. * |-----------------------------------------------------------------------|
  7537. * | MSDU payload | FW Desc | tid | vdev ID |
  7538. * |-----------------------------------------------------------------------|
  7539. * | MSDU payload contd. |
  7540. * |-----------------------------------------------------------------------|
  7541. *
  7542. */
  7543. /* first DWORD */
  7544. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  7545. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  7546. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  7547. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  7548. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  7549. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  7550. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  7551. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  7552. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  7553. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  7554. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  7555. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  7556. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  7557. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  7558. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  7559. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  7560. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  7561. do { \
  7562. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  7563. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  7564. } while (0)
  7565. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  7566. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  7567. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  7568. do { \
  7569. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  7570. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  7571. } while (0)
  7572. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  7573. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  7574. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  7575. do { \
  7576. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  7577. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  7578. } while (0)
  7579. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  7580. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  7581. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  7582. do { \
  7583. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  7584. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  7585. } while (0)
  7586. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  7587. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  7588. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  7589. do { \
  7590. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  7591. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  7592. } while (0)
  7593. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  7594. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  7595. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  7596. do { \
  7597. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  7598. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  7599. } while (0)
  7600. /**
  7601. * @brief target -> host rx peer map/unmap message definition
  7602. *
  7603. * @details
  7604. * The following diagram shows the format of the rx peer map message sent
  7605. * from the target to the host. This layout assumes the target operates
  7606. * as little-endian.
  7607. *
  7608. * This message always contains a SW peer ID. The main purpose of the
  7609. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  7610. * with, so that the host can use that peer ID to determine which peer
  7611. * transmitted the rx frame. This SW peer ID is sometimes also used for
  7612. * other purposes, such as identifying during tx completions which peer
  7613. * the tx frames in question were transmitted to.
  7614. *
  7615. * In certain generations of chips, the peer map message also contains
  7616. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  7617. * to identify which peer the frame needs to be forwarded to (i.e. the
  7618. * peer assocated with the Destination MAC Address within the packet),
  7619. * and particularly which vdev needs to transmit the frame (for cases
  7620. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  7621. * meaning as AST_INDEX_0.
  7622. * This DA-based peer ID that is provided for certain rx frames
  7623. * (the rx frames that need to be re-transmitted as tx frames)
  7624. * is the ID that the HW uses for referring to the peer in question,
  7625. * rather than the peer ID that the SW+FW use to refer to the peer.
  7626. *
  7627. *
  7628. * |31 24|23 16|15 8|7 0|
  7629. * |-----------------------------------------------------------------------|
  7630. * | SW peer ID | VDEV ID | msg type |
  7631. * |-----------------------------------------------------------------------|
  7632. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  7633. * |-----------------------------------------------------------------------|
  7634. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  7635. * |-----------------------------------------------------------------------|
  7636. *
  7637. *
  7638. * The following diagram shows the format of the rx peer unmap message sent
  7639. * from the target to the host.
  7640. *
  7641. * |31 24|23 16|15 8|7 0|
  7642. * |-----------------------------------------------------------------------|
  7643. * | SW peer ID | VDEV ID | msg type |
  7644. * |-----------------------------------------------------------------------|
  7645. *
  7646. * The following field definitions describe the format of the rx peer map
  7647. * and peer unmap messages sent from the target to the host.
  7648. * - MSG_TYPE
  7649. * Bits 7:0
  7650. * Purpose: identifies this as an rx peer map or peer unmap message
  7651. * Value: peer map -> 0x3, peer unmap -> 0x4
  7652. * - VDEV_ID
  7653. * Bits 15:8
  7654. * Purpose: Indicates which virtual device the peer is associated
  7655. * with.
  7656. * Value: vdev ID (used in the host to look up the vdev object)
  7657. * - PEER_ID (a.k.a. SW_PEER_ID)
  7658. * Bits 31:16
  7659. * Purpose: The peer ID (index) that WAL is allocating (map) or
  7660. * freeing (unmap)
  7661. * Value: (rx) peer ID
  7662. * - MAC_ADDR_L32 (peer map only)
  7663. * Bits 31:0
  7664. * Purpose: Identifies which peer node the peer ID is for.
  7665. * Value: lower 4 bytes of peer node's MAC address
  7666. * - MAC_ADDR_U16 (peer map only)
  7667. * Bits 15:0
  7668. * Purpose: Identifies which peer node the peer ID is for.
  7669. * Value: upper 2 bytes of peer node's MAC address
  7670. * - HW_PEER_ID
  7671. * Bits 31:16
  7672. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  7673. * address, so for rx frames marked for rx --> tx forwarding, the
  7674. * host can determine from the HW peer ID provided as meta-data with
  7675. * the rx frame which peer the frame is supposed to be forwarded to.
  7676. * Value: ID used by the MAC HW to identify the peer
  7677. */
  7678. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  7679. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  7680. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  7681. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  7682. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  7683. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  7684. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  7685. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  7686. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  7687. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  7688. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  7689. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  7690. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  7691. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  7692. do { \
  7693. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  7694. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  7695. } while (0)
  7696. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  7697. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  7698. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  7699. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  7700. do { \
  7701. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  7702. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  7703. } while (0)
  7704. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  7705. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  7706. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  7707. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  7708. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  7709. do { \
  7710. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  7711. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  7712. } while (0)
  7713. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  7714. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  7715. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  7716. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  7717. #define HTT_RX_PEER_MAP_BYTES 12
  7718. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  7719. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  7720. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  7721. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  7722. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  7723. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  7724. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  7725. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  7726. #define HTT_RX_PEER_UNMAP_BYTES 4
  7727. /**
  7728. * @brief target -> host rx peer map V2 message definition
  7729. *
  7730. * @details
  7731. * The following diagram shows the format of the rx peer map v2 message sent
  7732. * from the target to the host. This layout assumes the target operates
  7733. * as little-endian.
  7734. *
  7735. * This message always contains a SW peer ID. The main purpose of the
  7736. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  7737. * with, so that the host can use that peer ID to determine which peer
  7738. * transmitted the rx frame. This SW peer ID is sometimes also used for
  7739. * other purposes, such as identifying during tx completions which peer
  7740. * the tx frames in question were transmitted to.
  7741. *
  7742. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  7743. * is used during rx --> tx frame forwarding to identify which peer the
  7744. * frame needs to be forwarded to (i.e. the peer assocated with the
  7745. * Destination MAC Address within the packet), and particularly which vdev
  7746. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  7747. * This DA-based peer ID that is provided for certain rx frames
  7748. * (the rx frames that need to be re-transmitted as tx frames)
  7749. * is the ID that the HW uses for referring to the peer in question,
  7750. * rather than the peer ID that the SW+FW use to refer to the peer.
  7751. *
  7752. * The HW peer id here is the same meaning as AST_INDEX_0.
  7753. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  7754. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  7755. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  7756. * AST is valid.
  7757. *
  7758. * |31 28|27 24|23 20|19 17|16|15 8|7 0|
  7759. * |-----------------------------------------------------------------------|
  7760. * | SW peer ID | VDEV ID | msg type |
  7761. * |-----------------------------------------------------------------------|
  7762. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  7763. * |-----------------------------------------------------------------------|
  7764. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  7765. * |-----------------------------------------------------------------------|
  7766. * | Reserved_20_31 |ASTVM|NH| AST Hash Value |
  7767. * |-----------------------------------------------------------------------|
  7768. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  7769. * |-----------------------------------------------------------------------|
  7770. * |TID valid low pri| TID valid hi pri| AST index 2 |
  7771. * |-----------------------------------------------------------------------|
  7772. * | Reserved_1 | AST index 3 |
  7773. * |-----------------------------------------------------------------------|
  7774. * | Reserved_2 |
  7775. * |-----------------------------------------------------------------------|
  7776. * Where:
  7777. * NH = Next Hop
  7778. * ASTVM = AST valid mask
  7779. * ASTFM = AST flow mask
  7780. *
  7781. * The following field definitions describe the format of the rx peer map v2
  7782. * messages sent from the target to the host.
  7783. * - MSG_TYPE
  7784. * Bits 7:0
  7785. * Purpose: identifies this as an rx peer map v2 message
  7786. * Value: peer map v2 -> 0x1e
  7787. * - VDEV_ID
  7788. * Bits 15:8
  7789. * Purpose: Indicates which virtual device the peer is associated with.
  7790. * Value: vdev ID (used in the host to look up the vdev object)
  7791. * - SW_PEER_ID
  7792. * Bits 31:16
  7793. * Purpose: The peer ID (index) that WAL is allocating
  7794. * Value: (rx) peer ID
  7795. * - MAC_ADDR_L32
  7796. * Bits 31:0
  7797. * Purpose: Identifies which peer node the peer ID is for.
  7798. * Value: lower 4 bytes of peer node's MAC address
  7799. * - MAC_ADDR_U16
  7800. * Bits 15:0
  7801. * Purpose: Identifies which peer node the peer ID is for.
  7802. * Value: upper 2 bytes of peer node's MAC address
  7803. * - HW_PEER_ID / AST_INDEX_0
  7804. * Bits 31:16
  7805. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  7806. * address, so for rx frames marked for rx --> tx forwarding, the
  7807. * host can determine from the HW peer ID provided as meta-data with
  7808. * the rx frame which peer the frame is supposed to be forwarded to.
  7809. * Value: ID used by the MAC HW to identify the peer
  7810. * - AST_HASH_VALUE
  7811. * Bits 15:0
  7812. * Purpose: Indicates AST Hash value is required for the TCL AST index
  7813. * override feature.
  7814. * - NEXT_HOP
  7815. * Bit 16
  7816. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  7817. * (Wireless Distribution System).
  7818. * - AST_VALID_MASK
  7819. * Bits 19:17
  7820. * Purpose: Indicate if the AST 1 through AST 3 are valid
  7821. * - AST_INDEX_1
  7822. * Bits 15:0
  7823. * Purpose: indicate the second AST index for this peer
  7824. * - AST_0_FLOW_MASK
  7825. * Bits 19:16
  7826. * Purpose: identify the which flow the AST 0 entry corresponds to.
  7827. * - AST_1_FLOW_MASK
  7828. * Bits 23:20
  7829. * Purpose: identify the which flow the AST 1 entry corresponds to.
  7830. * - AST_2_FLOW_MASK
  7831. * Bits 27:24
  7832. * Purpose: identify the which flow the AST 2 entry corresponds to.
  7833. * - AST_3_FLOW_MASK
  7834. * Bits 31:28
  7835. * Purpose: identify the which flow the AST 3 entry corresponds to.
  7836. * - AST_INDEX_2
  7837. * Bits 15:0
  7838. * Purpose: indicate the third AST index for this peer
  7839. * - TID_VALID_HI_PRI
  7840. * Bits 23:16
  7841. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  7842. * - TID_VALID_LOW_PRI
  7843. * Bits 31:24
  7844. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  7845. * - AST_INDEX_3
  7846. * Bits 15:0
  7847. * Purpose: indicate the fourth AST index for this peer
  7848. */
  7849. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  7850. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  7851. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  7852. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  7853. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  7854. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  7855. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  7856. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  7857. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  7858. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  7859. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  7860. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  7861. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  7862. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  7863. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  7864. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  7865. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  7866. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  7867. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  7868. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  7869. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  7870. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  7871. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  7872. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  7873. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  7874. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  7875. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  7876. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  7877. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  7878. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  7879. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  7880. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  7881. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  7882. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  7883. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  7884. do { \
  7885. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  7886. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  7887. } while (0)
  7888. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  7889. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  7890. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  7891. do { \
  7892. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  7893. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  7894. } while (0)
  7895. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  7896. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  7897. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  7898. do { \
  7899. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  7900. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  7901. } while (0)
  7902. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  7903. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  7904. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  7905. do { \
  7906. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  7907. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  7908. } while (0)
  7909. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  7910. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  7911. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  7912. do { \
  7913. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  7914. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  7915. } while (0)
  7916. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  7917. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  7918. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  7919. do { \
  7920. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  7921. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  7922. } while (0)
  7923. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  7924. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  7925. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  7926. do { \
  7927. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  7928. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  7929. } while (0)
  7930. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  7931. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  7932. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  7933. do { \
  7934. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  7935. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  7936. } while (0)
  7937. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  7938. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  7939. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  7940. do { \
  7941. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  7942. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  7943. } while (0)
  7944. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  7945. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  7946. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  7947. do { \
  7948. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  7949. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  7950. } while (0)
  7951. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  7952. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  7953. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  7954. do { \
  7955. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  7956. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  7957. } while (0)
  7958. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  7959. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  7960. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  7961. do { \
  7962. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  7963. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  7964. } while (0)
  7965. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  7966. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  7967. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  7968. do { \
  7969. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  7970. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  7971. } while (0)
  7972. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  7973. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  7974. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  7975. do { \
  7976. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  7977. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  7978. } while (0)
  7979. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  7980. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  7981. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  7982. do { \
  7983. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  7984. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  7985. } while (0)
  7986. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  7987. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  7988. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  7989. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  7990. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  7991. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  7992. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  7993. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  7994. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  7995. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  7996. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  7997. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  7998. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  7999. #define HTT_RX_PEER_MAP_V2_BYTES 32
  8000. /**
  8001. * @brief target -> host rx peer unmap V2 message definition
  8002. *
  8003. *
  8004. * The following diagram shows the format of the rx peer unmap message sent
  8005. * from the target to the host.
  8006. *
  8007. * |31 24|23 16|15 8|7 0|
  8008. * |-----------------------------------------------------------------------|
  8009. * | SW peer ID | VDEV ID | msg type |
  8010. * |-----------------------------------------------------------------------|
  8011. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  8012. * |-----------------------------------------------------------------------|
  8013. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  8014. * |-----------------------------------------------------------------------|
  8015. * | Peer Delete Duration |
  8016. * |-----------------------------------------------------------------------|
  8017. * | Reserved_0 |
  8018. * |-----------------------------------------------------------------------|
  8019. * | Reserved_1 |
  8020. * |-----------------------------------------------------------------------|
  8021. * | Reserved_2 |
  8022. * |-----------------------------------------------------------------------|
  8023. *
  8024. *
  8025. * The following field definitions describe the format of the rx peer unmap
  8026. * messages sent from the target to the host.
  8027. * - MSG_TYPE
  8028. * Bits 7:0
  8029. * Purpose: identifies this as an rx peer unmap v2 message
  8030. * Value: peer unmap v2 -> 0x1f
  8031. * - VDEV_ID
  8032. * Bits 15:8
  8033. * Purpose: Indicates which virtual device the peer is associated
  8034. * with.
  8035. * Value: vdev ID (used in the host to look up the vdev object)
  8036. * - SW_PEER_ID
  8037. * Bits 31:16
  8038. * Purpose: The peer ID (index) that WAL is freeing
  8039. * Value: (rx) peer ID
  8040. * - MAC_ADDR_L32
  8041. * Bits 31:0
  8042. * Purpose: Identifies which peer node the peer ID is for.
  8043. * Value: lower 4 bytes of peer node's MAC address
  8044. * - MAC_ADDR_U16
  8045. * Bits 15:0
  8046. * Purpose: Identifies which peer node the peer ID is for.
  8047. * Value: upper 2 bytes of peer node's MAC address
  8048. * - NEXT_HOP
  8049. * Bits 16
  8050. * Purpose: Bit indicates next_hop AST entry used for WDS
  8051. * (Wireless Distribution System).
  8052. * - PEER_DELETE_DURATION
  8053. * Bits 31:0
  8054. * Purpose: Time taken to delete peer, in msec,
  8055. * Used for monitoring / debugging PEER delete response delay
  8056. */
  8057. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  8058. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  8059. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  8060. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  8061. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  8062. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  8063. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  8064. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  8065. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  8066. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  8067. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  8068. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  8069. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  8070. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  8071. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  8072. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  8073. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  8074. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  8075. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  8076. do { \
  8077. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  8078. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  8079. } while (0)
  8080. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  8081. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  8082. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  8083. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  8084. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  8085. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  8086. /**
  8087. * @brief target -> host message specifying security parameters
  8088. *
  8089. * @details
  8090. * The following diagram shows the format of the security specification
  8091. * message sent from the target to the host.
  8092. * This security specification message tells the host whether a PN check is
  8093. * necessary on rx data frames, and if so, how large the PN counter is.
  8094. * This message also tells the host about the security processing to apply
  8095. * to defragmented rx frames - specifically, whether a Message Integrity
  8096. * Check is required, and the Michael key to use.
  8097. *
  8098. * |31 24|23 16|15|14 8|7 0|
  8099. * |-----------------------------------------------------------------------|
  8100. * | peer ID | U| security type | msg type |
  8101. * |-----------------------------------------------------------------------|
  8102. * | Michael Key K0 |
  8103. * |-----------------------------------------------------------------------|
  8104. * | Michael Key K1 |
  8105. * |-----------------------------------------------------------------------|
  8106. * | WAPI RSC Low0 |
  8107. * |-----------------------------------------------------------------------|
  8108. * | WAPI RSC Low1 |
  8109. * |-----------------------------------------------------------------------|
  8110. * | WAPI RSC Hi0 |
  8111. * |-----------------------------------------------------------------------|
  8112. * | WAPI RSC Hi1 |
  8113. * |-----------------------------------------------------------------------|
  8114. *
  8115. * The following field definitions describe the format of the security
  8116. * indication message sent from the target to the host.
  8117. * - MSG_TYPE
  8118. * Bits 7:0
  8119. * Purpose: identifies this as a security specification message
  8120. * Value: 0xb
  8121. * - SEC_TYPE
  8122. * Bits 14:8
  8123. * Purpose: specifies which type of security applies to the peer
  8124. * Value: htt_sec_type enum value
  8125. * - UNICAST
  8126. * Bit 15
  8127. * Purpose: whether this security is applied to unicast or multicast data
  8128. * Value: 1 -> unicast, 0 -> multicast
  8129. * - PEER_ID
  8130. * Bits 31:16
  8131. * Purpose: The ID number for the peer the security specification is for
  8132. * Value: peer ID
  8133. * - MICHAEL_KEY_K0
  8134. * Bits 31:0
  8135. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  8136. * Value: Michael Key K0 (if security type is TKIP)
  8137. * - MICHAEL_KEY_K1
  8138. * Bits 31:0
  8139. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  8140. * Value: Michael Key K1 (if security type is TKIP)
  8141. * - WAPI_RSC_LOW0
  8142. * Bits 31:0
  8143. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  8144. * Value: WAPI RSC Low0 (if security type is WAPI)
  8145. * - WAPI_RSC_LOW1
  8146. * Bits 31:0
  8147. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  8148. * Value: WAPI RSC Low1 (if security type is WAPI)
  8149. * - WAPI_RSC_HI0
  8150. * Bits 31:0
  8151. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  8152. * Value: WAPI RSC Hi0 (if security type is WAPI)
  8153. * - WAPI_RSC_HI1
  8154. * Bits 31:0
  8155. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  8156. * Value: WAPI RSC Hi1 (if security type is WAPI)
  8157. */
  8158. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  8159. #define HTT_SEC_IND_SEC_TYPE_S 8
  8160. #define HTT_SEC_IND_UNICAST_M 0x00008000
  8161. #define HTT_SEC_IND_UNICAST_S 15
  8162. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  8163. #define HTT_SEC_IND_PEER_ID_S 16
  8164. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  8165. do { \
  8166. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  8167. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  8168. } while (0)
  8169. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  8170. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  8171. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  8172. do { \
  8173. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  8174. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  8175. } while (0)
  8176. #define HTT_SEC_IND_UNICAST_GET(word) \
  8177. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  8178. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  8179. do { \
  8180. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  8181. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  8182. } while (0)
  8183. #define HTT_SEC_IND_PEER_ID_GET(word) \
  8184. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  8185. #define HTT_SEC_IND_BYTES 28
  8186. /**
  8187. * @brief target -> host rx ADDBA / DELBA message definitions
  8188. *
  8189. * @details
  8190. * The following diagram shows the format of the rx ADDBA message sent
  8191. * from the target to the host:
  8192. *
  8193. * |31 20|19 16|15 8|7 0|
  8194. * |---------------------------------------------------------------------|
  8195. * | peer ID | TID | window size | msg type |
  8196. * |---------------------------------------------------------------------|
  8197. *
  8198. * The following diagram shows the format of the rx DELBA message sent
  8199. * from the target to the host:
  8200. *
  8201. * |31 20|19 16|15 10|9 8|7 0|
  8202. * |---------------------------------------------------------------------|
  8203. * | peer ID | TID | reserved | IR| msg type |
  8204. * |---------------------------------------------------------------------|
  8205. *
  8206. * The following field definitions describe the format of the rx ADDBA
  8207. * and DELBA messages sent from the target to the host.
  8208. * - MSG_TYPE
  8209. * Bits 7:0
  8210. * Purpose: identifies this as an rx ADDBA or DELBA message
  8211. * Value: ADDBA -> 0x5, DELBA -> 0x6
  8212. * - IR (initiator / recipient)
  8213. * Bits 9:8 (DELBA only)
  8214. * Purpose: specify whether the DELBA handshake was initiated by the
  8215. * local STA/AP, or by the peer STA/AP
  8216. * Value:
  8217. * 0 - unspecified
  8218. * 1 - initiator (a.k.a. originator)
  8219. * 2 - recipient (a.k.a. responder)
  8220. * 3 - unused / reserved
  8221. * - WIN_SIZE
  8222. * Bits 15:8 (ADDBA only)
  8223. * Purpose: Specifies the length of the block ack window (max = 64).
  8224. * Value:
  8225. * block ack window length specified by the received ADDBA
  8226. * management message.
  8227. * - TID
  8228. * Bits 19:16
  8229. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  8230. * Value:
  8231. * TID specified by the received ADDBA or DELBA management message.
  8232. * - PEER_ID
  8233. * Bits 31:20
  8234. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  8235. * Value:
  8236. * ID (hash value) used by the host for fast, direct lookup of
  8237. * host SW peer info, including rx reorder states.
  8238. */
  8239. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  8240. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  8241. #define HTT_RX_ADDBA_TID_M 0xf0000
  8242. #define HTT_RX_ADDBA_TID_S 16
  8243. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  8244. #define HTT_RX_ADDBA_PEER_ID_S 20
  8245. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  8246. do { \
  8247. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  8248. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  8249. } while (0)
  8250. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  8251. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  8252. #define HTT_RX_ADDBA_TID_SET(word, value) \
  8253. do { \
  8254. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  8255. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  8256. } while (0)
  8257. #define HTT_RX_ADDBA_TID_GET(word) \
  8258. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  8259. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  8260. do { \
  8261. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  8262. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  8263. } while (0)
  8264. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  8265. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  8266. #define HTT_RX_ADDBA_BYTES 4
  8267. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  8268. #define HTT_RX_DELBA_INITIATOR_S 8
  8269. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  8270. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  8271. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  8272. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  8273. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  8274. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  8275. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  8276. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  8277. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  8278. do { \
  8279. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  8280. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  8281. } while (0)
  8282. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  8283. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  8284. #define HTT_RX_DELBA_BYTES 4
  8285. /**
  8286. * @brief tx queue group information element definition
  8287. *
  8288. * @details
  8289. * The following diagram shows the format of the tx queue group
  8290. * information element, which can be included in target --> host
  8291. * messages to specify the number of tx "credits" (tx descriptors
  8292. * for LL, or tx buffers for HL) available to a particular group
  8293. * of host-side tx queues, and which host-side tx queues belong to
  8294. * the group.
  8295. *
  8296. * |31|30 24|23 16|15|14|13 0|
  8297. * |------------------------------------------------------------------------|
  8298. * | X| reserved | tx queue grp ID | A| S| credit count |
  8299. * |------------------------------------------------------------------------|
  8300. * | vdev ID mask | AC mask |
  8301. * |------------------------------------------------------------------------|
  8302. *
  8303. * The following definitions describe the fields within the tx queue group
  8304. * information element:
  8305. * - credit_count
  8306. * Bits 13:1
  8307. * Purpose: specify how many tx credits are available to the tx queue group
  8308. * Value: An absolute or relative, positive or negative credit value
  8309. * The 'A' bit specifies whether the value is absolute or relative.
  8310. * The 'S' bit specifies whether the value is positive or negative.
  8311. * A negative value can only be relative, not absolute.
  8312. * An absolute value replaces any prior credit value the host has for
  8313. * the tx queue group in question.
  8314. * A relative value is added to the prior credit value the host has for
  8315. * the tx queue group in question.
  8316. * - sign
  8317. * Bit 14
  8318. * Purpose: specify whether the credit count is positive or negative
  8319. * Value: 0 -> positive, 1 -> negative
  8320. * - absolute
  8321. * Bit 15
  8322. * Purpose: specify whether the credit count is absolute or relative
  8323. * Value: 0 -> relative, 1 -> absolute
  8324. * - txq_group_id
  8325. * Bits 23:16
  8326. * Purpose: indicate which tx queue group's credit and/or membership are
  8327. * being specified
  8328. * Value: 0 to max_tx_queue_groups-1
  8329. * - reserved
  8330. * Bits 30:16
  8331. * Value: 0x0
  8332. * - eXtension
  8333. * Bit 31
  8334. * Purpose: specify whether another tx queue group info element follows
  8335. * Value: 0 -> no more tx queue group information elements
  8336. * 1 -> another tx queue group information element immediately follows
  8337. * - ac_mask
  8338. * Bits 15:0
  8339. * Purpose: specify which Access Categories belong to the tx queue group
  8340. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  8341. * the tx queue group.
  8342. * The AC bit-mask values are obtained by left-shifting by the
  8343. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  8344. * - vdev_id_mask
  8345. * Bits 31:16
  8346. * Purpose: specify which vdev's tx queues belong to the tx queue group
  8347. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  8348. * belong to the tx queue group.
  8349. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  8350. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  8351. */
  8352. PREPACK struct htt_txq_group {
  8353. A_UINT32
  8354. credit_count: 14,
  8355. sign: 1,
  8356. absolute: 1,
  8357. tx_queue_group_id: 8,
  8358. reserved0: 7,
  8359. extension: 1;
  8360. A_UINT32
  8361. ac_mask: 16,
  8362. vdev_id_mask: 16;
  8363. } POSTPACK;
  8364. /* first word */
  8365. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  8366. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  8367. #define HTT_TXQ_GROUP_SIGN_S 14
  8368. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  8369. #define HTT_TXQ_GROUP_ABS_S 15
  8370. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  8371. #define HTT_TXQ_GROUP_ID_S 16
  8372. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  8373. #define HTT_TXQ_GROUP_EXT_S 31
  8374. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  8375. /* second word */
  8376. #define HTT_TXQ_GROUP_AC_MASK_S 0
  8377. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  8378. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  8379. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  8380. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  8381. do { \
  8382. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  8383. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  8384. } while (0)
  8385. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  8386. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  8387. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  8388. do { \
  8389. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  8390. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  8391. } while (0)
  8392. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  8393. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  8394. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  8395. do { \
  8396. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  8397. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  8398. } while (0)
  8399. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  8400. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  8401. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  8402. do { \
  8403. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  8404. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  8405. } while (0)
  8406. #define HTT_TXQ_GROUP_ID_GET(_info) \
  8407. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  8408. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  8409. do { \
  8410. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  8411. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  8412. } while (0)
  8413. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  8414. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  8415. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  8416. do { \
  8417. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  8418. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  8419. } while (0)
  8420. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  8421. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  8422. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  8423. do { \
  8424. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  8425. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  8426. } while (0)
  8427. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  8428. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  8429. /**
  8430. * @brief target -> host TX completion indication message definition
  8431. *
  8432. * @details
  8433. * The following diagram shows the format of the TX completion indication sent
  8434. * from the target to the host
  8435. *
  8436. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  8437. * |-------------------------------------------------------------------|
  8438. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  8439. * |-------------------------------------------------------------------|
  8440. * payload:| MSDU1 ID | MSDU0 ID |
  8441. * |-------------------------------------------------------------------|
  8442. * : MSDU3 ID | MSDU2 ID :
  8443. * |-------------------------------------------------------------------|
  8444. * | struct htt_tx_compl_ind_append_retries |
  8445. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  8446. * | struct htt_tx_compl_ind_append_tx_tstamp |
  8447. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  8448. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  8449. * |-------------------------------------------------------------------|
  8450. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  8451. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  8452. * | MSDU0 tx_tsf64_low |
  8453. * |-------------------------------------------------------------------|
  8454. * | MSDU0 tx_tsf64_high |
  8455. * |-------------------------------------------------------------------|
  8456. * | MSDU1 tx_tsf64_low |
  8457. * |-------------------------------------------------------------------|
  8458. * | MSDU1 tx_tsf64_high |
  8459. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  8460. * | phy_timestamp |
  8461. * |-------------------------------------------------------------------|
  8462. * | rate specs (see below) |
  8463. * |-------------------------------------------------------------------|
  8464. * | seqctrl | framectrl |
  8465. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  8466. * Where:
  8467. * A0 = append (a.k.a. append0)
  8468. * A1 = append1
  8469. * TP = MSDU tx power presence
  8470. * A2 = append2
  8471. * A3 = append3
  8472. * A4 = append4
  8473. *
  8474. * The following field definitions describe the format of the TX completion
  8475. * indication sent from the target to the host
  8476. * Header fields:
  8477. * - msg_type
  8478. * Bits 7:0
  8479. * Purpose: identifies this as HTT TX completion indication
  8480. * Value: 0x7
  8481. * - status
  8482. * Bits 10:8
  8483. * Purpose: the TX completion status of payload fragmentations descriptors
  8484. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  8485. * - tid
  8486. * Bits 14:11
  8487. * Purpose: the tid associated with those fragmentation descriptors. It is
  8488. * valid or not, depending on the tid_invalid bit.
  8489. * Value: 0 to 15
  8490. * - tid_invalid
  8491. * Bits 15:15
  8492. * Purpose: this bit indicates whether the tid field is valid or not
  8493. * Value: 0 indicates valid; 1 indicates invalid
  8494. * - num
  8495. * Bits 23:16
  8496. * Purpose: the number of payload in this indication
  8497. * Value: 1 to 255
  8498. * - append (a.k.a. append0)
  8499. * Bits 24:24
  8500. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  8501. * the number of tx retries for one MSDU at the end of this message
  8502. * Value: 0 indicates no appending; 1 indicates appending
  8503. * - append1
  8504. * Bits 25:25
  8505. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  8506. * contains the timestamp info for each TX msdu id in payload.
  8507. * The order of the timestamps matches the order of the MSDU IDs.
  8508. * Note that a big-endian host needs to account for the reordering
  8509. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  8510. * conversion) when determining which tx timestamp corresponds to
  8511. * which MSDU ID.
  8512. * Value: 0 indicates no appending; 1 indicates appending
  8513. * - msdu_tx_power_presence
  8514. * Bits 26:26
  8515. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  8516. * for each MSDU referenced by the TX_COMPL_IND message.
  8517. * The tx power is reported in 0.5 dBm units.
  8518. * The order of the per-MSDU tx power reports matches the order
  8519. * of the MSDU IDs.
  8520. * Note that a big-endian host needs to account for the reordering
  8521. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  8522. * conversion) when determining which Tx Power corresponds to
  8523. * which MSDU ID.
  8524. * Value: 0 indicates MSDU tx power reports are not appended,
  8525. * 1 indicates MSDU tx power reports are appended
  8526. * - append2
  8527. * Bits 27:27
  8528. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  8529. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  8530. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  8531. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  8532. * for each MSDU, for convenience.
  8533. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  8534. * this append2 bit is set).
  8535. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  8536. * dB above the noise floor.
  8537. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  8538. * 1 indicates MSDU ACK RSSI values are appended.
  8539. * - append3
  8540. * Bits 28:28
  8541. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  8542. * contains the tx tsf info based on wlan global TSF for
  8543. * each TX msdu id in payload.
  8544. * The order of the tx tsf matches the order of the MSDU IDs.
  8545. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  8546. * values to indicate the the lower 32 bits and higher 32 bits of
  8547. * the tx tsf.
  8548. * The tx_tsf64 here represents the time MSDU was acked and the
  8549. * tx_tsf64 has microseconds units.
  8550. * Value: 0 indicates no appending; 1 indicates appending
  8551. * - append4
  8552. * Bits 29:29
  8553. * Purpose: Indicate whether data frame control fields and fields required
  8554. * for radio tap header are appended for each MSDU in TX_COMP_IND
  8555. * message. The order of the this message matches the order of
  8556. * the MSDU IDs.
  8557. * Value: 0 indicates frame control fields and fields required for
  8558. * radio tap header values are not appended,
  8559. * 1 indicates frame control fields and fields required for
  8560. * radio tap header values are appended.
  8561. * Payload fields:
  8562. * - hmsdu_id
  8563. * Bits 15:0
  8564. * Purpose: this ID is used to track the Tx buffer in host
  8565. * Value: 0 to "size of host MSDU descriptor pool - 1"
  8566. */
  8567. PREPACK struct htt_tx_data_hdr_information {
  8568. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  8569. A_UINT32 /* word 1 */
  8570. /* preamble:
  8571. * 0-OFDM,
  8572. * 1-CCk,
  8573. * 2-HT,
  8574. * 3-VHT
  8575. */
  8576. preamble: 2, /* [1:0] */
  8577. /* mcs:
  8578. * In case of HT preamble interpret
  8579. * MCS along with NSS.
  8580. * Valid values for HT are 0 to 7.
  8581. * HT mcs 0 with NSS 2 is mcs 8.
  8582. * Valid values for VHT are 0 to 9.
  8583. */
  8584. mcs: 4, /* [5:2] */
  8585. /* rate:
  8586. * This is applicable only for
  8587. * CCK and OFDM preamble type
  8588. * rate 0: OFDM 48 Mbps,
  8589. * 1: OFDM 24 Mbps,
  8590. * 2: OFDM 12 Mbps
  8591. * 3: OFDM 6 Mbps
  8592. * 4: OFDM 54 Mbps
  8593. * 5: OFDM 36 Mbps
  8594. * 6: OFDM 18 Mbps
  8595. * 7: OFDM 9 Mbps
  8596. * rate 0: CCK 11 Mbps Long
  8597. * 1: CCK 5.5 Mbps Long
  8598. * 2: CCK 2 Mbps Long
  8599. * 3: CCK 1 Mbps Long
  8600. * 4: CCK 11 Mbps Short
  8601. * 5: CCK 5.5 Mbps Short
  8602. * 6: CCK 2 Mbps Short
  8603. */
  8604. rate : 3, /* [ 8: 6] */
  8605. rssi : 8, /* [16: 9] units=dBm */
  8606. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  8607. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  8608. stbc : 1, /* [22] */
  8609. sgi : 1, /* [23] */
  8610. ldpc : 1, /* [24] */
  8611. beamformed: 1, /* [25] */
  8612. reserved_1: 6; /* [31:26] */
  8613. A_UINT32 /* word 2 */
  8614. framectrl:16, /* [15: 0] */
  8615. seqno:16; /* [31:16] */
  8616. } POSTPACK;
  8617. #define HTT_TX_COMPL_IND_STATUS_S 8
  8618. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  8619. #define HTT_TX_COMPL_IND_TID_S 11
  8620. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  8621. #define HTT_TX_COMPL_IND_TID_INV_S 15
  8622. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  8623. #define HTT_TX_COMPL_IND_NUM_S 16
  8624. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  8625. #define HTT_TX_COMPL_IND_APPEND_S 24
  8626. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  8627. #define HTT_TX_COMPL_IND_APPEND1_S 25
  8628. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  8629. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  8630. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  8631. #define HTT_TX_COMPL_IND_APPEND2_S 27
  8632. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  8633. #define HTT_TX_COMPL_IND_APPEND3_S 28
  8634. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  8635. #define HTT_TX_COMPL_IND_APPEND4_S 29
  8636. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  8637. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  8638. do { \
  8639. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  8640. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  8641. } while (0)
  8642. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  8643. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  8644. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  8645. do { \
  8646. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  8647. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  8648. } while (0)
  8649. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  8650. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  8651. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  8652. do { \
  8653. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  8654. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  8655. } while (0)
  8656. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  8657. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  8658. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  8659. do { \
  8660. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  8661. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  8662. } while (0)
  8663. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  8664. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  8665. HTT_TX_COMPL_IND_TID_INV_S)
  8666. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  8667. do { \
  8668. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  8669. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  8670. } while (0)
  8671. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  8672. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  8673. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  8674. do { \
  8675. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  8676. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  8677. } while (0)
  8678. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  8679. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  8680. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  8681. do { \
  8682. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  8683. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  8684. } while (0)
  8685. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  8686. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  8687. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  8688. do { \
  8689. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  8690. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  8691. } while (0)
  8692. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  8693. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  8694. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  8695. do { \
  8696. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  8697. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  8698. } while (0)
  8699. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  8700. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  8701. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  8702. do { \
  8703. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  8704. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  8705. } while (0)
  8706. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  8707. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  8708. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  8709. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  8710. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  8711. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  8712. #define HTT_TX_COMPL_IND_STAT_OK 0
  8713. /* DISCARD:
  8714. * current meaning:
  8715. * MSDUs were queued for transmission but filtered by HW or SW
  8716. * without any over the air attempts
  8717. * legacy meaning (HL Rome):
  8718. * MSDUs were discarded by the target FW without any over the air
  8719. * attempts due to lack of space
  8720. */
  8721. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  8722. /* NO_ACK:
  8723. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  8724. */
  8725. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  8726. /* POSTPONE:
  8727. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  8728. * be downloaded again later (in the appropriate order), when they are
  8729. * deliverable.
  8730. */
  8731. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  8732. /*
  8733. * The PEER_DEL tx completion status is used for HL cases
  8734. * where the peer the frame is for has been deleted.
  8735. * The host has already discarded its copy of the frame, but
  8736. * it still needs the tx completion to restore its credit.
  8737. */
  8738. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  8739. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  8740. #define HTT_TX_COMPL_IND_STAT_DROP 5
  8741. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  8742. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  8743. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  8744. PREPACK struct htt_tx_compl_ind_base {
  8745. A_UINT32 hdr;
  8746. A_UINT16 payload[1/*or more*/];
  8747. } POSTPACK;
  8748. PREPACK struct htt_tx_compl_ind_append_retries {
  8749. A_UINT16 msdu_id;
  8750. A_UINT8 tx_retries;
  8751. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  8752. 0: this is the last append_retries struct */
  8753. } POSTPACK;
  8754. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  8755. A_UINT32 timestamp[1/*or more*/];
  8756. } POSTPACK;
  8757. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  8758. A_UINT32 tx_tsf64_low;
  8759. A_UINT32 tx_tsf64_high;
  8760. } POSTPACK;
  8761. /* htt_tx_data_hdr_information payload extension fields: */
  8762. /* DWORD zero */
  8763. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  8764. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  8765. /* DWORD one */
  8766. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  8767. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  8768. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  8769. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  8770. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  8771. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  8772. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  8773. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  8774. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  8775. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  8776. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  8777. #define HTT_FW_TX_DATA_HDR_BW_S 19
  8778. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  8779. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  8780. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  8781. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  8782. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  8783. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  8784. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  8785. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  8786. /* DWORD two */
  8787. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  8788. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  8789. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  8790. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  8791. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  8792. do { \
  8793. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  8794. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  8795. } while (0)
  8796. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  8797. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  8798. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  8799. do { \
  8800. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  8801. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  8802. } while (0)
  8803. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  8804. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  8805. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  8806. do { \
  8807. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  8808. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  8809. } while (0)
  8810. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  8811. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  8812. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  8813. do { \
  8814. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  8815. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  8816. } while (0)
  8817. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  8818. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  8819. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  8820. do { \
  8821. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  8822. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  8823. } while (0)
  8824. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  8825. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  8826. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  8827. do { \
  8828. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  8829. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  8830. } while (0)
  8831. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  8832. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  8833. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  8834. do { \
  8835. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  8836. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  8837. } while (0)
  8838. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  8839. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  8840. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  8841. do { \
  8842. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  8843. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  8844. } while (0)
  8845. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  8846. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  8847. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  8848. do { \
  8849. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  8850. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  8851. } while (0)
  8852. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  8853. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  8854. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  8855. do { \
  8856. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  8857. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  8858. } while (0)
  8859. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  8860. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  8861. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  8862. do { \
  8863. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  8864. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  8865. } while (0)
  8866. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  8867. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  8868. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  8869. do { \
  8870. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  8871. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  8872. } while (0)
  8873. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  8874. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  8875. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  8876. do { \
  8877. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  8878. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  8879. } while (0)
  8880. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  8881. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  8882. /**
  8883. * @brief target -> host rate-control update indication message
  8884. *
  8885. * @details
  8886. * The following diagram shows the format of the RC Update message
  8887. * sent from the target to the host, while processing the tx-completion
  8888. * of a transmitted PPDU.
  8889. *
  8890. * |31 24|23 16|15 8|7 0|
  8891. * |-------------------------------------------------------------|
  8892. * | peer ID | vdev ID | msg_type |
  8893. * |-------------------------------------------------------------|
  8894. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  8895. * |-------------------------------------------------------------|
  8896. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  8897. * |-------------------------------------------------------------|
  8898. * | : |
  8899. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  8900. * | : |
  8901. * |-------------------------------------------------------------|
  8902. * | : |
  8903. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  8904. * | : |
  8905. * |-------------------------------------------------------------|
  8906. * : :
  8907. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  8908. *
  8909. */
  8910. typedef struct {
  8911. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  8912. A_UINT32 rate_code_flags;
  8913. A_UINT32 flags; /* Encodes information such as excessive
  8914. retransmission, aggregate, some info
  8915. from .11 frame control,
  8916. STBC, LDPC, (SGI and Tx Chain Mask
  8917. are encoded in ptx_rc->flags field),
  8918. AMPDU truncation (BT/time based etc.),
  8919. RTS/CTS attempt */
  8920. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  8921. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  8922. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  8923. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  8924. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  8925. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  8926. } HTT_RC_TX_DONE_PARAMS;
  8927. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  8928. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  8929. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  8930. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  8931. #define HTT_RC_UPDATE_VDEVID_S 8
  8932. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  8933. #define HTT_RC_UPDATE_PEERID_S 16
  8934. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  8935. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  8936. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  8937. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  8938. do { \
  8939. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  8940. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  8941. } while (0)
  8942. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  8943. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  8944. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  8945. do { \
  8946. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  8947. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  8948. } while (0)
  8949. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  8950. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  8951. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  8952. do { \
  8953. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  8954. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  8955. } while (0)
  8956. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  8957. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  8958. /**
  8959. * @brief target -> host rx fragment indication message definition
  8960. *
  8961. * @details
  8962. * The following field definitions describe the format of the rx fragment
  8963. * indication message sent from the target to the host.
  8964. * The rx fragment indication message shares the format of the
  8965. * rx indication message, but not all fields from the rx indication message
  8966. * are relevant to the rx fragment indication message.
  8967. *
  8968. *
  8969. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  8970. * |-----------+-------------------+---------------------+-------------|
  8971. * | peer ID | |FV| ext TID | msg type |
  8972. * |-------------------------------------------------------------------|
  8973. * | | flush | flush |
  8974. * | | end | start |
  8975. * | | seq num | seq num |
  8976. * |-------------------------------------------------------------------|
  8977. * | reserved | FW rx desc bytes |
  8978. * |-------------------------------------------------------------------|
  8979. * | | FW MSDU Rx |
  8980. * | | desc B0 |
  8981. * |-------------------------------------------------------------------|
  8982. * Header fields:
  8983. * - MSG_TYPE
  8984. * Bits 7:0
  8985. * Purpose: identifies this as an rx fragment indication message
  8986. * Value: 0xa
  8987. * - EXT_TID
  8988. * Bits 12:8
  8989. * Purpose: identify the traffic ID of the rx data, including
  8990. * special "extended" TID values for multicast, broadcast, and
  8991. * non-QoS data frames
  8992. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  8993. * - FLUSH_VALID (FV)
  8994. * Bit 13
  8995. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  8996. * is valid
  8997. * Value:
  8998. * 1 -> flush IE is valid and needs to be processed
  8999. * 0 -> flush IE is not valid and should be ignored
  9000. * - PEER_ID
  9001. * Bits 31:16
  9002. * Purpose: Identify, by ID, which peer sent the rx data
  9003. * Value: ID of the peer who sent the rx data
  9004. * - FLUSH_SEQ_NUM_START
  9005. * Bits 5:0
  9006. * Purpose: Indicate the start of a series of MPDUs to flush
  9007. * Not all MPDUs within this series are necessarily valid - the host
  9008. * must check each sequence number within this range to see if the
  9009. * corresponding MPDU is actually present.
  9010. * This field is only valid if the FV bit is set.
  9011. * Value:
  9012. * The sequence number for the first MPDUs to check to flush.
  9013. * The sequence number is masked by 0x3f.
  9014. * - FLUSH_SEQ_NUM_END
  9015. * Bits 11:6
  9016. * Purpose: Indicate the end of a series of MPDUs to flush
  9017. * Value:
  9018. * The sequence number one larger than the sequence number of the
  9019. * last MPDU to check to flush.
  9020. * The sequence number is masked by 0x3f.
  9021. * Not all MPDUs within this series are necessarily valid - the host
  9022. * must check each sequence number within this range to see if the
  9023. * corresponding MPDU is actually present.
  9024. * This field is only valid if the FV bit is set.
  9025. * Rx descriptor fields:
  9026. * - FW_RX_DESC_BYTES
  9027. * Bits 15:0
  9028. * Purpose: Indicate how many bytes in the Rx indication are used for
  9029. * FW Rx descriptors
  9030. * Value: 1
  9031. */
  9032. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  9033. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  9034. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  9035. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  9036. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  9037. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  9038. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  9039. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  9040. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  9041. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  9042. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  9043. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  9044. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  9045. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  9046. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  9047. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  9048. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  9049. #define HTT_RX_FRAG_IND_BYTES \
  9050. (4 /* msg hdr */ + \
  9051. 4 /* flush spec */ + \
  9052. 4 /* (unused) FW rx desc bytes spec */ + \
  9053. 4 /* FW rx desc */)
  9054. /**
  9055. * @brief target -> host test message definition
  9056. *
  9057. * @details
  9058. * The following field definitions describe the format of the test
  9059. * message sent from the target to the host.
  9060. * The message consists of a 4-octet header, followed by a variable
  9061. * number of 32-bit integer values, followed by a variable number
  9062. * of 8-bit character values.
  9063. *
  9064. * |31 16|15 8|7 0|
  9065. * |-----------------------------------------------------------|
  9066. * | num chars | num ints | msg type |
  9067. * |-----------------------------------------------------------|
  9068. * | int 0 |
  9069. * |-----------------------------------------------------------|
  9070. * | int 1 |
  9071. * |-----------------------------------------------------------|
  9072. * | ... |
  9073. * |-----------------------------------------------------------|
  9074. * | char 3 | char 2 | char 1 | char 0 |
  9075. * |-----------------------------------------------------------|
  9076. * | | | ... | char 4 |
  9077. * |-----------------------------------------------------------|
  9078. * - MSG_TYPE
  9079. * Bits 7:0
  9080. * Purpose: identifies this as a test message
  9081. * Value: HTT_MSG_TYPE_TEST
  9082. * - NUM_INTS
  9083. * Bits 15:8
  9084. * Purpose: indicate how many 32-bit integers follow the message header
  9085. * - NUM_CHARS
  9086. * Bits 31:16
  9087. * Purpose: indicate how many 8-bit charaters follow the series of integers
  9088. */
  9089. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  9090. #define HTT_RX_TEST_NUM_INTS_S 8
  9091. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  9092. #define HTT_RX_TEST_NUM_CHARS_S 16
  9093. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  9094. do { \
  9095. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  9096. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  9097. } while (0)
  9098. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  9099. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  9100. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  9101. do { \
  9102. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  9103. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  9104. } while (0)
  9105. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  9106. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  9107. /**
  9108. * @brief target -> host packet log message
  9109. *
  9110. * @details
  9111. * The following field definitions describe the format of the packet log
  9112. * message sent from the target to the host.
  9113. * The message consists of a 4-octet header,followed by a variable number
  9114. * of 32-bit character values.
  9115. *
  9116. * |31 16|15 12|11 10|9 8|7 0|
  9117. * |------------------------------------------------------------------|
  9118. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  9119. * |------------------------------------------------------------------|
  9120. * | payload |
  9121. * |------------------------------------------------------------------|
  9122. * - MSG_TYPE
  9123. * Bits 7:0
  9124. * Purpose: identifies this as a pktlog message
  9125. * Value: HTT_T2H_MSG_TYPE_PKTLOG
  9126. * - mac_id
  9127. * Bits 9:8
  9128. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  9129. * Value: 0-3
  9130. * - pdev_id
  9131. * Bits 11:10
  9132. * Purpose: pdev_id
  9133. * Value: 0-3
  9134. * 0 (for rings at SOC level),
  9135. * 1/2/3 PDEV -> 0/1/2
  9136. * - payload_size
  9137. * Bits 31:16
  9138. * Purpose: explicitly specify the payload size
  9139. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  9140. */
  9141. PREPACK struct htt_pktlog_msg {
  9142. A_UINT32 header;
  9143. A_UINT32 payload[1/* or more */];
  9144. } POSTPACK;
  9145. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  9146. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  9147. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  9148. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  9149. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  9150. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  9151. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  9152. do { \
  9153. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  9154. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  9155. } while (0)
  9156. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  9157. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  9158. HTT_T2H_PKTLOG_MAC_ID_S)
  9159. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  9160. do { \
  9161. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  9162. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  9163. } while (0)
  9164. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  9165. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  9166. HTT_T2H_PKTLOG_PDEV_ID_S)
  9167. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  9168. do { \
  9169. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  9170. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  9171. } while (0)
  9172. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  9173. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  9174. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  9175. /*
  9176. * Rx reorder statistics
  9177. * NB: all the fields must be defined in 4 octets size.
  9178. */
  9179. struct rx_reorder_stats {
  9180. /* Non QoS MPDUs received */
  9181. A_UINT32 deliver_non_qos;
  9182. /* MPDUs received in-order */
  9183. A_UINT32 deliver_in_order;
  9184. /* Flush due to reorder timer expired */
  9185. A_UINT32 deliver_flush_timeout;
  9186. /* Flush due to move out of window */
  9187. A_UINT32 deliver_flush_oow;
  9188. /* Flush due to DELBA */
  9189. A_UINT32 deliver_flush_delba;
  9190. /* MPDUs dropped due to FCS error */
  9191. A_UINT32 fcs_error;
  9192. /* MPDUs dropped due to monitor mode non-data packet */
  9193. A_UINT32 mgmt_ctrl;
  9194. /* Unicast-data MPDUs dropped due to invalid peer */
  9195. A_UINT32 invalid_peer;
  9196. /* MPDUs dropped due to duplication (non aggregation) */
  9197. A_UINT32 dup_non_aggr;
  9198. /* MPDUs dropped due to processed before */
  9199. A_UINT32 dup_past;
  9200. /* MPDUs dropped due to duplicate in reorder queue */
  9201. A_UINT32 dup_in_reorder;
  9202. /* Reorder timeout happened */
  9203. A_UINT32 reorder_timeout;
  9204. /* invalid bar ssn */
  9205. A_UINT32 invalid_bar_ssn;
  9206. /* reorder reset due to bar ssn */
  9207. A_UINT32 ssn_reset;
  9208. /* Flush due to delete peer */
  9209. A_UINT32 deliver_flush_delpeer;
  9210. /* Flush due to offload*/
  9211. A_UINT32 deliver_flush_offload;
  9212. /* Flush due to out of buffer*/
  9213. A_UINT32 deliver_flush_oob;
  9214. /* MPDUs dropped due to PN check fail */
  9215. A_UINT32 pn_fail;
  9216. /* MPDUs dropped due to unable to allocate memory */
  9217. A_UINT32 store_fail;
  9218. /* Number of times the tid pool alloc succeeded */
  9219. A_UINT32 tid_pool_alloc_succ;
  9220. /* Number of times the MPDU pool alloc succeeded */
  9221. A_UINT32 mpdu_pool_alloc_succ;
  9222. /* Number of times the MSDU pool alloc succeeded */
  9223. A_UINT32 msdu_pool_alloc_succ;
  9224. /* Number of times the tid pool alloc failed */
  9225. A_UINT32 tid_pool_alloc_fail;
  9226. /* Number of times the MPDU pool alloc failed */
  9227. A_UINT32 mpdu_pool_alloc_fail;
  9228. /* Number of times the MSDU pool alloc failed */
  9229. A_UINT32 msdu_pool_alloc_fail;
  9230. /* Number of times the tid pool freed */
  9231. A_UINT32 tid_pool_free;
  9232. /* Number of times the MPDU pool freed */
  9233. A_UINT32 mpdu_pool_free;
  9234. /* Number of times the MSDU pool freed */
  9235. A_UINT32 msdu_pool_free;
  9236. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  9237. A_UINT32 msdu_queued;
  9238. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  9239. A_UINT32 msdu_recycled;
  9240. /* Number of MPDUs with invalid peer but A2 found in AST */
  9241. A_UINT32 invalid_peer_a2_in_ast;
  9242. /* Number of MPDUs with invalid peer but A3 found in AST */
  9243. A_UINT32 invalid_peer_a3_in_ast;
  9244. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  9245. A_UINT32 invalid_peer_bmc_mpdus;
  9246. /* Number of MSDUs with err attention word */
  9247. A_UINT32 rxdesc_err_att;
  9248. /* Number of MSDUs with flag of peer_idx_invalid */
  9249. A_UINT32 rxdesc_err_peer_idx_inv;
  9250. /* Number of MSDUs with flag of peer_idx_timeout */
  9251. A_UINT32 rxdesc_err_peer_idx_to;
  9252. /* Number of MSDUs with flag of overflow */
  9253. A_UINT32 rxdesc_err_ov;
  9254. /* Number of MSDUs with flag of msdu_length_err */
  9255. A_UINT32 rxdesc_err_msdu_len;
  9256. /* Number of MSDUs with flag of mpdu_length_err */
  9257. A_UINT32 rxdesc_err_mpdu_len;
  9258. /* Number of MSDUs with flag of tkip_mic_err */
  9259. A_UINT32 rxdesc_err_tkip_mic;
  9260. /* Number of MSDUs with flag of decrypt_err */
  9261. A_UINT32 rxdesc_err_decrypt;
  9262. /* Number of MSDUs with flag of fcs_err */
  9263. A_UINT32 rxdesc_err_fcs;
  9264. /* Number of Unicast (bc_mc bit is not set in attention word)
  9265. * frames with invalid peer handler
  9266. */
  9267. A_UINT32 rxdesc_uc_msdus_inv_peer;
  9268. /* Number of unicast frame directly (direct bit is set in attention word)
  9269. * to DUT with invalid peer handler
  9270. */
  9271. A_UINT32 rxdesc_direct_msdus_inv_peer;
  9272. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  9273. * frames with invalid peer handler
  9274. */
  9275. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  9276. /* Number of MSDUs dropped due to no first MSDU flag */
  9277. A_UINT32 rxdesc_no_1st_msdu;
  9278. /* Number of MSDUs droped due to ring overflow */
  9279. A_UINT32 msdu_drop_ring_ov;
  9280. /* Number of MSDUs dropped due to FC mismatch */
  9281. A_UINT32 msdu_drop_fc_mismatch;
  9282. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  9283. A_UINT32 msdu_drop_mgmt_remote_ring;
  9284. /* Number of MSDUs dropped due to errors not reported in attention word */
  9285. A_UINT32 msdu_drop_misc;
  9286. /* Number of MSDUs go to offload before reorder */
  9287. A_UINT32 offload_msdu_wal;
  9288. /* Number of data frame dropped by offload after reorder */
  9289. A_UINT32 offload_msdu_reorder;
  9290. /* Number of MPDUs with sequence number in the past and within the BA window */
  9291. A_UINT32 dup_past_within_window;
  9292. /* Number of MPDUs with sequence number in the past and outside the BA window */
  9293. A_UINT32 dup_past_outside_window;
  9294. /* Number of MSDUs with decrypt/MIC error */
  9295. A_UINT32 rxdesc_err_decrypt_mic;
  9296. /* Number of data MSDUs received on both local and remote rings */
  9297. A_UINT32 data_msdus_on_both_rings;
  9298. /* MPDUs never filled */
  9299. A_UINT32 holes_not_filled;
  9300. };
  9301. /*
  9302. * Rx Remote buffer statistics
  9303. * NB: all the fields must be defined in 4 octets size.
  9304. */
  9305. struct rx_remote_buffer_mgmt_stats {
  9306. /* Total number of MSDUs reaped for Rx processing */
  9307. A_UINT32 remote_reaped;
  9308. /* MSDUs recycled within firmware */
  9309. A_UINT32 remote_recycled;
  9310. /* MSDUs stored by Data Rx */
  9311. A_UINT32 data_rx_msdus_stored;
  9312. /* Number of HTT indications from WAL Rx MSDU */
  9313. A_UINT32 wal_rx_ind;
  9314. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  9315. A_UINT32 wal_rx_ind_unconsumed;
  9316. /* Number of HTT indications from Data Rx MSDU */
  9317. A_UINT32 data_rx_ind;
  9318. /* Number of unconsumed HTT indications from Data Rx MSDU */
  9319. A_UINT32 data_rx_ind_unconsumed;
  9320. /* Number of HTT indications from ATHBUF */
  9321. A_UINT32 athbuf_rx_ind;
  9322. /* Number of remote buffers requested for refill */
  9323. A_UINT32 refill_buf_req;
  9324. /* Number of remote buffers filled by the host */
  9325. A_UINT32 refill_buf_rsp;
  9326. /* Number of times MAC hw_index = f/w write_index */
  9327. A_INT32 mac_no_bufs;
  9328. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  9329. A_INT32 fw_indices_equal;
  9330. /* Number of times f/w finds no buffers to post */
  9331. A_INT32 host_no_bufs;
  9332. };
  9333. /*
  9334. * TXBF MU/SU packets and NDPA statistics
  9335. * NB: all the fields must be defined in 4 octets size.
  9336. */
  9337. struct rx_txbf_musu_ndpa_pkts_stats {
  9338. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  9339. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  9340. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  9341. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  9342. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  9343. A_UINT32 reserved[3]; /* must be set to 0x0 */
  9344. };
  9345. /*
  9346. * htt_dbg_stats_status -
  9347. * present - The requested stats have been delivered in full.
  9348. * This indicates that either the stats information was contained
  9349. * in its entirety within this message, or else this message
  9350. * completes the delivery of the requested stats info that was
  9351. * partially delivered through earlier STATS_CONF messages.
  9352. * partial - The requested stats have been delivered in part.
  9353. * One or more subsequent STATS_CONF messages with the same
  9354. * cookie value will be sent to deliver the remainder of the
  9355. * information.
  9356. * error - The requested stats could not be delivered, for example due
  9357. * to a shortage of memory to construct a message holding the
  9358. * requested stats.
  9359. * invalid - The requested stat type is either not recognized, or the
  9360. * target is configured to not gather the stats type in question.
  9361. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  9362. * series_done - This special value indicates that no further stats info
  9363. * elements are present within a series of stats info elems
  9364. * (within a stats upload confirmation message).
  9365. */
  9366. enum htt_dbg_stats_status {
  9367. HTT_DBG_STATS_STATUS_PRESENT = 0,
  9368. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  9369. HTT_DBG_STATS_STATUS_ERROR = 2,
  9370. HTT_DBG_STATS_STATUS_INVALID = 3,
  9371. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  9372. };
  9373. /**
  9374. * @brief target -> host statistics upload
  9375. *
  9376. * @details
  9377. * The following field definitions describe the format of the HTT target
  9378. * to host stats upload confirmation message.
  9379. * The message contains a cookie echoed from the HTT host->target stats
  9380. * upload request, which identifies which request the confirmation is
  9381. * for, and a series of tag-length-value stats information elements.
  9382. * The tag-length header for each stats info element also includes a
  9383. * status field, to indicate whether the request for the stat type in
  9384. * question was fully met, partially met, unable to be met, or invalid
  9385. * (if the stat type in question is disabled in the target).
  9386. * A special value of all 1's in this status field is used to indicate
  9387. * the end of the series of stats info elements.
  9388. *
  9389. *
  9390. * |31 16|15 8|7 5|4 0|
  9391. * |------------------------------------------------------------|
  9392. * | reserved | msg type |
  9393. * |------------------------------------------------------------|
  9394. * | cookie LSBs |
  9395. * |------------------------------------------------------------|
  9396. * | cookie MSBs |
  9397. * |------------------------------------------------------------|
  9398. * | stats entry length | reserved | S |stat type|
  9399. * |------------------------------------------------------------|
  9400. * | |
  9401. * | type-specific stats info |
  9402. * | |
  9403. * |------------------------------------------------------------|
  9404. * | stats entry length | reserved | S |stat type|
  9405. * |------------------------------------------------------------|
  9406. * | |
  9407. * | type-specific stats info |
  9408. * | |
  9409. * |------------------------------------------------------------|
  9410. * | n/a | reserved | 111 | n/a |
  9411. * |------------------------------------------------------------|
  9412. * Header fields:
  9413. * - MSG_TYPE
  9414. * Bits 7:0
  9415. * Purpose: identifies this is a statistics upload confirmation message
  9416. * Value: 0x9
  9417. * - COOKIE_LSBS
  9418. * Bits 31:0
  9419. * Purpose: Provide a mechanism to match a target->host stats confirmation
  9420. * message with its preceding host->target stats request message.
  9421. * Value: LSBs of the opaque cookie specified by the host-side requestor
  9422. * - COOKIE_MSBS
  9423. * Bits 31:0
  9424. * Purpose: Provide a mechanism to match a target->host stats confirmation
  9425. * message with its preceding host->target stats request message.
  9426. * Value: MSBs of the opaque cookie specified by the host-side requestor
  9427. *
  9428. * Stats Information Element tag-length header fields:
  9429. * - STAT_TYPE
  9430. * Bits 4:0
  9431. * Purpose: identifies the type of statistics info held in the
  9432. * following information element
  9433. * Value: htt_dbg_stats_type
  9434. * - STATUS
  9435. * Bits 7:5
  9436. * Purpose: indicate whether the requested stats are present
  9437. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  9438. * the completion of the stats entry series
  9439. * - LENGTH
  9440. * Bits 31:16
  9441. * Purpose: indicate the stats information size
  9442. * Value: This field specifies the number of bytes of stats information
  9443. * that follows the element tag-length header.
  9444. * It is expected but not required that this length is a multiple of
  9445. * 4 bytes. Even if the length is not an integer multiple of 4, the
  9446. * subsequent stats entry header will begin on a 4-byte aligned
  9447. * boundary.
  9448. */
  9449. #define HTT_T2H_STATS_COOKIE_SIZE 8
  9450. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  9451. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  9452. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  9453. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  9454. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  9455. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  9456. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  9457. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  9458. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  9459. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  9460. do { \
  9461. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  9462. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  9463. } while (0)
  9464. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  9465. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  9466. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  9467. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  9468. do { \
  9469. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  9470. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  9471. } while (0)
  9472. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  9473. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  9474. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  9475. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  9476. do { \
  9477. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  9478. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  9479. } while (0)
  9480. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  9481. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  9482. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  9483. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  9484. #define HTT_MAX_AGGR 64
  9485. #define HTT_HL_MAX_AGGR 18
  9486. /**
  9487. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  9488. *
  9489. * @details
  9490. * The following field definitions describe the format of the HTT host
  9491. * to target frag_desc/msdu_ext bank configuration message.
  9492. * The message contains the based address and the min and max id of the
  9493. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  9494. * MSDU_EXT/FRAG_DESC.
  9495. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  9496. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  9497. * the hardware does the mapping/translation.
  9498. *
  9499. * Total banks that can be configured is configured to 16.
  9500. *
  9501. * This should be called before any TX has be initiated by the HTT
  9502. *
  9503. * |31 16|15 8|7 5|4 0|
  9504. * |------------------------------------------------------------|
  9505. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  9506. * |------------------------------------------------------------|
  9507. * | BANK0_BASE_ADDRESS (bits 31:0) |
  9508. #if HTT_PADDR64
  9509. * | BANK0_BASE_ADDRESS (bits 63:32) |
  9510. #endif
  9511. * |------------------------------------------------------------|
  9512. * | ... |
  9513. * |------------------------------------------------------------|
  9514. * | BANK15_BASE_ADDRESS (bits 31:0) |
  9515. #if HTT_PADDR64
  9516. * | BANK15_BASE_ADDRESS (bits 63:32) |
  9517. #endif
  9518. * |------------------------------------------------------------|
  9519. * | BANK0_MAX_ID | BANK0_MIN_ID |
  9520. * |------------------------------------------------------------|
  9521. * | ... |
  9522. * |------------------------------------------------------------|
  9523. * | BANK15_MAX_ID | BANK15_MIN_ID |
  9524. * |------------------------------------------------------------|
  9525. * Header fields:
  9526. * - MSG_TYPE
  9527. * Bits 7:0
  9528. * Value: 0x6
  9529. * for systems with 64-bit format for bus addresses:
  9530. * - BANKx_BASE_ADDRESS_LO
  9531. * Bits 31:0
  9532. * Purpose: Provide a mechanism to specify the base address of the
  9533. * MSDU_EXT bank physical/bus address.
  9534. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  9535. * - BANKx_BASE_ADDRESS_HI
  9536. * Bits 31:0
  9537. * Purpose: Provide a mechanism to specify the base address of the
  9538. * MSDU_EXT bank physical/bus address.
  9539. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  9540. * for systems with 32-bit format for bus addresses:
  9541. * - BANKx_BASE_ADDRESS
  9542. * Bits 31:0
  9543. * Purpose: Provide a mechanism to specify the base address of the
  9544. * MSDU_EXT bank physical/bus address.
  9545. * Value: MSDU_EXT bank physical / bus address
  9546. * - BANKx_MIN_ID
  9547. * Bits 15:0
  9548. * Purpose: Provide a mechanism to specify the min index that needs to
  9549. * mapped.
  9550. * - BANKx_MAX_ID
  9551. * Bits 31:16
  9552. * Purpose: Provide a mechanism to specify the max index that needs to
  9553. * mapped.
  9554. *
  9555. */
  9556. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  9557. * safe value.
  9558. * @note MAX supported banks is 16.
  9559. */
  9560. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  9561. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  9562. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  9563. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  9564. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  9565. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  9566. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  9567. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  9568. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  9569. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  9570. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  9571. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  9572. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  9573. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  9574. do { \
  9575. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  9576. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  9577. } while (0)
  9578. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  9579. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  9580. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  9581. do { \
  9582. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  9583. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  9584. } while (0)
  9585. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  9586. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  9587. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  9588. do { \
  9589. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  9590. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  9591. } while (0)
  9592. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  9593. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  9594. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  9595. do { \
  9596. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  9597. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  9598. } while (0)
  9599. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  9600. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  9601. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  9602. do { \
  9603. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  9604. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  9605. } while (0)
  9606. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  9607. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  9608. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  9609. do { \
  9610. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  9611. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  9612. } while (0)
  9613. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  9614. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  9615. /*
  9616. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  9617. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  9618. * addresses are stored in a XXX-bit field.
  9619. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  9620. * htt_tx_frag_desc64_bank_cfg_t structs.
  9621. */
  9622. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  9623. _paddr_bits_, \
  9624. _paddr__bank_base_address_) \
  9625. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  9626. /** word 0 \
  9627. * msg_type: 8, \
  9628. * pdev_id: 2, \
  9629. * swap: 1, \
  9630. * reserved0: 5, \
  9631. * num_banks: 8, \
  9632. * desc_size: 8; \
  9633. */ \
  9634. A_UINT32 word0; \
  9635. /* \
  9636. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  9637. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  9638. * the second A_UINT32). \
  9639. */ \
  9640. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  9641. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  9642. } POSTPACK
  9643. /* define htt_tx_frag_desc32_bank_cfg_t */
  9644. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  9645. /* define htt_tx_frag_desc64_bank_cfg_t */
  9646. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  9647. /*
  9648. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  9649. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  9650. */
  9651. #if HTT_PADDR64
  9652. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  9653. #else
  9654. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  9655. #endif
  9656. /**
  9657. * @brief target -> host HTT TX Credit total count update message definition
  9658. *
  9659. *|31 16|15|14 9| 8 |7 0 |
  9660. *|---------------------+--+----------+-------+----------|
  9661. *|cur htt credit delta | Q| reserved | sign | msg type |
  9662. *|------------------------------------------------------|
  9663. *
  9664. * Header fields:
  9665. * - MSG_TYPE
  9666. * Bits 7:0
  9667. * Purpose: identifies this as a htt tx credit delta update message
  9668. * Value: 0xe
  9669. * - SIGN
  9670. * Bits 8
  9671. * identifies whether credit delta is positive or negative
  9672. * Value:
  9673. * - 0x0: credit delta is positive, rebalance in some buffers
  9674. * - 0x1: credit delta is negative, rebalance out some buffers
  9675. * - reserved
  9676. * Bits 14:9
  9677. * Value: 0x0
  9678. * - TXQ_GRP
  9679. * Bit 15
  9680. * Purpose: indicates whether any tx queue group information elements
  9681. * are appended to the tx credit update message
  9682. * Value: 0 -> no tx queue group information element is present
  9683. * 1 -> a tx queue group information element immediately follows
  9684. * - DELTA_COUNT
  9685. * Bits 31:16
  9686. * Purpose: Specify current htt credit delta absolute count
  9687. */
  9688. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  9689. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  9690. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  9691. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  9692. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  9693. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  9694. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  9695. do { \
  9696. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  9697. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  9698. } while (0)
  9699. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  9700. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  9701. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  9702. do { \
  9703. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  9704. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  9705. } while (0)
  9706. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  9707. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  9708. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  9709. do { \
  9710. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  9711. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  9712. } while (0)
  9713. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  9714. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  9715. #define HTT_TX_CREDIT_MSG_BYTES 4
  9716. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  9717. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  9718. /**
  9719. * @brief HTT WDI_IPA Operation Response Message
  9720. *
  9721. * @details
  9722. * HTT WDI_IPA Operation Response message is sent by target
  9723. * to host confirming suspend or resume operation.
  9724. * |31 24|23 16|15 8|7 0|
  9725. * |----------------+----------------+----------------+----------------|
  9726. * | op_code | Rsvd | msg_type |
  9727. * |-------------------------------------------------------------------|
  9728. * | Rsvd | Response len |
  9729. * |-------------------------------------------------------------------|
  9730. * | |
  9731. * | Response-type specific info |
  9732. * | |
  9733. * | |
  9734. * |-------------------------------------------------------------------|
  9735. * Header fields:
  9736. * - MSG_TYPE
  9737. * Bits 7:0
  9738. * Purpose: Identifies this as WDI_IPA Operation Response message
  9739. * value: = 0x13
  9740. * - OP_CODE
  9741. * Bits 31:16
  9742. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  9743. * value: = enum htt_wdi_ipa_op_code
  9744. * - RSP_LEN
  9745. * Bits 16:0
  9746. * Purpose: length for the response-type specific info
  9747. * value: = length in bytes for response-type specific info
  9748. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  9749. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  9750. */
  9751. PREPACK struct htt_wdi_ipa_op_response_t
  9752. {
  9753. /* DWORD 0: flags and meta-data */
  9754. A_UINT32
  9755. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  9756. reserved1: 8,
  9757. op_code: 16;
  9758. A_UINT32
  9759. rsp_len: 16,
  9760. reserved2: 16;
  9761. } POSTPACK;
  9762. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  9763. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  9764. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  9765. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  9766. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  9767. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  9768. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  9769. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  9770. do { \
  9771. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  9772. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  9773. } while (0)
  9774. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  9775. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  9776. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  9777. do { \
  9778. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  9779. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  9780. } while (0)
  9781. enum htt_phy_mode {
  9782. htt_phy_mode_11a = 0,
  9783. htt_phy_mode_11g = 1,
  9784. htt_phy_mode_11b = 2,
  9785. htt_phy_mode_11g_only = 3,
  9786. htt_phy_mode_11na_ht20 = 4,
  9787. htt_phy_mode_11ng_ht20 = 5,
  9788. htt_phy_mode_11na_ht40 = 6,
  9789. htt_phy_mode_11ng_ht40 = 7,
  9790. htt_phy_mode_11ac_vht20 = 8,
  9791. htt_phy_mode_11ac_vht40 = 9,
  9792. htt_phy_mode_11ac_vht80 = 10,
  9793. htt_phy_mode_11ac_vht20_2g = 11,
  9794. htt_phy_mode_11ac_vht40_2g = 12,
  9795. htt_phy_mode_11ac_vht80_2g = 13,
  9796. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  9797. htt_phy_mode_11ac_vht160 = 15,
  9798. htt_phy_mode_max,
  9799. };
  9800. /**
  9801. * @brief target -> host HTT channel change indication
  9802. * @details
  9803. * Specify when a channel change occurs.
  9804. * This allows the host to precisely determine which rx frames arrived
  9805. * on the old channel and which rx frames arrived on the new channel.
  9806. *
  9807. *|31 |7 0 |
  9808. *|-------------------------------------------+----------|
  9809. *| reserved | msg type |
  9810. *|------------------------------------------------------|
  9811. *| primary_chan_center_freq_mhz |
  9812. *|------------------------------------------------------|
  9813. *| contiguous_chan1_center_freq_mhz |
  9814. *|------------------------------------------------------|
  9815. *| contiguous_chan2_center_freq_mhz |
  9816. *|------------------------------------------------------|
  9817. *| phy_mode |
  9818. *|------------------------------------------------------|
  9819. *
  9820. * Header fields:
  9821. * - MSG_TYPE
  9822. * Bits 7:0
  9823. * Purpose: identifies this as a htt channel change indication message
  9824. * Value: 0x15
  9825. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  9826. * Bits 31:0
  9827. * Purpose: identify the (center of the) new 20 MHz primary channel
  9828. * Value: center frequency of the 20 MHz primary channel, in MHz units
  9829. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  9830. * Bits 31:0
  9831. * Purpose: identify the (center of the) contiguous frequency range
  9832. * comprising the new channel.
  9833. * For example, if the new channel is a 80 MHz channel extending
  9834. * 60 MHz beyond the primary channel, this field would be 30 larger
  9835. * than the primary channel center frequency field.
  9836. * Value: center frequency of the contiguous frequency range comprising
  9837. * the full channel in MHz units
  9838. * (80+80 channels also use the CONTIG_CHAN2 field)
  9839. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  9840. * Bits 31:0
  9841. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  9842. * within a VHT 80+80 channel.
  9843. * This field is only relevant for VHT 80+80 channels.
  9844. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  9845. * channel (arbitrary value for cases besides VHT 80+80)
  9846. * - PHY_MODE
  9847. * Bits 31:0
  9848. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  9849. * and band
  9850. * Value: htt_phy_mode enum value
  9851. */
  9852. PREPACK struct htt_chan_change_t
  9853. {
  9854. /* DWORD 0: flags and meta-data */
  9855. A_UINT32
  9856. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  9857. reserved1: 24;
  9858. A_UINT32 primary_chan_center_freq_mhz;
  9859. A_UINT32 contig_chan1_center_freq_mhz;
  9860. A_UINT32 contig_chan2_center_freq_mhz;
  9861. A_UINT32 phy_mode;
  9862. } POSTPACK;
  9863. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  9864. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  9865. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  9866. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  9867. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  9868. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  9869. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  9870. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  9871. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  9872. do { \
  9873. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  9874. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  9875. } while (0)
  9876. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  9877. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  9878. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  9879. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  9880. do { \
  9881. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  9882. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  9883. } while (0)
  9884. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  9885. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  9886. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  9887. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  9888. do { \
  9889. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  9890. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  9891. } while (0)
  9892. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  9893. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  9894. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  9895. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  9896. do { \
  9897. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  9898. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  9899. } while (0)
  9900. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  9901. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  9902. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  9903. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  9904. /**
  9905. * @brief rx offload packet error message
  9906. *
  9907. * @details
  9908. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  9909. * of target payload like mic err.
  9910. *
  9911. * |31 24|23 16|15 8|7 0|
  9912. * |----------------+----------------+----------------+----------------|
  9913. * | tid | vdev_id | msg_sub_type | msg_type |
  9914. * |-------------------------------------------------------------------|
  9915. * : (sub-type dependent content) :
  9916. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  9917. * Header fields:
  9918. * - msg_type
  9919. * Bits 7:0
  9920. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  9921. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  9922. * - msg_sub_type
  9923. * Bits 15:8
  9924. * Purpose: Identifies which type of rx error is reported by this message
  9925. * value: htt_rx_ofld_pkt_err_type
  9926. * - vdev_id
  9927. * Bits 23:16
  9928. * Purpose: Identifies which vdev received the erroneous rx frame
  9929. * value:
  9930. * - tid
  9931. * Bits 31:24
  9932. * Purpose: Identifies the traffic type of the rx frame
  9933. * value:
  9934. *
  9935. * - The payload fields used if the sub-type == MIC error are shown below.
  9936. * Note - MIC err is per MSDU, while PN is per MPDU.
  9937. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  9938. * with MIC err in A-MSDU case, so FW will send only one HTT message
  9939. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  9940. * instead of sending separate HTT messages for each wrong MSDU within
  9941. * the MPDU.
  9942. *
  9943. * |31 24|23 16|15 8|7 0|
  9944. * |----------------+----------------+----------------+----------------|
  9945. * | Rsvd | key_id | peer_id |
  9946. * |-------------------------------------------------------------------|
  9947. * | receiver MAC addr 31:0 |
  9948. * |-------------------------------------------------------------------|
  9949. * | Rsvd | receiver MAC addr 47:32 |
  9950. * |-------------------------------------------------------------------|
  9951. * | transmitter MAC addr 31:0 |
  9952. * |-------------------------------------------------------------------|
  9953. * | Rsvd | transmitter MAC addr 47:32 |
  9954. * |-------------------------------------------------------------------|
  9955. * | PN 31:0 |
  9956. * |-------------------------------------------------------------------|
  9957. * | Rsvd | PN 47:32 |
  9958. * |-------------------------------------------------------------------|
  9959. * - peer_id
  9960. * Bits 15:0
  9961. * Purpose: identifies which peer is frame is from
  9962. * value:
  9963. * - key_id
  9964. * Bits 23:16
  9965. * Purpose: identifies key_id of rx frame
  9966. * value:
  9967. * - RA_31_0 (receiver MAC addr 31:0)
  9968. * Bits 31:0
  9969. * Purpose: identifies by MAC address which vdev received the frame
  9970. * value: MAC address lower 4 bytes
  9971. * - RA_47_32 (receiver MAC addr 47:32)
  9972. * Bits 15:0
  9973. * Purpose: identifies by MAC address which vdev received the frame
  9974. * value: MAC address upper 2 bytes
  9975. * - TA_31_0 (transmitter MAC addr 31:0)
  9976. * Bits 31:0
  9977. * Purpose: identifies by MAC address which peer transmitted the frame
  9978. * value: MAC address lower 4 bytes
  9979. * - TA_47_32 (transmitter MAC addr 47:32)
  9980. * Bits 15:0
  9981. * Purpose: identifies by MAC address which peer transmitted the frame
  9982. * value: MAC address upper 2 bytes
  9983. * - PN_31_0
  9984. * Bits 31:0
  9985. * Purpose: Identifies pn of rx frame
  9986. * value: PN lower 4 bytes
  9987. * - PN_47_32
  9988. * Bits 15:0
  9989. * Purpose: Identifies pn of rx frame
  9990. * value:
  9991. * TKIP or CCMP: PN upper 2 bytes
  9992. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  9993. */
  9994. enum htt_rx_ofld_pkt_err_type {
  9995. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  9996. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  9997. };
  9998. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  9999. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  10000. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  10001. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  10002. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  10003. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  10004. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  10005. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  10006. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  10007. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  10008. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  10009. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  10010. do { \
  10011. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  10012. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  10013. } while (0)
  10014. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  10015. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  10016. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  10017. do { \
  10018. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  10019. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  10020. } while (0)
  10021. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  10022. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  10023. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  10024. do { \
  10025. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  10026. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  10027. } while (0)
  10028. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  10029. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  10030. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  10031. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  10032. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  10033. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  10034. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  10035. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  10036. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  10037. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  10038. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  10039. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  10040. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  10041. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  10042. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  10043. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  10044. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  10045. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  10046. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  10047. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  10048. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  10049. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  10050. do { \
  10051. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  10052. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  10053. } while (0)
  10054. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  10055. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  10056. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  10057. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  10058. do { \
  10059. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  10060. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  10061. } while (0)
  10062. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  10063. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  10064. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  10065. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  10066. do { \
  10067. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  10068. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  10069. } while (0)
  10070. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  10071. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  10072. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  10073. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  10074. do { \
  10075. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  10076. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  10077. } while (0)
  10078. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  10079. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  10080. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  10081. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  10082. do { \
  10083. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  10084. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  10085. } while (0)
  10086. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  10087. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  10088. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  10089. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  10090. do { \
  10091. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  10092. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  10093. } while (0)
  10094. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  10095. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  10096. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  10097. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  10098. do { \
  10099. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  10100. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  10101. } while (0)
  10102. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  10103. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  10104. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  10105. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  10106. do { \
  10107. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  10108. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  10109. } while (0)
  10110. /**
  10111. * @brief peer rate report message
  10112. *
  10113. * @details
  10114. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  10115. * justified rate of all the peers.
  10116. *
  10117. * |31 24|23 16|15 8|7 0|
  10118. * |----------------+----------------+----------------+----------------|
  10119. * | peer_count | | msg_type |
  10120. * |-------------------------------------------------------------------|
  10121. * : Payload (variant number of peer rate report) :
  10122. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  10123. * Header fields:
  10124. * - msg_type
  10125. * Bits 7:0
  10126. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  10127. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  10128. * - reserved
  10129. * Bits 15:8
  10130. * Purpose:
  10131. * value:
  10132. * - peer_count
  10133. * Bits 31:16
  10134. * Purpose: Specify how many peer rate report elements are present in the payload.
  10135. * value:
  10136. *
  10137. * Payload:
  10138. * There are variant number of peer rate report follow the first 32 bits.
  10139. * The peer rate report is defined as follows.
  10140. *
  10141. * |31 20|19 16|15 0|
  10142. * |-----------------------+---------+---------------------------------|-
  10143. * | reserved | phy | peer_id | \
  10144. * |-------------------------------------------------------------------| -> report #0
  10145. * | rate | /
  10146. * |-----------------------+---------+---------------------------------|-
  10147. * | reserved | phy | peer_id | \
  10148. * |-------------------------------------------------------------------| -> report #1
  10149. * | rate | /
  10150. * |-----------------------+---------+---------------------------------|-
  10151. * | reserved | phy | peer_id | \
  10152. * |-------------------------------------------------------------------| -> report #2
  10153. * | rate | /
  10154. * |-------------------------------------------------------------------|-
  10155. * : :
  10156. * : :
  10157. * : :
  10158. * :-------------------------------------------------------------------:
  10159. *
  10160. * - peer_id
  10161. * Bits 15:0
  10162. * Purpose: identify the peer
  10163. * value:
  10164. * - phy
  10165. * Bits 19:16
  10166. * Purpose: identify which phy is in use
  10167. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  10168. * Please see enum htt_peer_report_phy_type for detail.
  10169. * - reserved
  10170. * Bits 31:20
  10171. * Purpose:
  10172. * value:
  10173. * - rate
  10174. * Bits 31:0
  10175. * Purpose: represent the justified rate of the peer specified by peer_id
  10176. * value:
  10177. */
  10178. enum htt_peer_rate_report_phy_type {
  10179. HTT_PEER_RATE_REPORT_11B = 0,
  10180. HTT_PEER_RATE_REPORT_11A_G,
  10181. HTT_PEER_RATE_REPORT_11N,
  10182. HTT_PEER_RATE_REPORT_11AC,
  10183. };
  10184. #define HTT_PEER_RATE_REPORT_SIZE 8
  10185. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  10186. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  10187. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  10188. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  10189. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  10190. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  10191. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  10192. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  10193. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  10194. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  10195. do { \
  10196. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  10197. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  10198. } while (0)
  10199. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  10200. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  10201. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  10202. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  10203. do { \
  10204. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  10205. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  10206. } while (0)
  10207. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  10208. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  10209. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  10210. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  10211. do { \
  10212. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  10213. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  10214. } while (0)
  10215. /**
  10216. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_MAP Message
  10217. *
  10218. * @details
  10219. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  10220. * a flow of descriptors.
  10221. *
  10222. * This message is in TLV format and indicates the parameters to be setup a
  10223. * flow in the host. Each entry indicates that a particular flow ID is ready to
  10224. * receive descriptors from a specified pool.
  10225. *
  10226. * The message would appear as follows:
  10227. *
  10228. * |31 24|23 16|15 8|7 0|
  10229. * |----------------+----------------+----------------+----------------|
  10230. * header | reserved | num_flows | msg_type |
  10231. * |-------------------------------------------------------------------|
  10232. * | |
  10233. * : payload :
  10234. * | |
  10235. * |-------------------------------------------------------------------|
  10236. *
  10237. * The header field is one DWORD long and is interpreted as follows:
  10238. * b'0:7 - msg_type: This will be set to HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  10239. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  10240. * this message
  10241. * b'16-31 - reserved: These bits are reserved for future use
  10242. *
  10243. * Payload:
  10244. * The payload would contain multiple objects of the following structure. Each
  10245. * object represents a flow.
  10246. *
  10247. * |31 24|23 16|15 8|7 0|
  10248. * |----------------+----------------+----------------+----------------|
  10249. * header | reserved | num_flows | msg_type |
  10250. * |-------------------------------------------------------------------|
  10251. * payload0| flow_type |
  10252. * |-------------------------------------------------------------------|
  10253. * | flow_id |
  10254. * |-------------------------------------------------------------------|
  10255. * | reserved0 | flow_pool_id |
  10256. * |-------------------------------------------------------------------|
  10257. * | reserved1 | flow_pool_size |
  10258. * |-------------------------------------------------------------------|
  10259. * | reserved2 |
  10260. * |-------------------------------------------------------------------|
  10261. * payload1| flow_type |
  10262. * |-------------------------------------------------------------------|
  10263. * | flow_id |
  10264. * |-------------------------------------------------------------------|
  10265. * | reserved0 | flow_pool_id |
  10266. * |-------------------------------------------------------------------|
  10267. * | reserved1 | flow_pool_size |
  10268. * |-------------------------------------------------------------------|
  10269. * | reserved2 |
  10270. * |-------------------------------------------------------------------|
  10271. * | . |
  10272. * | . |
  10273. * | . |
  10274. * |-------------------------------------------------------------------|
  10275. *
  10276. * Each payload is 5 DWORDS long and is interpreted as follows:
  10277. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  10278. * this flow is associated. It can be VDEV, peer,
  10279. * or tid (AC). Based on enum htt_flow_type.
  10280. *
  10281. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  10282. * object. For flow_type vdev it is set to the
  10283. * vdevid, for peer it is peerid and for tid, it is
  10284. * tid_num.
  10285. *
  10286. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  10287. * in the host for this flow
  10288. * b'16:31 - reserved0: This field in reserved for the future. In case
  10289. * we have a hierarchical implementation (HCM) of
  10290. * pools, it can be used to indicate the ID of the
  10291. * parent-pool.
  10292. *
  10293. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  10294. * Descriptors for this flow will be
  10295. * allocated from this pool in the host.
  10296. * b'16:31 - reserved1: This field in reserved for the future. In case
  10297. * we have a hierarchical implementation of pools,
  10298. * it can be used to indicate the max number of
  10299. * descriptors in the pool. The b'0:15 can be used
  10300. * to indicate min number of descriptors in the
  10301. * HCM scheme.
  10302. *
  10303. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  10304. * we have a hierarchical implementation of pools,
  10305. * b'0:15 can be used to indicate the
  10306. * priority-based borrowing (PBB) threshold of
  10307. * the flow's pool. The b'16:31 are still left
  10308. * reserved.
  10309. */
  10310. enum htt_flow_type {
  10311. FLOW_TYPE_VDEV = 0,
  10312. /* Insert new flow types above this line */
  10313. };
  10314. PREPACK struct htt_flow_pool_map_payload_t {
  10315. A_UINT32 flow_type;
  10316. A_UINT32 flow_id;
  10317. A_UINT32 flow_pool_id:16,
  10318. reserved0:16;
  10319. A_UINT32 flow_pool_size:16,
  10320. reserved1:16;
  10321. A_UINT32 reserved2;
  10322. } POSTPACK;
  10323. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  10324. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  10325. (sizeof(struct htt_flow_pool_map_payload_t))
  10326. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  10327. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  10328. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  10329. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  10330. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  10331. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  10332. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  10333. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  10334. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  10335. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  10336. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  10337. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  10338. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  10339. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  10340. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  10341. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  10342. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  10343. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  10344. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  10345. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  10346. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  10347. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  10348. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  10349. do { \
  10350. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  10351. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  10352. } while (0)
  10353. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  10354. do { \
  10355. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  10356. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  10357. } while (0)
  10358. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  10359. do { \
  10360. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  10361. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  10362. } while (0)
  10363. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  10364. do { \
  10365. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  10366. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  10367. } while (0)
  10368. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  10369. do { \
  10370. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  10371. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  10372. } while (0)
  10373. /**
  10374. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP Message
  10375. *
  10376. * @details
  10377. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  10378. * down a flow of descriptors.
  10379. * This message indicates that for the flow (whose ID is provided) is wanting
  10380. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  10381. * pool of descriptors from where descriptors are being allocated for this
  10382. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  10383. * be unmapped by the host.
  10384. *
  10385. * The message would appear as follows:
  10386. *
  10387. * |31 24|23 16|15 8|7 0|
  10388. * |----------------+----------------+----------------+----------------|
  10389. * | reserved0 | msg_type |
  10390. * |-------------------------------------------------------------------|
  10391. * | flow_type |
  10392. * |-------------------------------------------------------------------|
  10393. * | flow_id |
  10394. * |-------------------------------------------------------------------|
  10395. * | reserved1 | flow_pool_id |
  10396. * |-------------------------------------------------------------------|
  10397. *
  10398. * The message is interpreted as follows:
  10399. * dword0 - b'0:7 - msg_type: This will be set to
  10400. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  10401. * b'8:31 - reserved0: Reserved for future use
  10402. *
  10403. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  10404. * this flow is associated. It can be VDEV, peer,
  10405. * or tid (AC). Based on enum htt_flow_type.
  10406. *
  10407. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  10408. * object. For flow_type vdev it is set to the
  10409. * vdevid, for peer it is peerid and for tid, it is
  10410. * tid_num.
  10411. *
  10412. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  10413. * used in the host for this flow
  10414. * b'16:31 - reserved0: This field in reserved for the future.
  10415. *
  10416. */
  10417. PREPACK struct htt_flow_pool_unmap_t {
  10418. A_UINT32 msg_type:8,
  10419. reserved0:24;
  10420. A_UINT32 flow_type;
  10421. A_UINT32 flow_id;
  10422. A_UINT32 flow_pool_id:16,
  10423. reserved1:16;
  10424. } POSTPACK;
  10425. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  10426. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  10427. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  10428. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  10429. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  10430. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  10431. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  10432. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  10433. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  10434. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  10435. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  10436. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  10437. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  10438. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  10439. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  10440. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  10441. do { \
  10442. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  10443. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  10444. } while (0)
  10445. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  10446. do { \
  10447. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  10448. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  10449. } while (0)
  10450. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  10451. do { \
  10452. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  10453. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  10454. } while (0)
  10455. /**
  10456. * @brief HTT_T2H_MSG_TYPE_SRING_SETUP_DONE Message
  10457. *
  10458. * @details
  10459. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  10460. * SRNG ring setup is done
  10461. *
  10462. * This message indicates whether the last setup operation is successful.
  10463. * It will be sent to host when host set respose_required bit in
  10464. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  10465. * The message would appear as follows:
  10466. *
  10467. * |31 24|23 16|15 8|7 0|
  10468. * |--------------- +----------------+----------------+----------------|
  10469. * | setup_status | ring_id | pdev_id | msg_type |
  10470. * |-------------------------------------------------------------------|
  10471. *
  10472. * The message is interpreted as follows:
  10473. * dword0 - b'0:7 - msg_type: This will be set to
  10474. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  10475. * b'8:15 - pdev_id:
  10476. * 0 (for rings at SOC/UMAC level),
  10477. * 1/2/3 mac id (for rings at LMAC level)
  10478. * b'16:23 - ring_id: Identify the ring which is set up
  10479. * More details can be got from enum htt_srng_ring_id
  10480. * b'24:31 - setup_status: Indicate status of setup operation
  10481. * Refer to htt_ring_setup_status
  10482. */
  10483. PREPACK struct htt_sring_setup_done_t {
  10484. A_UINT32 msg_type: 8,
  10485. pdev_id: 8,
  10486. ring_id: 8,
  10487. setup_status: 8;
  10488. } POSTPACK;
  10489. enum htt_ring_setup_status {
  10490. htt_ring_setup_status_ok = 0,
  10491. htt_ring_setup_status_error,
  10492. };
  10493. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  10494. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  10495. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  10496. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  10497. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  10498. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  10499. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  10500. do { \
  10501. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  10502. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  10503. } while (0)
  10504. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  10505. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  10506. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  10507. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  10508. HTT_SRING_SETUP_DONE_RING_ID_S)
  10509. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  10510. do { \
  10511. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  10512. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  10513. } while (0)
  10514. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  10515. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  10516. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  10517. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  10518. HTT_SRING_SETUP_DONE_STATUS_S)
  10519. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  10520. do { \
  10521. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  10522. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  10523. } while (0)
  10524. /**
  10525. * @brief HTT_T2H_MSG_TYPE_MAP_FLOW_INFO Message
  10526. *
  10527. * @details
  10528. * HTT TX map flow entry with tqm flow pointer
  10529. * Sent from firmware to host to add tqm flow pointer in corresponding
  10530. * flow search entry. Flow metadata is replayed back to host as part of this
  10531. * struct to enable host to find the specific flow search entry
  10532. *
  10533. * The message would appear as follows:
  10534. *
  10535. * |31 28|27 18|17 14|13 8|7 0|
  10536. * |-------+------------------------------------------+----------------|
  10537. * | rsvd0 | fse_hsh_idx | msg_type |
  10538. * |-------------------------------------------------------------------|
  10539. * | rsvd1 | tid | peer_id |
  10540. * |-------------------------------------------------------------------|
  10541. * | tqm_flow_pntr_lo |
  10542. * |-------------------------------------------------------------------|
  10543. * | tqm_flow_pntr_hi |
  10544. * |-------------------------------------------------------------------|
  10545. * | fse_meta_data |
  10546. * |-------------------------------------------------------------------|
  10547. *
  10548. * The message is interpreted as follows:
  10549. *
  10550. * dword0 - b'0:7 - msg_type: This will be set to
  10551. * HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  10552. *
  10553. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  10554. * for this flow entry
  10555. *
  10556. * dword0 - b'28:31 - rsvd0: Reserved for future use
  10557. *
  10558. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  10559. *
  10560. * dword1 - b'14:17 - tid
  10561. *
  10562. * dword1 - b'18:31 - rsvd1: Reserved for future use
  10563. *
  10564. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  10565. *
  10566. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  10567. *
  10568. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  10569. * given by host
  10570. */
  10571. PREPACK struct htt_tx_map_flow_info {
  10572. A_UINT32
  10573. msg_type: 8,
  10574. fse_hsh_idx: 20,
  10575. rsvd0: 4;
  10576. A_UINT32
  10577. peer_id: 14,
  10578. tid: 4,
  10579. rsvd1: 14;
  10580. A_UINT32 tqm_flow_pntr_lo;
  10581. A_UINT32 tqm_flow_pntr_hi;
  10582. struct htt_tx_flow_metadata fse_meta_data;
  10583. } POSTPACK;
  10584. /* DWORD 0 */
  10585. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  10586. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  10587. /* DWORD 1 */
  10588. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  10589. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  10590. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  10591. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  10592. /* DWORD 0 */
  10593. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  10594. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  10595. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  10596. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  10597. do { \
  10598. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  10599. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  10600. } while (0)
  10601. /* DWORD 1 */
  10602. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  10603. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  10604. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  10605. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  10606. do { \
  10607. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  10608. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  10609. } while (0)
  10610. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  10611. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  10612. HTT_TX_MAP_FLOW_INFO_TID_S)
  10613. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  10614. do { \
  10615. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  10616. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  10617. } while (0)
  10618. /*
  10619. * htt_dbg_ext_stats_status -
  10620. * present - The requested stats have been delivered in full.
  10621. * This indicates that either the stats information was contained
  10622. * in its entirety within this message, or else this message
  10623. * completes the delivery of the requested stats info that was
  10624. * partially delivered through earlier STATS_CONF messages.
  10625. * partial - The requested stats have been delivered in part.
  10626. * One or more subsequent STATS_CONF messages with the same
  10627. * cookie value will be sent to deliver the remainder of the
  10628. * information.
  10629. * error - The requested stats could not be delivered, for example due
  10630. * to a shortage of memory to construct a message holding the
  10631. * requested stats.
  10632. * invalid - The requested stat type is either not recognized, or the
  10633. * target is configured to not gather the stats type in question.
  10634. */
  10635. enum htt_dbg_ext_stats_status {
  10636. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  10637. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  10638. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  10639. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  10640. };
  10641. /**
  10642. * @brief target -> host ppdu stats upload
  10643. *
  10644. * @details
  10645. * The following field definitions describe the format of the HTT target
  10646. * to host ppdu stats indication message.
  10647. *
  10648. *
  10649. * |31 16|15 12|11 10|9 8|7 0 |
  10650. * |----------------------------------------------------------------------|
  10651. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  10652. * |----------------------------------------------------------------------|
  10653. * | ppdu_id |
  10654. * |----------------------------------------------------------------------|
  10655. * | Timestamp in us |
  10656. * |----------------------------------------------------------------------|
  10657. * | reserved |
  10658. * |----------------------------------------------------------------------|
  10659. * | type-specific stats info |
  10660. * | (see htt_ppdu_stats.h) |
  10661. * |----------------------------------------------------------------------|
  10662. * Header fields:
  10663. * - MSG_TYPE
  10664. * Bits 7:0
  10665. * Purpose: Identifies this is a PPDU STATS indication
  10666. * message.
  10667. * Value: 0x1d
  10668. * - mac_id
  10669. * Bits 9:8
  10670. * Purpose: mac_id of this ppdu_id
  10671. * Value: 0-3
  10672. * - pdev_id
  10673. * Bits 11:10
  10674. * Purpose: pdev_id of this ppdu_id
  10675. * Value: 0-3
  10676. * 0 (for rings at SOC level),
  10677. * 1/2/3 PDEV -> 0/1/2
  10678. * - payload_size
  10679. * Bits 31:16
  10680. * Purpose: total tlv size
  10681. * Value: payload_size in bytes
  10682. */
  10683. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  10684. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  10685. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  10686. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  10687. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  10688. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  10689. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  10690. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  10691. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  10692. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  10693. do { \
  10694. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  10695. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  10696. } while (0)
  10697. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  10698. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  10699. HTT_T2H_PPDU_STATS_MAC_ID_S)
  10700. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  10701. do { \
  10702. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  10703. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  10704. } while (0)
  10705. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  10706. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  10707. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  10708. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  10709. do { \
  10710. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  10711. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  10712. } while (0)
  10713. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  10714. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  10715. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  10716. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  10717. do { \
  10718. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  10719. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  10720. } while (0)
  10721. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  10722. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  10723. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  10724. /* htt_t2h_ppdu_stats_ind_hdr_t
  10725. * This struct contains the fields within the header of the
  10726. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  10727. * stats info.
  10728. * This struct assumes little-endian layout, and thus is only
  10729. * suitable for use within processors known to be little-endian
  10730. * (such as the target).
  10731. * In contrast, the above macros provide endian-portable methods
  10732. * to get and set the bitfields within this PPDU_STATS_IND header.
  10733. */
  10734. typedef struct {
  10735. A_UINT32 msg_type: 8, /* bits 7:0 */
  10736. mac_id: 2, /* bits 9:8 */
  10737. pdev_id: 2, /* bits 11:10 */
  10738. reserved1: 4, /* bits 15:12 */
  10739. payload_size: 16; /* bits 31:16 */
  10740. A_UINT32 ppdu_id;
  10741. A_UINT32 timestamp_us;
  10742. A_UINT32 reserved2;
  10743. } htt_t2h_ppdu_stats_ind_hdr_t;
  10744. /**
  10745. * @brief target -> host extended statistics upload
  10746. *
  10747. * @details
  10748. * The following field definitions describe the format of the HTT target
  10749. * to host stats upload confirmation message.
  10750. * The message contains a cookie echoed from the HTT host->target stats
  10751. * upload request, which identifies which request the confirmation is
  10752. * for, and a single stats can span over multiple HTT stats indication
  10753. * due to the HTT message size limitation so every HTT ext stats indication
  10754. * will have tag-length-value stats information elements.
  10755. * The tag-length header for each HTT stats IND message also includes a
  10756. * status field, to indicate whether the request for the stat type in
  10757. * question was fully met, partially met, unable to be met, or invalid
  10758. * (if the stat type in question is disabled in the target).
  10759. * A Done bit 1's indicate the end of the of stats info elements.
  10760. *
  10761. *
  10762. * |31 16|15 12|11|10 8|7 5|4 0|
  10763. * |--------------------------------------------------------------|
  10764. * | reserved | msg type |
  10765. * |--------------------------------------------------------------|
  10766. * | cookie LSBs |
  10767. * |--------------------------------------------------------------|
  10768. * | cookie MSBs |
  10769. * |--------------------------------------------------------------|
  10770. * | stats entry length | rsvd | D| S | stat type |
  10771. * |--------------------------------------------------------------|
  10772. * | type-specific stats info |
  10773. * | (see htt_stats.h) |
  10774. * |--------------------------------------------------------------|
  10775. * Header fields:
  10776. * - MSG_TYPE
  10777. * Bits 7:0
  10778. * Purpose: Identifies this is a extended statistics upload confirmation
  10779. * message.
  10780. * Value: 0x1c
  10781. * - COOKIE_LSBS
  10782. * Bits 31:0
  10783. * Purpose: Provide a mechanism to match a target->host stats confirmation
  10784. * message with its preceding host->target stats request message.
  10785. * Value: LSBs of the opaque cookie specified by the host-side requestor
  10786. * - COOKIE_MSBS
  10787. * Bits 31:0
  10788. * Purpose: Provide a mechanism to match a target->host stats confirmation
  10789. * message with its preceding host->target stats request message.
  10790. * Value: MSBs of the opaque cookie specified by the host-side requestor
  10791. *
  10792. * Stats Information Element tag-length header fields:
  10793. * - STAT_TYPE
  10794. * Bits 7:0
  10795. * Purpose: identifies the type of statistics info held in the
  10796. * following information element
  10797. * Value: htt_dbg_ext_stats_type
  10798. * - STATUS
  10799. * Bits 10:8
  10800. * Purpose: indicate whether the requested stats are present
  10801. * Value: htt_dbg_ext_stats_status
  10802. * - DONE
  10803. * Bits 11
  10804. * Purpose:
  10805. * Indicates the completion of the stats entry, this will be the last
  10806. * stats conf HTT segment for the requested stats type.
  10807. * Value:
  10808. * 0 -> the stats retrieval is ongoing
  10809. * 1 -> the stats retrieval is complete
  10810. * - LENGTH
  10811. * Bits 31:16
  10812. * Purpose: indicate the stats information size
  10813. * Value: This field specifies the number of bytes of stats information
  10814. * that follows the element tag-length header.
  10815. * It is expected but not required that this length is a multiple of
  10816. * 4 bytes.
  10817. */
  10818. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  10819. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  10820. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  10821. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  10822. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  10823. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  10824. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  10825. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  10826. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  10827. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  10828. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  10829. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  10830. do { \
  10831. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  10832. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  10833. } while (0)
  10834. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  10835. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  10836. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  10837. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  10838. do { \
  10839. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  10840. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  10841. } while (0)
  10842. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  10843. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  10844. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  10845. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  10846. do { \
  10847. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  10848. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  10849. } while (0)
  10850. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  10851. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  10852. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  10853. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  10854. do { \
  10855. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  10856. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  10857. } while (0)
  10858. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  10859. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  10860. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  10861. typedef enum {
  10862. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  10863. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  10864. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  10865. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  10866. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  10867. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  10868. /* Reserved from 128 - 255 for target internal use.*/
  10869. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  10870. } HTT_PEER_TYPE;
  10871. /** 2 word representation of MAC addr */
  10872. typedef struct {
  10873. /** upper 4 bytes of MAC address */
  10874. A_UINT32 mac_addr31to0;
  10875. /** lower 2 bytes of MAC address */
  10876. A_UINT32 mac_addr47to32;
  10877. } htt_mac_addr;
  10878. /** macro to convert MAC address from char array to HTT word format */
  10879. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  10880. (phtt_mac_addr)->mac_addr31to0 = \
  10881. (((c_macaddr)[0] << 0) | \
  10882. ((c_macaddr)[1] << 8) | \
  10883. ((c_macaddr)[2] << 16) | \
  10884. ((c_macaddr)[3] << 24)); \
  10885. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  10886. } while (0)
  10887. /**
  10888. * @brief target -> host monitor mac header indication message
  10889. *
  10890. * @details
  10891. * The following diagram shows the format of the monitor mac header message
  10892. * sent from the target to the host.
  10893. * This message is primarily sent when promiscuous rx mode is enabled.
  10894. * One message is sent per rx PPDU.
  10895. *
  10896. * |31 24|23 16|15 8|7 0|
  10897. * |-------------------------------------------------------------|
  10898. * | peer_id | reserved0 | msg_type |
  10899. * |-------------------------------------------------------------|
  10900. * | reserved1 | num_mpdu |
  10901. * |-------------------------------------------------------------|
  10902. * | struct hw_rx_desc |
  10903. * | (see wal_rx_desc.h) |
  10904. * |-------------------------------------------------------------|
  10905. * | struct ieee80211_frame_addr4 |
  10906. * | (see ieee80211_defs.h) |
  10907. * |-------------------------------------------------------------|
  10908. * | struct ieee80211_frame_addr4 |
  10909. * | (see ieee80211_defs.h) |
  10910. * |-------------------------------------------------------------|
  10911. * | ...... |
  10912. * |-------------------------------------------------------------|
  10913. *
  10914. * Header fields:
  10915. * - msg_type
  10916. * Bits 7:0
  10917. * Purpose: Identifies this is a monitor mac header indication message.
  10918. * Value: 0x20
  10919. * - peer_id
  10920. * Bits 31:16
  10921. * Purpose: Software peer id given by host during association,
  10922. * During promiscuous mode, the peer ID will be invalid (0xFF)
  10923. * for rx PPDUs received from unassociated peers.
  10924. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  10925. * - num_mpdu
  10926. * Bits 15:0
  10927. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  10928. * delivered within the message.
  10929. * Value: 1 to 32
  10930. * num_mpdu is limited to a maximum value of 32, due to buffer
  10931. * size limits. For PPDUs with more than 32 MPDUs, only the
  10932. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  10933. * the PPDU will be provided.
  10934. */
  10935. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  10936. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  10937. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  10938. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  10939. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  10940. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  10941. do { \
  10942. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  10943. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  10944. } while (0)
  10945. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  10946. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  10947. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  10948. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  10949. do { \
  10950. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  10951. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  10952. } while (0)
  10953. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  10954. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  10955. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  10956. /**
  10957. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE Message
  10958. *
  10959. * @details
  10960. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  10961. * the flow pool associated with the specified ID is resized
  10962. *
  10963. * The message would appear as follows:
  10964. *
  10965. * |31 16|15 8|7 0|
  10966. * |---------------------------------+----------------+----------------|
  10967. * | reserved0 | Msg type |
  10968. * |-------------------------------------------------------------------|
  10969. * | flow pool new size | flow pool ID |
  10970. * |-------------------------------------------------------------------|
  10971. *
  10972. * The message is interpreted as follows:
  10973. * b'0:7 - msg_type: This will be set to
  10974. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  10975. *
  10976. * b'0:15 - flow pool ID: Existing flow pool ID
  10977. *
  10978. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  10979. *
  10980. */
  10981. PREPACK struct htt_flow_pool_resize_t {
  10982. A_UINT32 msg_type:8,
  10983. reserved0:24;
  10984. A_UINT32 flow_pool_id:16,
  10985. flow_pool_new_size:16;
  10986. } POSTPACK;
  10987. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  10988. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  10989. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  10990. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  10991. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  10992. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  10993. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  10994. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  10995. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  10996. do { \
  10997. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  10998. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  10999. } while (0)
  11000. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  11001. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  11002. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  11003. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  11004. do { \
  11005. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  11006. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  11007. } while (0)
  11008. /**
  11009. * @brief host -> target channel change message
  11010. *
  11011. * @details
  11012. * the meesage is generated by FW every time FW changes channel. This will be used by host mainly
  11013. * to associate RX frames to correct channel they were received on.
  11014. * The following field definitions describe the format of the HTT target
  11015. * to host channel change message.
  11016. * |31 16|15 8|7 5|4 0|
  11017. * |------------------------------------------------------------|
  11018. * | reserved | MSG_TYPE |
  11019. * |------------------------------------------------------------|
  11020. * | CHAN_MHZ |
  11021. * |------------------------------------------------------------|
  11022. * | BAND_CENTER_FREQ1 |
  11023. * |------------------------------------------------------------|
  11024. * | BAND_CENTER_FREQ2 |
  11025. * |------------------------------------------------------------|
  11026. * | CHAN_PHY_MODE |
  11027. * |------------------------------------------------------------|
  11028. * Header fields:
  11029. * - MSG_TYPE
  11030. * Bits 7:0
  11031. * Value: 0xf
  11032. * - CHAN_MHZ
  11033. * Bits 31:0
  11034. * Purpose: frequency of the primary 20mhz channel.
  11035. * - BAND_CENTER_FREQ1
  11036. * Bits 31:0
  11037. * Purpose: centre frequency of the full channel.
  11038. * - BAND_CENTER_FREQ2
  11039. * Bits 31:0
  11040. * Purpose: centre frequency2 of the channel. is only valid for 11acvht 80plus80.
  11041. * - CHAN_PHY_MODE
  11042. * Bits 31:0
  11043. * Purpose: phy mode of the channel.
  11044. */
  11045. PREPACK struct htt_chan_change_msg {
  11046. A_UINT32 chan_mhz; /* frequency in mhz */
  11047. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz*/
  11048. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  11049. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  11050. } POSTPACK;
  11051. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  11052. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  11053. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  11054. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  11055. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  11056. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  11057. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  11058. /*
  11059. * The read and write indices point to the data within the host buffer.
  11060. * Because the first 4 bytes of the host buffer is used for the read index and
  11061. * the next 4 bytes for the write index, the data itself starts at offset 8.
  11062. * The read index and write index are the byte offsets from the base of the
  11063. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  11064. * Refer the ASCII text picture below.
  11065. */
  11066. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  11067. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  11068. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  11069. /*
  11070. ***************************************************************************
  11071. *
  11072. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  11073. *
  11074. ***************************************************************************
  11075. *
  11076. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  11077. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  11078. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  11079. * written into the Host memory region mentioned below.
  11080. *
  11081. * Read index is updated by the Host. At any point of time, the read index will
  11082. * indicate the index that will next be read by the Host. The read index is
  11083. * in units of bytes offset from the base of the meta-data buffer.
  11084. *
  11085. * Write index is updated by the FW. At any point of time, the write index will
  11086. * indicate from where the FW can start writing any new data. The write index is
  11087. * in units of bytes offset from the base of the meta-data buffer.
  11088. *
  11089. * If the Host is not fast enough in reading the CFR data, any new capture data
  11090. * would be dropped if there is no space left to write the new captures.
  11091. *
  11092. * The last 4 bytes of the memory region will have the magic pattern
  11093. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  11094. * not overrun the host buffer.
  11095. *
  11096. * ,--------------------. read and write indices store the
  11097. * | | byte offset from the base of the
  11098. * | ,--------+--------. meta-data buffer to the next
  11099. * | | | | location within the data buffer
  11100. * | | v v that will be read / written
  11101. * ************************************************************************
  11102. * * Read * Write * * Magic *
  11103. * * index * index * CFR data1 ...... CFR data N * pattern *
  11104. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  11105. * ************************************************************************
  11106. * |<---------- data buffer ---------->|
  11107. *
  11108. * |<----------------- meta-data buffer allocated in Host ----------------|
  11109. *
  11110. * Note:
  11111. * - Considering the 4 bytes needed to store the Read index (R) and the
  11112. * Write index (W), the initial value is as follows:
  11113. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  11114. * - Buffer empty condition:
  11115. * R = W
  11116. *
  11117. * Regarding CFR data format:
  11118. * --------------------------
  11119. *
  11120. * Each CFR tone is stored in HW as 16-bits with the following format:
  11121. * {bits[15:12], bits[11:6], bits[5:0]} =
  11122. * {unsigned exponent (4 bits),
  11123. * signed mantissa_real (6 bits),
  11124. * signed mantissa_imag (6 bits)}
  11125. *
  11126. * CFR_real = mantissa_real * 2^(exponent-5)
  11127. * CFR_imag = mantissa_imag * 2^(exponent-5)
  11128. *
  11129. *
  11130. * The CFR data is written to the 16-bit unsigned output array (buff) in
  11131. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  11132. *
  11133. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  11134. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  11135. * .
  11136. * .
  11137. * .
  11138. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  11139. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  11140. */
  11141. /* Bandwidth of peer CFR captures */
  11142. typedef enum {
  11143. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  11144. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  11145. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  11146. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  11147. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  11148. HTT_PEER_CFR_CAPTURE_BW_MAX,
  11149. } HTT_PEER_CFR_CAPTURE_BW;
  11150. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  11151. * was captured
  11152. */
  11153. typedef enum {
  11154. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  11155. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  11156. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  11157. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  11158. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  11159. } HTT_PEER_CFR_CAPTURE_MODE;
  11160. typedef enum {
  11161. /* This message type is currently used for the below purpose:
  11162. *
  11163. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  11164. * wmi_peer_cfr_capture_cmd.
  11165. * If payload_present bit is set to 0 then the associated memory region
  11166. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  11167. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  11168. * message; the CFR dump will be present at the end of the message,
  11169. * after the chan_phy_mode.
  11170. */
  11171. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  11172. /* Always keep this last */
  11173. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  11174. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  11175. /**
  11176. * @brief target -> host CFR dump completion indication message definition
  11177. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  11178. *
  11179. * @details
  11180. * The following diagram shows the format of the Channel Frequency Response
  11181. * (CFR) dump completion indication. This inidcation is sent to the Host when
  11182. * the channel capture of a peer is copied by Firmware into the Host memory
  11183. *
  11184. * **************************************************************************
  11185. *
  11186. * Message format when the CFR capture message type is
  11187. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  11188. *
  11189. * **************************************************************************
  11190. *
  11191. * |31 16|15 |8|7 0|
  11192. * |----------------------------------------------------------------|
  11193. * header: | reserved |P| msg_type |
  11194. * word 0 | | | |
  11195. * |----------------------------------------------------------------|
  11196. * payload: | cfr_capture_msg_type |
  11197. * word 1 | |
  11198. * |----------------------------------------------------------------|
  11199. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  11200. * word 2 | | | | | | | | |
  11201. * |----------------------------------------------------------------|
  11202. * | mac_addr31to0 |
  11203. * word 3 | |
  11204. * |----------------------------------------------------------------|
  11205. * | unused / reserved | mac_addr47to32 |
  11206. * word 4 | | |
  11207. * |----------------------------------------------------------------|
  11208. * | index |
  11209. * word 5 | |
  11210. * |----------------------------------------------------------------|
  11211. * | length |
  11212. * word 6 | |
  11213. * |----------------------------------------------------------------|
  11214. * | timestamp |
  11215. * word 7 | |
  11216. * |----------------------------------------------------------------|
  11217. * | counter |
  11218. * word 8 | |
  11219. * |----------------------------------------------------------------|
  11220. * | chan_mhz |
  11221. * word 9 | |
  11222. * |----------------------------------------------------------------|
  11223. * | band_center_freq1 |
  11224. * word 10 | |
  11225. * |----------------------------------------------------------------|
  11226. * | band_center_freq2 |
  11227. * word 11 | |
  11228. * |----------------------------------------------------------------|
  11229. * | chan_phy_mode |
  11230. * word 12 | |
  11231. * |----------------------------------------------------------------|
  11232. * where,
  11233. * P - payload present bit (payload_present explained below)
  11234. * req_id - memory request id (mem_req_id explained below)
  11235. * S - status field (status explained below)
  11236. * capbw - capture bandwidth (capture_bw explained below)
  11237. * mode - mode of capture (mode explained below)
  11238. * sts - space time streams (sts_count explained below)
  11239. * chbw - channel bandwidth (channel_bw explained below)
  11240. * captype - capture type (cap_type explained below)
  11241. *
  11242. * The following field definitions describe the format of the CFR dump
  11243. * completion indication sent from the target to the host
  11244. *
  11245. * Header fields:
  11246. *
  11247. * Word 0
  11248. * - msg_type
  11249. * Bits 7:0
  11250. * Purpose: Identifies this as CFR TX completion indication
  11251. * Value: HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  11252. * - payload_present
  11253. * Bit 8
  11254. * Purpose: Identifies how CFR data is sent to host
  11255. * Value: 0 - If CFR Payload is written to host memory
  11256. * 1 - If CFR Payload is sent as part of HTT message
  11257. * (This is the requirement for SDIO/USB where it is
  11258. * not possible to write CFR data to host memory)
  11259. * - reserved
  11260. * Bits 31:9
  11261. * Purpose: Reserved
  11262. * Value: 0
  11263. *
  11264. * Payload fields:
  11265. *
  11266. * Word 1
  11267. * - cfr_capture_msg_type
  11268. * Bits 31:0
  11269. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  11270. * to specify the format used for the remainder of the message
  11271. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  11272. * (currently only MSG_TYPE_1 is defined)
  11273. *
  11274. * Word 2
  11275. * - mem_req_id
  11276. * Bits 6:0
  11277. * Purpose: Contain the mem request id of the region where the CFR capture
  11278. * has been stored - of type WMI_HOST_MEM_REQ_ID
  11279. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  11280. this value is invalid)
  11281. * - status
  11282. * Bit 7
  11283. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  11284. * Value: 1 (True) - Successful; 0 (False) - Not successful
  11285. * - capture_bw
  11286. * Bits 10:8
  11287. * Purpose: Carry the bandwidth of the CFR capture
  11288. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  11289. * - mode
  11290. * Bits 13:11
  11291. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  11292. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  11293. * - sts_count
  11294. * Bits 16:14
  11295. * Purpose: Carry the number of space time streams
  11296. * Value: Number of space time streams
  11297. * - channel_bw
  11298. * Bits 19:17
  11299. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  11300. * measurement
  11301. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  11302. * - cap_type
  11303. * Bits 23:20
  11304. * Purpose: Carry the type of the capture
  11305. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  11306. * - vdev_id
  11307. * Bits 31:24
  11308. * Purpose: Carry the virtual device id
  11309. * Value: vdev ID
  11310. *
  11311. * Word 3
  11312. * - mac_addr31to0
  11313. * Bits 31:0
  11314. * Purpose: Contain the bits 31:0 of the peer MAC address
  11315. * Value: Bits 31:0 of the peer MAC address
  11316. *
  11317. * Word 4
  11318. * - mac_addr47to32
  11319. * Bits 15:0
  11320. * Purpose: Contain the bits 47:32 of the peer MAC address
  11321. * Value: Bits 47:32 of the peer MAC address
  11322. *
  11323. * Word 5
  11324. * - index
  11325. * Bits 31:0
  11326. * Purpose: Contain the index at which this CFR dump was written in the Host
  11327. * allocated memory. This index is the number of bytes from the base address.
  11328. * Value: Index position
  11329. *
  11330. * Word 6
  11331. * - length
  11332. * Bits 31:0
  11333. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  11334. * Value: Length of the CFR capture of the peer
  11335. *
  11336. * Word 7
  11337. * - timestamp
  11338. * Bits 31:0
  11339. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  11340. * clock used for this timestamp is private to the target and not visible to
  11341. * the host i.e., Host can interpret only the relative timestamp deltas from
  11342. * one message to the next, but can't interpret the absolute timestamp from a
  11343. * single message.
  11344. * Value: Timestamp in microseconds
  11345. *
  11346. * Word 8
  11347. * - counter
  11348. * Bits 31:0
  11349. * Purpose: Carry the count of the current CFR capture from FW. This is
  11350. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  11351. * in host memory)
  11352. * Value: Count of the current CFR capture
  11353. *
  11354. * Word 9
  11355. * - chan_mhz
  11356. * Bits 31:0
  11357. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  11358. * Value: Primary 20 channel frequency
  11359. *
  11360. * Word 10
  11361. * - band_center_freq1
  11362. * Bits 31:0
  11363. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  11364. * Value: Center frequency 1 in MHz
  11365. *
  11366. * Word 11
  11367. * - band_center_freq2
  11368. * Bits 31:0
  11369. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  11370. * the VDEV
  11371. * 80plus80 mode
  11372. * Value: Center frequency 2 in MHz
  11373. *
  11374. * Word 12
  11375. * - chan_phy_mode
  11376. * Bits 31:0
  11377. * Purpose: Carry the phy mode of the channel, of the VDEV
  11378. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  11379. */
  11380. PREPACK struct htt_cfr_dump_ind_type_1 {
  11381. A_UINT32 mem_req_id:7,
  11382. status:1,
  11383. capture_bw:3,
  11384. mode:3,
  11385. sts_count:3,
  11386. channel_bw:3,
  11387. cap_type:4,
  11388. vdev_id:8;
  11389. htt_mac_addr addr;
  11390. A_UINT32 index;
  11391. A_UINT32 length;
  11392. A_UINT32 timestamp;
  11393. A_UINT32 counter;
  11394. struct htt_chan_change_msg chan;
  11395. } POSTPACK;
  11396. PREPACK struct htt_cfr_dump_compl_ind {
  11397. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  11398. union {
  11399. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  11400. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  11401. /* If there is a need to change the memory layout and its associated
  11402. * HTT indication format, a new CFR capture message type can be
  11403. * introduced and added into this union.
  11404. */
  11405. };
  11406. } POSTPACK;
  11407. /*
  11408. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  11409. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  11410. */
  11411. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  11412. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  11413. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  11414. do { \
  11415. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  11416. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  11417. } while(0)
  11418. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  11419. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  11420. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  11421. /*
  11422. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  11423. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  11424. */
  11425. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  11426. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  11427. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  11428. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  11429. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  11430. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  11431. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  11432. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  11433. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  11434. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  11435. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  11436. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  11437. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  11438. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  11439. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  11440. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  11441. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  11442. do { \
  11443. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  11444. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  11445. } while (0)
  11446. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  11447. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  11448. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  11449. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  11450. do { \
  11451. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  11452. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  11453. } while (0)
  11454. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  11455. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  11456. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  11457. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  11458. do { \
  11459. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  11460. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  11461. } while (0)
  11462. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  11463. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  11464. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  11465. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  11466. do { \
  11467. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  11468. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  11469. } while (0)
  11470. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  11471. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  11472. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  11473. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  11474. do { \
  11475. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  11476. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  11477. } while (0)
  11478. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  11479. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  11480. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  11481. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  11482. do { \
  11483. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  11484. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  11485. } while (0)
  11486. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  11487. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  11488. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  11489. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  11490. do { \
  11491. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  11492. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  11493. } while (0)
  11494. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  11495. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  11496. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  11497. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  11498. do { \
  11499. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  11500. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  11501. } while (0)
  11502. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  11503. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  11504. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  11505. /**
  11506. * @brief target -> host peer (PPDU) stats message
  11507. * HTT_T2H_MSG_TYPE_PEER_STATS_IND
  11508. * @details
  11509. * This message is generated by FW when FW is sending stats to host
  11510. * about one or more PPDUs that the FW has transmitted to one or more peers.
  11511. * This message is sent autonomously by the target rather than upon request
  11512. * by the host.
  11513. * The following field definitions describe the format of the HTT target
  11514. * to host peer stats indication message.
  11515. *
  11516. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  11517. * or more PPDU stats records.
  11518. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  11519. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  11520. * then the message would start with the
  11521. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  11522. * below.
  11523. *
  11524. * |31 16|15|14|13 11|10 9|8|7 0|
  11525. * |-------------------------------------------------------------|
  11526. * | reserved |MSG_TYPE |
  11527. * |-------------------------------------------------------------|
  11528. * rec 0 | TLV header |
  11529. * rec 0 |-------------------------------------------------------------|
  11530. * rec 0 | ppdu successful bytes |
  11531. * rec 0 |-------------------------------------------------------------|
  11532. * rec 0 | ppdu retry bytes |
  11533. * rec 0 |-------------------------------------------------------------|
  11534. * rec 0 | ppdu failed bytes |
  11535. * rec 0 |-------------------------------------------------------------|
  11536. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  11537. * rec 0 |-------------------------------------------------------------|
  11538. * rec 0 | retried MSDUs | successful MSDUs |
  11539. * rec 0 |-------------------------------------------------------------|
  11540. * rec 0 | TX duration | failed MSDUs |
  11541. * rec 0 |-------------------------------------------------------------|
  11542. * ...
  11543. * |-------------------------------------------------------------|
  11544. * rec N | TLV header |
  11545. * rec N |-------------------------------------------------------------|
  11546. * rec N | ppdu successful bytes |
  11547. * rec N |-------------------------------------------------------------|
  11548. * rec N | ppdu retry bytes |
  11549. * rec N |-------------------------------------------------------------|
  11550. * rec N | ppdu failed bytes |
  11551. * rec N |-------------------------------------------------------------|
  11552. * rec N | peer id | S|SG| BW | BA |A|rate code|
  11553. * rec N |-------------------------------------------------------------|
  11554. * rec N | retried MSDUs | successful MSDUs |
  11555. * rec N |-------------------------------------------------------------|
  11556. * rec N | TX duration | failed MSDUs |
  11557. * rec N |-------------------------------------------------------------|
  11558. *
  11559. * where:
  11560. * A = is A-MPDU flag
  11561. * BA = block-ack failure flags
  11562. * BW = bandwidth spec
  11563. * SG = SGI enabled spec
  11564. * S = skipped rate ctrl
  11565. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  11566. *
  11567. * Header
  11568. * ------
  11569. * dword0 - b'0:7 - msg_type : HTT_T2H_MSG_TYPE_PEER_STATS_IND
  11570. * dword0 - b'8:31 - reserved : Reserved for future use
  11571. *
  11572. * payload include below peer_stats information
  11573. * --------------------------------------------
  11574. * @TLV : HTT_PPDU_STATS_INFO_TLV
  11575. * @tx_success_bytes : total successful bytes in the PPDU.
  11576. * @tx_retry_bytes : total retried bytes in the PPDU.
  11577. * @tx_failed_bytes : total failed bytes in the PPDU.
  11578. * @tx_ratecode : rate code used for the PPDU.
  11579. * @is_ampdu : Indicates PPDU is AMPDU or not.
  11580. * @ba_ack_failed : BA/ACK failed for this PPDU
  11581. * b00 -> BA received
  11582. * b01 -> BA failed once
  11583. * b10 -> BA failed twice, when HW retry is enabled.
  11584. * @bw : BW
  11585. * b00 -> 20 MHz
  11586. * b01 -> 40 MHz
  11587. * b10 -> 80 MHz
  11588. * b11 -> 160 MHz (or 80+80)
  11589. * @sg : SGI enabled
  11590. * @s : skipped ratectrl
  11591. * @peer_id : peer id
  11592. * @tx_success_msdus : successful MSDUs
  11593. * @tx_retry_msdus : retried MSDUs
  11594. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  11595. * @tx_duration : Tx duration for the PPDU (microsecond units)
  11596. */
  11597. /**
  11598. * @brief HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID Message
  11599. *
  11600. * @details
  11601. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  11602. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  11603. * This message will only be sent if the backpressure condition has existed
  11604. * continuously for an initial period (100 ms).
  11605. * Repeat messages with updated information will be sent after each
  11606. * subsequent period (100 ms) as long as the backpressure remains unabated.
  11607. * This message indicates the ring id along with current head and tail index
  11608. * locations (i.e. write and read indices).
  11609. * The backpressure time indicates the time in ms for which continous
  11610. * backpressure has been observed in the ring.
  11611. *
  11612. * The message format is as follows:
  11613. *
  11614. * |31 24|23 16|15 8|7 0|
  11615. * |----------------+----------------+----------------+----------------|
  11616. * | ring_id | ring_type | pdev_id | msg_type |
  11617. * |-------------------------------------------------------------------|
  11618. * | tail_idx | head_idx |
  11619. * |-------------------------------------------------------------------|
  11620. * | backpressure_time_ms |
  11621. * |-------------------------------------------------------------------|
  11622. *
  11623. * The message is interpreted as follows:
  11624. * dword0 - b'0:7 - msg_type: This will be set to
  11625. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  11626. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  11627. * 1, 2, 3 indicates pdev_id 0,1,2 and
  11628. the msg is for LMAC ring.
  11629. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  11630. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  11631. * htt_backpressure_lmac_ring_id. This represents
  11632. * the ring id for which continous backpressure is seen
  11633. *
  11634. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  11635. * the ring indicated by the ring_id
  11636. *
  11637. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  11638. * the ring indicated by the ring id
  11639. *
  11640. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  11641. * backpressure has been seen in the ring
  11642. * indicated by the ring_id.
  11643. * Units = milliseconds
  11644. */
  11645. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  11646. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  11647. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  11648. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  11649. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  11650. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  11651. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  11652. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  11653. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  11654. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  11655. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  11656. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  11657. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  11658. do { \
  11659. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  11660. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  11661. } while (0)
  11662. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  11663. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  11664. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  11665. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  11666. do { \
  11667. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  11668. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  11669. } while (0)
  11670. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  11671. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  11672. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  11673. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  11674. do { \
  11675. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  11676. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  11677. } while (0)
  11678. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  11679. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  11680. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  11681. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  11682. do { \
  11683. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  11684. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  11685. } while (0)
  11686. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  11687. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  11688. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  11689. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  11690. do { \
  11691. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  11692. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  11693. } while (0)
  11694. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  11695. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  11696. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  11697. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  11698. do { \
  11699. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  11700. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  11701. } while (0)
  11702. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  11703. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  11704. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  11705. enum htt_backpressure_ring_type {
  11706. HTT_SW_RING_TYPE_UMAC,
  11707. HTT_SW_RING_TYPE_LMAC,
  11708. HTT_SW_RING_TYPE_MAX,
  11709. };
  11710. /* Ring id for which the message is sent to host */
  11711. enum htt_backpressure_umac_ringid {
  11712. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  11713. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  11714. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  11715. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  11716. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  11717. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  11718. HTT_SW_RING_IDX_REO_REO2FW_RING,
  11719. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  11720. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  11721. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  11722. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  11723. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  11724. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  11725. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  11726. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  11727. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  11728. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  11729. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  11730. HTT_SW_UMAC_RING_IDX_MAX,
  11731. };
  11732. enum htt_backpressure_lmac_ringid {
  11733. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  11734. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  11735. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  11736. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  11737. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  11738. HTT_SW_RING_IDX_RXDMA2FW_RING,
  11739. HTT_SW_RING_IDX_RXDMA2SW_RING,
  11740. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  11741. HTT_SW_RING_IDX_RXDMA2REO_RING,
  11742. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  11743. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  11744. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  11745. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  11746. HTT_SW_LMAC_RING_IDX_MAX,
  11747. };
  11748. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  11749. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  11750. pdev_id: 8,
  11751. ring_type: 8, /* htt_backpressure_ring_type */
  11752. /*
  11753. * ring_id holds an enum value from either
  11754. * htt_backpressure_umac_ringid or
  11755. * htt_backpressure_lmac_ringid, based on
  11756. * the ring_type setting.
  11757. */
  11758. ring_id: 8;
  11759. A_UINT16 head_idx;
  11760. A_UINT16 tail_idx;
  11761. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  11762. } POSTPACK;
  11763. /*
  11764. * Defines two 32 bit words that can be used by the target to indicate a per
  11765. * user RU allocation and rate information.
  11766. *
  11767. * This information is currently provided in the "sw_response_reference_ptr"
  11768. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  11769. * "rx_ppdu_end_user_stats" TLV.
  11770. *
  11771. * VALID:
  11772. * The consumer of these words must explicitly check the valid bit,
  11773. * and only attempt interpretation of any of the remaining fields if
  11774. * the valid bit is set to 1.
  11775. *
  11776. * VERSION:
  11777. * The consumer of these words must also explicitly check the version bit,
  11778. * and only use the V0 definition if the VERSION field is set to 0.
  11779. *
  11780. * Version 1 is currently undefined, with the exception of the VALID and
  11781. * VERSION fields.
  11782. *
  11783. * Version 0:
  11784. *
  11785. * The fields below are duplicated per BW.
  11786. *
  11787. * The consumer must determine which BW field to use, based on the UL OFDMA
  11788. * PPDU BW indicated by HW.
  11789. *
  11790. * RU_START: RU26 start index for the user.
  11791. * Note that this is always using the RU26 index, regardless
  11792. * of the actual RU assigned to the user
  11793. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  11794. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  11795. *
  11796. * For example, 20MHz (the value in the top row is RU_START)
  11797. *
  11798. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  11799. * RU Size 1 (52): | | | | | |
  11800. * RU Size 2 (106): | | | |
  11801. * RU Size 3 (242): | |
  11802. *
  11803. * RU_SIZE: Indicates the RU size, as defined by enum
  11804. * htt_ul_ofdma_user_info_ru_size.
  11805. *
  11806. * LDPC: LDPC enabled (if 0, BCC is used)
  11807. *
  11808. * DCM: DCM enabled
  11809. *
  11810. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  11811. * |---------------------------------+--------------------------------|
  11812. * |Ver|Valid| FW internal |
  11813. * |---------------------------------+--------------------------------|
  11814. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  11815. * |---------------------------------+--------------------------------|
  11816. */
  11817. enum htt_ul_ofdma_user_info_ru_size {
  11818. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  11819. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  11820. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  11821. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  11822. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  11823. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  11824. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  11825. };
  11826. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  11827. struct htt_ul_ofdma_user_info_v0 {
  11828. A_UINT32 word0;
  11829. A_UINT32 word1;
  11830. };
  11831. /* htt_up_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  11832. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  11833. union {
  11834. A_UINT32 word0;
  11835. struct {
  11836. A_UINT32 w0_fw_rsvd:30;
  11837. A_UINT32 w0_valid:1;
  11838. A_UINT32 w0_version:1;
  11839. };
  11840. };
  11841. union {
  11842. A_UINT32 word1;
  11843. struct {
  11844. A_UINT32 w1_nss:3;
  11845. A_UINT32 w1_mcs:4;
  11846. A_UINT32 w1_ldpc:1;
  11847. A_UINT32 w1_dcm:1;
  11848. A_UINT32 w1_ru_start:7;
  11849. A_UINT32 w1_ru_size:3;
  11850. A_UINT32 w1_trig_type:4;
  11851. A_UINT32 w1_unused:9;
  11852. };
  11853. };
  11854. } POSTPACK;
  11855. enum HTT_UL_OFDMA_TRIG_TYPE {
  11856. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  11857. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  11858. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  11859. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  11860. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  11861. };
  11862. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  11863. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  11864. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  11865. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  11866. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  11867. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  11868. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  11869. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  11870. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  11871. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  11872. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  11873. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  11874. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  11875. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  11876. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  11877. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  11878. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  11879. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  11880. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  11881. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  11882. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  11883. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  11884. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  11885. /*--- word 0 ---*/
  11886. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  11887. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  11888. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  11889. do { \
  11890. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  11891. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  11892. } while (0)
  11893. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  11894. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  11895. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  11896. do { \
  11897. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  11898. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  11899. } while (0)
  11900. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  11901. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  11902. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  11903. do { \
  11904. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  11905. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  11906. } while (0)
  11907. /*--- word 1 ---*/
  11908. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  11909. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  11910. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  11911. do { \
  11912. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  11913. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  11914. } while (0)
  11915. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  11916. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  11917. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  11918. do { \
  11919. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  11920. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  11921. } while (0)
  11922. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  11923. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  11924. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  11925. do { \
  11926. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  11927. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  11928. } while (0)
  11929. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  11930. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  11931. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  11932. do { \
  11933. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  11934. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  11935. } while (0)
  11936. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  11937. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  11938. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  11939. do { \
  11940. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  11941. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  11942. } while (0)
  11943. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  11944. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  11945. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  11946. do { \
  11947. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  11948. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  11949. } while (0)
  11950. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  11951. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  11952. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  11953. do { \
  11954. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  11955. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  11956. } while (0)
  11957. #endif