htt.h 477 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543
  1. /*
  2. * Copyright (c) 2011-2018 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. */
  164. #define HTT_CURRENT_VERSION_MAJOR 3
  165. #define HTT_CURRENT_VERSION_MINOR 52
  166. #define HTT_NUM_TX_FRAG_DESC 1024
  167. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  168. #define HTT_CHECK_SET_VAL(field, val) \
  169. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  170. /* macros to assist in sign-extending fields from HTT messages */
  171. #define HTT_SIGN_BIT_MASK(field) \
  172. ((field ## _M + (1 << field ## _S)) >> 1)
  173. #define HTT_SIGN_BIT(_val, field) \
  174. (_val & HTT_SIGN_BIT_MASK(field))
  175. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  176. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  177. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  178. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  179. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  180. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  181. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  182. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  183. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  184. /*
  185. * TEMPORARY:
  186. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  187. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  188. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  189. * updated.
  190. */
  191. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  192. /*
  193. * TEMPORARY:
  194. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  195. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  196. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  197. * updated.
  198. */
  199. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  200. /* HTT Access Category values */
  201. enum HTT_AC_WMM {
  202. /* WMM Access Categories */
  203. HTT_AC_WMM_BE = 0x0,
  204. HTT_AC_WMM_BK = 0x1,
  205. HTT_AC_WMM_VI = 0x2,
  206. HTT_AC_WMM_VO = 0x3,
  207. /* extension Access Categories */
  208. HTT_AC_EXT_NON_QOS = 0x4,
  209. HTT_AC_EXT_UCAST_MGMT = 0x5,
  210. HTT_AC_EXT_MCAST_DATA = 0x6,
  211. HTT_AC_EXT_MCAST_MGMT = 0x7,
  212. };
  213. enum HTT_AC_WMM_MASK {
  214. /* WMM Access Categories */
  215. HTT_AC_WMM_BE_MASK = (1 << HTT_AC_WMM_BE),
  216. HTT_AC_WMM_BK_MASK = (1 << HTT_AC_WMM_BK),
  217. HTT_AC_WMM_VI_MASK = (1 << HTT_AC_WMM_VI),
  218. HTT_AC_WMM_VO_MASK = (1 << HTT_AC_WMM_VO),
  219. /* extension Access Categories */
  220. HTT_AC_EXT_NON_QOS_MASK = (1 << HTT_AC_EXT_NON_QOS),
  221. HTT_AC_EXT_UCAST_MGMT_MASK = (1 << HTT_AC_EXT_UCAST_MGMT),
  222. HTT_AC_EXT_MCAST_DATA_MASK = (1 << HTT_AC_EXT_MCAST_DATA),
  223. HTT_AC_EXT_MCAST_MGMT_MASK = (1 << HTT_AC_EXT_MCAST_MGMT),
  224. };
  225. #define HTT_AC_MASK_WMM \
  226. (HTT_AC_WMM_BE_MASK | HTT_AC_WMM_BK_MASK | \
  227. HTT_AC_WMM_VI_MASK | HTT_AC_WMM_VO_MASK)
  228. #define HTT_AC_MASK_EXT \
  229. (HTT_AC_EXT_NON_QOS_MASK | HTT_AC_EXT_UCAST_MGMT_MASK | \
  230. HTT_AC_EXT_MCAST_DATA_MASK | HTT_AC_EXT_MCAST_MGMT_MASK)
  231. #define HTT_AC_MASK_ALL (HTT_AC_MASK_WMM | HTT_AC_MASK_EXT)
  232. /*
  233. * htt_dbg_stats_type -
  234. * bit positions for each stats type within a stats type bitmask
  235. * The bitmask contains 24 bits.
  236. */
  237. enum htt_dbg_stats_type {
  238. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  239. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  240. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  241. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  242. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  243. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  244. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  245. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  246. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  247. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  248. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  249. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  250. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  251. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  252. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  253. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  254. /* bits 16-23 currently reserved */
  255. /* keep this last */
  256. HTT_DBG_NUM_STATS
  257. };
  258. /*=== HTT option selection TLVs ===
  259. * Certain HTT messages have alternatives or options.
  260. * For such cases, the host and target need to agree on which option to use.
  261. * Option specification TLVs can be appended to the VERSION_REQ and
  262. * VERSION_CONF messages to select options other than the default.
  263. * These TLVs are entirely optional - if they are not provided, there is a
  264. * well-defined default for each option. If they are provided, they can be
  265. * provided in any order. Each TLV can be present or absent independent of
  266. * the presence / absence of other TLVs.
  267. *
  268. * The HTT option selection TLVs use the following format:
  269. * |31 16|15 8|7 0|
  270. * |---------------------------------+----------------+----------------|
  271. * | value (payload) | length | tag |
  272. * |-------------------------------------------------------------------|
  273. * The value portion need not be only 2 bytes; it can be extended by any
  274. * integer number of 4-byte units. The total length of the TLV, including
  275. * the tag and length fields, must be a multiple of 4 bytes. The length
  276. * field specifies the total TLV size in 4-byte units. Thus, the typical
  277. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  278. * field, would store 0x1 in its length field, to show that the TLV occupies
  279. * a single 4-byte unit.
  280. */
  281. /*--- TLV header format - applies to all HTT option TLVs ---*/
  282. enum HTT_OPTION_TLV_TAGS {
  283. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  284. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  285. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  286. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  287. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  288. };
  289. PREPACK struct htt_option_tlv_header_t {
  290. A_UINT8 tag;
  291. A_UINT8 length;
  292. } POSTPACK;
  293. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  294. #define HTT_OPTION_TLV_TAG_S 0
  295. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  296. #define HTT_OPTION_TLV_LENGTH_S 8
  297. /*
  298. * value0 - 16 bit value field stored in word0
  299. * The TLV's value field may be longer than 2 bytes, in which case
  300. * the remainder of the value is stored in word1, word2, etc.
  301. */
  302. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  303. #define HTT_OPTION_TLV_VALUE0_S 16
  304. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  305. do { \
  306. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  307. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  308. } while (0)
  309. #define HTT_OPTION_TLV_TAG_GET(word) \
  310. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  311. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  312. do { \
  313. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  314. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  315. } while (0)
  316. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  317. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  318. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  319. do { \
  320. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  321. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  322. } while (0)
  323. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  324. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  325. /*--- format of specific HTT option TLVs ---*/
  326. /*
  327. * HTT option TLV for specifying LL bus address size
  328. * Some chips require bus addresses used by the target to access buffers
  329. * within the host's memory to be 32 bits; others require bus addresses
  330. * used by the target to access buffers within the host's memory to be
  331. * 64 bits.
  332. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  333. * a suffix to the VERSION_CONF message to specify which bus address format
  334. * the target requires.
  335. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  336. * default to providing bus addresses to the target in 32-bit format.
  337. */
  338. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  339. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  340. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  341. };
  342. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  343. struct htt_option_tlv_header_t hdr;
  344. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  345. } POSTPACK;
  346. /*
  347. * HTT option TLV for specifying whether HL systems should indicate
  348. * over-the-air tx completion for individual frames, or should instead
  349. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  350. * requests an OTA tx completion for a particular tx frame.
  351. * This option does not apply to LL systems, where the TX_COMPL_IND
  352. * is mandatory.
  353. * This option is primarily intended for HL systems in which the tx frame
  354. * downloads over the host --> target bus are as slow as or slower than
  355. * the transmissions over the WLAN PHY. For cases where the bus is faster
  356. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  357. * and consquently will send one TX_COMPL_IND message that covers several
  358. * tx frames. For cases where the WLAN PHY is faster than the bus,
  359. * the target will end up transmitting very short A-MPDUs, and consequently
  360. * sending many TX_COMPL_IND messages, which each cover a very small number
  361. * of tx frames.
  362. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  363. * a suffix to the VERSION_REQ message to request whether the host desires to
  364. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  365. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  366. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  367. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  368. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  369. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  370. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  371. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  372. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  373. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  374. * TLV.
  375. */
  376. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  377. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  378. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  379. };
  380. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  381. struct htt_option_tlv_header_t hdr;
  382. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  383. } POSTPACK;
  384. /*
  385. * HTT option TLV for specifying how many tx queue groups the target
  386. * may establish.
  387. * This TLV specifies the maximum value the target may send in the
  388. * txq_group_id field of any TXQ_GROUP information elements sent by
  389. * the target to the host. This allows the host to pre-allocate an
  390. * appropriate number of tx queue group structs.
  391. *
  392. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  393. * a suffix to the VERSION_REQ message to specify whether the host supports
  394. * tx queue groups at all, and if so if there is any limit on the number of
  395. * tx queue groups that the host supports.
  396. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  397. * a suffix to the VERSION_CONF message. If the host has specified in the
  398. * VER_REQ message a limit on the number of tx queue groups the host can
  399. * supprt, the target shall limit its specification of the maximum tx groups
  400. * to be no larger than this host-specified limit.
  401. *
  402. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  403. * shall preallocate 4 tx queue group structs, and the target shall not
  404. * specify a txq_group_id larger than 3.
  405. */
  406. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  407. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  408. /*
  409. * values 1 through N specify the max number of tx queue groups
  410. * the sender supports
  411. */
  412. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  413. };
  414. /* TEMPORARY backwards-compatibility alias for a typo fix -
  415. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  416. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  417. * to support the old name (with the typo) until all references to the
  418. * old name are replaced with the new name.
  419. */
  420. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  421. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  422. struct htt_option_tlv_header_t hdr;
  423. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  424. } POSTPACK;
  425. /*
  426. * HTT option TLV for specifying whether the target supports an extended
  427. * version of the HTT tx descriptor. If the target provides this TLV
  428. * and specifies in the TLV that the target supports an extended version
  429. * of the HTT tx descriptor, the target must check the "extension" bit in
  430. * the HTT tx descriptor, and if the extension bit is set, to expect a
  431. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  432. * descriptor. Furthermore, the target must provide room for the HTT
  433. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  434. * This option is intended for systems where the host needs to explicitly
  435. * control the transmission parameters such as tx power for individual
  436. * tx frames.
  437. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  438. * as a suffix to the VERSION_CONF message to explicitly specify whether
  439. * the target supports the HTT tx MSDU extension descriptor.
  440. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  441. * by the host as lack of target support for the HTT tx MSDU extension
  442. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  443. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  444. * the HTT tx MSDU extension descriptor.
  445. * The host is not required to provide the HTT tx MSDU extension descriptor
  446. * just because the target supports it; the target must check the
  447. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  448. * extension descriptor is present.
  449. */
  450. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  451. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  452. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  453. };
  454. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  455. struct htt_option_tlv_header_t hdr;
  456. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  457. } POSTPACK;
  458. /*=== host -> target messages ===============================================*/
  459. enum htt_h2t_msg_type {
  460. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  461. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  462. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  463. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  464. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  465. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  466. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  467. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  468. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  469. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  470. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  471. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  472. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  473. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  474. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  475. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  476. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  477. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  478. /* keep this last */
  479. HTT_H2T_NUM_MSGS
  480. };
  481. /*
  482. * HTT host to target message type -
  483. * stored in bits 7:0 of the first word of the message
  484. */
  485. #define HTT_H2T_MSG_TYPE_M 0xff
  486. #define HTT_H2T_MSG_TYPE_S 0
  487. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  488. do { \
  489. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  490. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  491. } while (0)
  492. #define HTT_H2T_MSG_TYPE_GET(word) \
  493. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  494. /**
  495. * @brief host -> target version number request message definition
  496. *
  497. * |31 24|23 16|15 8|7 0|
  498. * |----------------+----------------+----------------+----------------|
  499. * | reserved | msg type |
  500. * |-------------------------------------------------------------------|
  501. * : option request TLV (optional) |
  502. * :...................................................................:
  503. *
  504. * The VER_REQ message may consist of a single 4-byte word, or may be
  505. * extended with TLVs that specify which HTT options the host is requesting
  506. * from the target.
  507. * The following option TLVs may be appended to the VER_REQ message:
  508. * - HL_SUPPRESS_TX_COMPL_IND
  509. * - HL_MAX_TX_QUEUE_GROUPS
  510. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  511. * may be appended to the VER_REQ message (but only one TLV of each type).
  512. *
  513. * Header fields:
  514. * - MSG_TYPE
  515. * Bits 7:0
  516. * Purpose: identifies this as a version number request message
  517. * Value: 0x0
  518. */
  519. #define HTT_VER_REQ_BYTES 4
  520. /* TBDXXX: figure out a reasonable number */
  521. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  522. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  523. /**
  524. * @brief HTT tx MSDU descriptor
  525. *
  526. * @details
  527. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  528. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  529. * the target firmware needs for the FW's tx processing, particularly
  530. * for creating the HW msdu descriptor.
  531. * The same HTT tx descriptor is used for HL and LL systems, though
  532. * a few fields within the tx descriptor are used only by LL or
  533. * only by HL.
  534. * The HTT tx descriptor is defined in two manners: by a struct with
  535. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  536. * definitions.
  537. * The target should use the struct def, for simplicitly and clarity,
  538. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  539. * neutral. Specifically, the host shall use the get/set macros built
  540. * around the mask + shift defs.
  541. */
  542. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  543. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  544. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  545. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  546. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  547. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  548. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  549. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  550. #define HTT_TX_VDEV_ID_WORD 0
  551. #define HTT_TX_VDEV_ID_MASK 0x3f
  552. #define HTT_TX_VDEV_ID_SHIFT 16
  553. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  554. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  555. #define HTT_TX_MSDU_LEN_DWORD 1
  556. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  557. /*
  558. * HTT_VAR_PADDR macros
  559. * Allow physical / bus addresses to be either a single 32-bit value,
  560. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  561. */
  562. #define HTT_VAR_PADDR32(var_name) \
  563. A_UINT32 var_name
  564. #define HTT_VAR_PADDR64_LE(var_name) \
  565. struct { \
  566. /* little-endian: lo precedes hi */ \
  567. A_UINT32 lo; \
  568. A_UINT32 hi; \
  569. } var_name
  570. /*
  571. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  572. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  573. * addresses are stored in a XXX-bit field.
  574. * This macro is used to define both htt_tx_msdu_desc32_t and
  575. * htt_tx_msdu_desc64_t structs.
  576. */
  577. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  578. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  579. { \
  580. /* DWORD 0: flags and meta-data */ \
  581. A_UINT32 \
  582. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  583. \
  584. /* pkt_subtype - \
  585. * Detailed specification of the tx frame contents, extending the \
  586. * general specification provided by pkt_type. \
  587. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  588. * pkt_type | pkt_subtype \
  589. * ============================================================== \
  590. * 802.3 | bit 0:3 - Reserved \
  591. * | bit 4: 0x0 - Copy-Engine Classification Results \
  592. * | not appended to the HTT message \
  593. * | 0x1 - Copy-Engine Classification Results \
  594. * | appended to the HTT message in the \
  595. * | format: \
  596. * | [HTT tx desc, frame header, \
  597. * | CE classification results] \
  598. * | The CE classification results begin \
  599. * | at the next 4-byte boundary after \
  600. * | the frame header. \
  601. * ------------+------------------------------------------------- \
  602. * Eth2 | bit 0:3 - Reserved \
  603. * | bit 4: 0x0 - Copy-Engine Classification Results \
  604. * | not appended to the HTT message \
  605. * | 0x1 - Copy-Engine Classification Results \
  606. * | appended to the HTT message. \
  607. * | See the above specification of the \
  608. * | CE classification results location. \
  609. * ------------+------------------------------------------------- \
  610. * native WiFi | bit 0:3 - Reserved \
  611. * | bit 4: 0x0 - Copy-Engine Classification Results \
  612. * | not appended to the HTT message \
  613. * | 0x1 - Copy-Engine Classification Results \
  614. * | appended to the HTT message. \
  615. * | See the above specification of the \
  616. * | CE classification results location. \
  617. * ------------+------------------------------------------------- \
  618. * mgmt | 0x0 - 802.11 MAC header absent \
  619. * | 0x1 - 802.11 MAC header present \
  620. * ------------+------------------------------------------------- \
  621. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  622. * | 0x1 - 802.11 MAC header present \
  623. * | bit 1: 0x0 - allow aggregation \
  624. * | 0x1 - don't allow aggregation \
  625. * | bit 2: 0x0 - perform encryption \
  626. * | 0x1 - don't perform encryption \
  627. * | bit 3: 0x0 - perform tx classification / queuing \
  628. * | 0x1 - don't perform tx classification; \
  629. * | insert the frame into the "misc" \
  630. * | tx queue \
  631. * | bit 4: 0x0 - Copy-Engine Classification Results \
  632. * | not appended to the HTT message \
  633. * | 0x1 - Copy-Engine Classification Results \
  634. * | appended to the HTT message. \
  635. * | See the above specification of the \
  636. * | CE classification results location. \
  637. */ \
  638. pkt_subtype: 5, \
  639. \
  640. /* pkt_type - \
  641. * General specification of the tx frame contents. \
  642. * The htt_pkt_type enum should be used to specify and check the \
  643. * value of this field. \
  644. */ \
  645. pkt_type: 3, \
  646. \
  647. /* vdev_id - \
  648. * ID for the vdev that is sending this tx frame. \
  649. * For certain non-standard packet types, e.g. pkt_type == raw \
  650. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  651. * This field is used primarily for determining where to queue \
  652. * broadcast and multicast frames. \
  653. */ \
  654. vdev_id: 6, \
  655. /* ext_tid - \
  656. * The extended traffic ID. \
  657. * If the TID is unknown, the extended TID is set to \
  658. * HTT_TX_EXT_TID_INVALID. \
  659. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  660. * value of the QoS TID. \
  661. * If the tx frame is non-QoS data, then the extended TID is set to \
  662. * HTT_TX_EXT_TID_NON_QOS. \
  663. * If the tx frame is multicast or broadcast, then the extended TID \
  664. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  665. */ \
  666. ext_tid: 5, \
  667. \
  668. /* postponed - \
  669. * This flag indicates whether the tx frame has been downloaded to \
  670. * the target before but discarded by the target, and now is being \
  671. * downloaded again; or if this is a new frame that is being \
  672. * downloaded for the first time. \
  673. * This flag allows the target to determine the correct order for \
  674. * transmitting new vs. old frames. \
  675. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  676. * This flag only applies to HL systems, since in LL systems, \
  677. * the tx flow control is handled entirely within the target. \
  678. */ \
  679. postponed: 1, \
  680. \
  681. /* extension - \
  682. * This flag indicates whether a HTT tx MSDU extension descriptor \
  683. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  684. * \
  685. * 0x0 - no extension MSDU descriptor is present \
  686. * 0x1 - an extension MSDU descriptor immediately follows the \
  687. * regular MSDU descriptor \
  688. */ \
  689. extension: 1, \
  690. \
  691. /* cksum_offload - \
  692. * This flag indicates whether checksum offload is enabled or not \
  693. * for this frame. Target FW use this flag to turn on HW checksumming \
  694. * 0x0 - No checksum offload \
  695. * 0x1 - L3 header checksum only \
  696. * 0x2 - L4 checksum only \
  697. * 0x3 - L3 header checksum + L4 checksum \
  698. */ \
  699. cksum_offload: 2, \
  700. \
  701. /* tx_comp_req - \
  702. * This flag indicates whether Tx Completion \
  703. * from fw is required or not. \
  704. * This flag is only relevant if tx completion is not \
  705. * universally enabled. \
  706. * For all LL systems, tx completion is mandatory, \
  707. * so this flag will be irrelevant. \
  708. * For HL systems tx completion is optional, but HL systems in which \
  709. * the bus throughput exceeds the WLAN throughput will \
  710. * probably want to always use tx completion, and thus \
  711. * would not check this flag. \
  712. * This flag is required when tx completions are not used universally, \
  713. * but are still required for certain tx frames for which \
  714. * an OTA delivery acknowledgment is needed by the host. \
  715. * In practice, this would be for HL systems in which the \
  716. * bus throughput is less than the WLAN throughput. \
  717. * \
  718. * 0x0 - Tx Completion Indication from Fw not required \
  719. * 0x1 - Tx Completion Indication from Fw is required \
  720. */ \
  721. tx_compl_req: 1; \
  722. \
  723. \
  724. /* DWORD 1: MSDU length and ID */ \
  725. A_UINT32 \
  726. len: 16, /* MSDU length, in bytes */ \
  727. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  728. * and this id is used to calculate fragmentation \
  729. * descriptor pointer inside the target based on \
  730. * the base address, configured inside the target. \
  731. */ \
  732. \
  733. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  734. /* frags_desc_ptr - \
  735. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  736. * where the tx frame's fragments reside in memory. \
  737. * This field only applies to LL systems, since in HL systems the \
  738. * (degenerate single-fragment) fragmentation descriptor is created \
  739. * within the target. \
  740. */ \
  741. _paddr__frags_desc_ptr_; \
  742. \
  743. /* DWORD 3 (or 4): peerid, chanfreq */ \
  744. /* \
  745. * Peer ID : Target can use this value to know which peer-id packet \
  746. * destined to. \
  747. * It's intended to be specified by host in case of NAWDS. \
  748. */ \
  749. A_UINT16 peerid; \
  750. \
  751. /* \
  752. * Channel frequency: This identifies the desired channel \
  753. * frequency (in mhz) for tx frames. This is used by FW to help \
  754. * determine when it is safe to transmit or drop frames for \
  755. * off-channel operation. \
  756. * The default value of zero indicates to FW that the corresponding \
  757. * VDEV's home channel (if there is one) is the desired channel \
  758. * frequency. \
  759. */ \
  760. A_UINT16 chanfreq; \
  761. \
  762. /* Reason reserved is commented is increasing the htt structure size \
  763. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  764. * A_UINT32 reserved_dword3_bits0_31; \
  765. */ \
  766. } POSTPACK
  767. /* define a htt_tx_msdu_desc32_t type */
  768. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  769. /* define a htt_tx_msdu_desc64_t type */
  770. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  771. /*
  772. * Make htt_tx_msdu_desc_t be an alias for either
  773. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  774. */
  775. #if HTT_PADDR64
  776. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  777. #else
  778. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  779. #endif
  780. /* decriptor information for Management frame*/
  781. /*
  782. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  783. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  784. */
  785. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  786. extern A_UINT32 mgmt_hdr_len;
  787. PREPACK struct htt_mgmt_tx_desc_t {
  788. A_UINT32 msg_type;
  789. #if HTT_PADDR64
  790. A_UINT64 frag_paddr; /* DMAble address of the data */
  791. #else
  792. A_UINT32 frag_paddr; /* DMAble address of the data */
  793. #endif
  794. A_UINT32 desc_id; /* returned to host during completion
  795. * to free the meory*/
  796. A_UINT32 len; /* Fragment length */
  797. A_UINT32 vdev_id; /* virtual device ID*/
  798. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  799. } POSTPACK;
  800. PREPACK struct htt_mgmt_tx_compl_ind {
  801. A_UINT32 desc_id;
  802. A_UINT32 status;
  803. } POSTPACK;
  804. /*
  805. * This SDU header size comes from the summation of the following:
  806. * 1. Max of:
  807. * a. Native WiFi header, for native WiFi frames: 24 bytes
  808. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  809. * b. 802.11 header, for raw frames: 36 bytes
  810. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  811. * QoS header, HT header)
  812. * c. 802.3 header, for ethernet frames: 14 bytes
  813. * (destination address, source address, ethertype / length)
  814. * 2. Max of:
  815. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  816. * b. IPv6 header, up through the Traffic Class: 2 bytes
  817. * 3. 802.1Q VLAN header: 4 bytes
  818. * 4. LLC/SNAP header: 8 bytes
  819. */
  820. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  821. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  822. #define HTT_TX_HDR_SIZE_ETHERNET 14
  823. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  824. A_COMPILE_TIME_ASSERT(
  825. htt_encap_hdr_size_max_check_nwifi,
  826. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  827. A_COMPILE_TIME_ASSERT(
  828. htt_encap_hdr_size_max_check_enet,
  829. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  830. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  831. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  832. #define HTT_TX_HDR_SIZE_802_1Q 4
  833. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  834. #define HTT_COMMON_TX_FRM_HDR_LEN \
  835. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  836. HTT_TX_HDR_SIZE_802_1Q + \
  837. HTT_TX_HDR_SIZE_LLC_SNAP)
  838. #define HTT_HL_TX_FRM_HDR_LEN \
  839. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  840. #define HTT_LL_TX_FRM_HDR_LEN \
  841. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  842. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  843. /* dword 0 */
  844. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  845. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  846. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  847. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  848. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  849. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  850. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  851. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  852. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  853. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  854. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  855. #define HTT_TX_DESC_PKT_TYPE_S 13
  856. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  857. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  858. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  859. #define HTT_TX_DESC_VDEV_ID_S 16
  860. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  861. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  862. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  863. #define HTT_TX_DESC_EXT_TID_S 22
  864. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  865. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  866. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  867. #define HTT_TX_DESC_POSTPONED_S 27
  868. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  869. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  870. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  871. #define HTT_TX_DESC_EXTENSION_S 28
  872. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  873. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  874. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  875. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  876. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  877. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  878. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  879. #define HTT_TX_DESC_TX_COMP_S 31
  880. /* dword 1 */
  881. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  882. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  883. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  884. #define HTT_TX_DESC_FRM_LEN_S 0
  885. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  886. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  887. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  888. #define HTT_TX_DESC_FRM_ID_S 16
  889. /* dword 2 */
  890. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  891. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  892. /* for systems using 64-bit format for bus addresses */
  893. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  894. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  895. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  896. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  897. /* for systems using 32-bit format for bus addresses */
  898. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  899. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  900. /* dword 3 */
  901. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  902. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  903. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  904. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  905. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  906. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  907. #if HTT_PADDR64
  908. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  909. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  910. #else
  911. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  912. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  913. #endif
  914. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  915. #define HTT_TX_DESC_PEER_ID_S 0
  916. /*
  917. * TEMPORARY:
  918. * The original definitions for the PEER_ID fields contained typos
  919. * (with _DESC_PADDR appended to this PEER_ID field name).
  920. * Retain deprecated original names for PEER_ID fields until all code that
  921. * refers to them has been updated.
  922. */
  923. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  924. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  925. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  926. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  927. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  928. HTT_TX_DESC_PEER_ID_M
  929. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  930. HTT_TX_DESC_PEER_ID_S
  931. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  932. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  933. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  934. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  935. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  936. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  937. #if HTT_PADDR64
  938. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  939. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  940. #else
  941. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  942. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  943. #endif
  944. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  945. #define HTT_TX_DESC_CHAN_FREQ_S 16
  946. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  947. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  948. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  949. do { \
  950. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  951. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  952. } while (0)
  953. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  954. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  955. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  956. do { \
  957. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  958. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  959. } while (0)
  960. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  961. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  962. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  963. do { \
  964. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  965. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  966. } while (0)
  967. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  968. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  969. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  970. do { \
  971. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  972. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  973. } while (0)
  974. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  975. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  976. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  977. do { \
  978. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  979. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  980. } while (0)
  981. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  982. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  983. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  984. do { \
  985. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  986. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  987. } while (0)
  988. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  989. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  990. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  991. do { \
  992. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  993. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  994. } while (0)
  995. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  996. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  997. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  998. do { \
  999. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1000. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1001. } while (0)
  1002. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1003. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1004. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1005. do { \
  1006. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1007. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1008. } while (0)
  1009. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1010. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1011. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1012. do { \
  1013. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1014. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1015. } while (0)
  1016. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1017. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1018. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1019. do { \
  1020. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1021. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1022. } while (0)
  1023. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1024. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1025. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1026. do { \
  1027. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1028. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1029. } while (0)
  1030. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1031. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1032. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1033. do { \
  1034. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1035. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1036. } while (0)
  1037. /* enums used in the HTT tx MSDU extension descriptor */
  1038. enum {
  1039. htt_tx_guard_interval_regular = 0,
  1040. htt_tx_guard_interval_short = 1,
  1041. };
  1042. enum {
  1043. htt_tx_preamble_type_ofdm = 0,
  1044. htt_tx_preamble_type_cck = 1,
  1045. htt_tx_preamble_type_ht = 2,
  1046. htt_tx_preamble_type_vht = 3,
  1047. };
  1048. enum {
  1049. htt_tx_bandwidth_5MHz = 0,
  1050. htt_tx_bandwidth_10MHz = 1,
  1051. htt_tx_bandwidth_20MHz = 2,
  1052. htt_tx_bandwidth_40MHz = 3,
  1053. htt_tx_bandwidth_80MHz = 4,
  1054. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1055. };
  1056. /**
  1057. * @brief HTT tx MSDU extension descriptor
  1058. * @details
  1059. * If the target supports HTT tx MSDU extension descriptors, the host has
  1060. * the option of appending the following struct following the regular
  1061. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1062. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1063. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1064. * tx specs for each frame.
  1065. */
  1066. PREPACK struct htt_tx_msdu_desc_ext_t {
  1067. /* DWORD 0: flags */
  1068. A_UINT32
  1069. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1070. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1071. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1072. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1073. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1074. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1075. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1076. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1077. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1078. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1079. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1080. /* DWORD 1: tx power, tx rate, tx BW */
  1081. A_UINT32
  1082. /* pwr -
  1083. * Specify what power the tx frame needs to be transmitted at.
  1084. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1085. * The value needs to be appropriately sign-extended when extracting
  1086. * the value from the message and storing it in a variable that is
  1087. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1088. * automatically handles this sign-extension.)
  1089. * If the transmission uses multiple tx chains, this power spec is
  1090. * the total transmit power, assuming incoherent combination of
  1091. * per-chain power to produce the total power.
  1092. */
  1093. pwr: 8,
  1094. /* mcs_mask -
  1095. * Specify the allowable values for MCS index (modulation and coding)
  1096. * to use for transmitting the frame.
  1097. *
  1098. * For HT / VHT preamble types, this mask directly corresponds to
  1099. * the HT or VHT MCS indices that are allowed. For each bit N set
  1100. * within the mask, MCS index N is allowed for transmitting the frame.
  1101. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1102. * rates versus OFDM rates, so the host has the option of specifying
  1103. * that the target must transmit the frame with CCK or OFDM rates
  1104. * (not HT or VHT), but leaving the decision to the target whether
  1105. * to use CCK or OFDM.
  1106. *
  1107. * For CCK and OFDM, the bits within this mask are interpreted as
  1108. * follows:
  1109. * bit 0 -> CCK 1 Mbps rate is allowed
  1110. * bit 1 -> CCK 2 Mbps rate is allowed
  1111. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1112. * bit 3 -> CCK 11 Mbps rate is allowed
  1113. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1114. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1115. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1116. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1117. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1118. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1119. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1120. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1121. *
  1122. * The MCS index specification needs to be compatible with the
  1123. * bandwidth mask specification. For example, a MCS index == 9
  1124. * specification is inconsistent with a preamble type == VHT,
  1125. * Nss == 1, and channel bandwidth == 20 MHz.
  1126. *
  1127. * Furthermore, the host has only a limited ability to specify to
  1128. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1129. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1130. */
  1131. mcs_mask: 12,
  1132. /* nss_mask -
  1133. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1134. * Each bit in this mask corresponds to a Nss value:
  1135. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1136. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1137. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1138. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1139. * The values in the Nss mask must be suitable for the recipient, e.g.
  1140. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1141. * recipient which only supports 2x2 MIMO.
  1142. */
  1143. nss_mask: 4,
  1144. /* guard_interval -
  1145. * Specify a htt_tx_guard_interval enum value to indicate whether
  1146. * the transmission should use a regular guard interval or a
  1147. * short guard interval.
  1148. */
  1149. guard_interval: 1,
  1150. /* preamble_type_mask -
  1151. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1152. * may choose from for transmitting this frame.
  1153. * The bits in this mask correspond to the values in the
  1154. * htt_tx_preamble_type enum. For example, to allow the target
  1155. * to transmit the frame as either CCK or OFDM, this field would
  1156. * be set to
  1157. * (1 << htt_tx_preamble_type_ofdm) |
  1158. * (1 << htt_tx_preamble_type_cck)
  1159. */
  1160. preamble_type_mask: 4,
  1161. reserved1_31_29: 3; /* unused, set to 0x0 */
  1162. /* DWORD 2: tx chain mask, tx retries */
  1163. A_UINT32
  1164. /* chain_mask - specify which chains to transmit from */
  1165. chain_mask: 4,
  1166. /* retry_limit -
  1167. * Specify the maximum number of transmissions, including the
  1168. * initial transmission, to attempt before giving up if no ack
  1169. * is received.
  1170. * If the tx rate is specified, then all retries shall use the
  1171. * same rate as the initial transmission.
  1172. * If no tx rate is specified, the target can choose whether to
  1173. * retain the original rate during the retransmissions, or to
  1174. * fall back to a more robust rate.
  1175. */
  1176. retry_limit: 4,
  1177. /* bandwidth_mask -
  1178. * Specify what channel widths may be used for the transmission.
  1179. * A value of zero indicates "don't care" - the target may choose
  1180. * the transmission bandwidth.
  1181. * The bits within this mask correspond to the htt_tx_bandwidth
  1182. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1183. * The bandwidth_mask must be consistent with the preamble_type_mask
  1184. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1185. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1186. */
  1187. bandwidth_mask: 6,
  1188. reserved2_31_14: 18; /* unused, set to 0x0 */
  1189. /* DWORD 3: tx expiry time (TSF) LSBs */
  1190. A_UINT32 expire_tsf_lo;
  1191. /* DWORD 4: tx expiry time (TSF) MSBs */
  1192. A_UINT32 expire_tsf_hi;
  1193. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1194. } POSTPACK;
  1195. /* DWORD 0 */
  1196. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1197. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1198. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1199. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1200. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1201. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1202. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1203. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1204. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1205. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1206. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1207. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1208. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1209. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1210. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1211. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1212. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1213. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1214. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1215. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1216. /* DWORD 1 */
  1217. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1218. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1219. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1220. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1221. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1222. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1223. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1224. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1225. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1226. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1227. /* DWORD 2 */
  1228. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1229. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1230. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1231. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1232. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1233. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1234. /* DWORD 0 */
  1235. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1236. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1237. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1238. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1239. do { \
  1240. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1241. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1242. } while (0)
  1243. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1244. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1245. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1246. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1247. do { \
  1248. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1249. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1250. } while (0)
  1251. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1252. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1253. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1254. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1255. do { \
  1256. HTT_CHECK_SET_VAL( \
  1257. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1258. ((_var) |= ((_val) \
  1259. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1260. } while (0)
  1261. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1262. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1263. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1264. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1265. do { \
  1266. HTT_CHECK_SET_VAL( \
  1267. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1268. ((_var) |= ((_val) \
  1269. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1270. } while (0)
  1271. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1272. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1273. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1274. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1275. do { \
  1276. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1277. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1278. } while (0)
  1279. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1280. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1281. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1282. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1283. do { \
  1284. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1285. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1286. } while (0)
  1287. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1288. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1289. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1290. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1291. do { \
  1292. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1293. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1294. } while (0)
  1295. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1296. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1297. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1298. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1299. do { \
  1300. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1301. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1302. } while (0)
  1303. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1304. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1305. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1306. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1307. do { \
  1308. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1309. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1310. } while (0)
  1311. /* DWORD 1 */
  1312. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1313. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1314. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1315. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1316. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1317. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1318. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1319. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1320. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1321. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1322. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1323. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1324. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1325. do { \
  1326. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1327. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1328. } while (0)
  1329. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1330. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1331. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1332. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1333. do { \
  1334. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1335. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1336. } while (0)
  1337. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1338. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1339. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1340. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1341. do { \
  1342. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1343. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1344. } while (0)
  1345. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1346. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1347. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1348. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1349. do { \
  1350. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1351. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1352. } while (0)
  1353. /* DWORD 2 */
  1354. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1355. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1356. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1357. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1358. do { \
  1359. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1360. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1361. } while (0)
  1362. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1363. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1364. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1365. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1366. do { \
  1367. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1368. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1369. } while (0)
  1370. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1371. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1372. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1373. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1374. do { \
  1375. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1376. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1377. } while (0)
  1378. typedef enum {
  1379. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1380. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1381. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1382. } htt_11ax_ltf_subtype_t;
  1383. typedef enum {
  1384. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1385. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1386. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1387. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1388. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1389. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1390. } htt_tx_ext2_preamble_type_t;
  1391. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1392. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1393. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1394. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1395. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1396. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1397. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1398. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1399. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1400. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1401. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1402. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1403. /**
  1404. * @brief HTT tx MSDU extension descriptor v2
  1405. * @details
  1406. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1407. * is received as tcl_exit_base->host_meta_info in firmware.
  1408. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1409. * are already part of tcl_exit_base.
  1410. */
  1411. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1412. /* DWORD 0: flags */
  1413. A_UINT32
  1414. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1415. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1416. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1417. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1418. valid_retries : 1, /* if set, tx retries spec is valid */
  1419. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1420. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1421. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1422. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1423. valid_key_flags : 1, /* if set, key flags is valid */
  1424. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1425. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1426. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1427. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1428. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1429. 1 = ENCRYPT,
  1430. 2 ~ 3 - Reserved */
  1431. /* retry_limit -
  1432. * Specify the maximum number of transmissions, including the
  1433. * initial transmission, to attempt before giving up if no ack
  1434. * is received.
  1435. * If the tx rate is specified, then all retries shall use the
  1436. * same rate as the initial transmission.
  1437. * If no tx rate is specified, the target can choose whether to
  1438. * retain the original rate during the retransmissions, or to
  1439. * fall back to a more robust rate.
  1440. */
  1441. retry_limit : 4,
  1442. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1443. * Valid only for 11ax preamble types HE_SU
  1444. * and HE_EXT_SU
  1445. */
  1446. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1447. * Valid only for 11ax preamble types HE_SU
  1448. * and HE_EXT_SU
  1449. */
  1450. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1451. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1452. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1453. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1454. */
  1455. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1456. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1457. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1458. * Use cases:
  1459. * Any time firmware uses TQM-BYPASS for Data
  1460. * TID, firmware expect host to set this bit.
  1461. */
  1462. /* DWORD 1: tx power, tx rate */
  1463. A_UINT32
  1464. power : 8, /* unit of the power field is 0.5 dbm
  1465. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1466. * signed value ranging from -64dbm to 63.5 dbm
  1467. */
  1468. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1469. * Setting more than one MCS isn't currently
  1470. * supported by the target (but is supported
  1471. * in the interface in case in the future
  1472. * the target supports specifications of
  1473. * a limited set of MCS values.
  1474. */
  1475. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1476. * Setting more than one Nss isn't currently
  1477. * supported by the target (but is supported
  1478. * in the interface in case in the future
  1479. * the target supports specifications of
  1480. * a limited set of Nss values.
  1481. */
  1482. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1483. update_peer_cache : 1; /* When set these custom values will be
  1484. * used for all packets, until the next
  1485. * update via this ext header.
  1486. * This is to make sure not all packets
  1487. * need to include this header.
  1488. */
  1489. /* DWORD 2: tx chain mask, tx retries */
  1490. A_UINT32
  1491. /* chain_mask - specify which chains to transmit from */
  1492. chain_mask : 8,
  1493. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1494. * TODO: Update Enum values for key_flags
  1495. */
  1496. /*
  1497. * Channel frequency: This identifies the desired channel
  1498. * frequency (in MHz) for tx frames. This is used by FW to help
  1499. * determine when it is safe to transmit or drop frames for
  1500. * off-channel operation.
  1501. * The default value of zero indicates to FW that the corresponding
  1502. * VDEV's home channel (if there is one) is the desired channel
  1503. * frequency.
  1504. */
  1505. chanfreq : 16;
  1506. /* DWORD 3: tx expiry time (TSF) LSBs */
  1507. A_UINT32 expire_tsf_lo;
  1508. /* DWORD 4: tx expiry time (TSF) MSBs */
  1509. A_UINT32 expire_tsf_hi;
  1510. /* DWORD 5: reserved
  1511. * This structure can be expanded further up to 60 bytes
  1512. * by adding further DWORDs as needed.
  1513. */
  1514. A_UINT32
  1515. /* learning_frame
  1516. * When this flag is set, this frame will be dropped by FW
  1517. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1518. */
  1519. learning_frame : 1,
  1520. rsvd0 : 31;
  1521. } POSTPACK;
  1522. /* DWORD 0 */
  1523. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1524. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1525. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1526. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1527. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1528. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1529. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1530. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1531. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1532. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1533. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1534. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1535. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1536. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1537. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1538. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1539. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1540. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1541. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1542. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1543. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1544. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1545. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1546. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1547. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1548. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1549. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1550. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1551. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1552. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1553. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1554. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1555. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1556. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1557. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1558. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1559. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1560. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1561. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1562. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1563. /* DWORD 1 */
  1564. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1565. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1566. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1567. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1568. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1569. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1570. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1571. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1572. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1573. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1574. /* DWORD 2 */
  1575. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1576. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1577. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1578. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1579. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1580. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1581. /* DWORD 5 */
  1582. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1583. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1584. /* DWORD 0 */
  1585. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1586. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1587. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1588. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1589. do { \
  1590. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1591. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1592. } while (0)
  1593. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1594. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1595. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1596. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1597. do { \
  1598. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1599. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1600. } while (0)
  1601. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1602. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1603. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1604. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1605. do { \
  1606. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1607. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1608. } while (0)
  1609. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1610. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1611. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1612. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1613. do { \
  1614. HTT_CHECK_SET_VAL( \
  1615. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1616. ((_var) |= ((_val) \
  1617. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1618. } while (0)
  1619. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1620. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1621. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1622. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1623. do { \
  1624. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1625. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1626. } while (0)
  1627. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1628. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1629. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1630. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1631. do { \
  1632. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1633. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1634. } while (0)
  1635. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1636. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1637. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1638. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1639. do { \
  1640. HTT_CHECK_SET_VAL( \
  1641. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1642. ((_var) |= ((_val) \
  1643. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1644. } while (0)
  1645. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1646. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1647. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1648. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1649. do { \
  1650. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1651. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1652. } while (0)
  1653. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1654. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1655. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1656. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1657. do { \
  1658. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1659. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1660. } while (0)
  1661. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1662. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1663. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1664. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1665. do { \
  1666. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1667. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1668. } while (0)
  1669. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1670. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1671. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1672. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1673. do { \
  1674. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1675. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1676. } while (0)
  1677. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1678. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1679. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1680. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1681. do { \
  1682. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1683. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1684. } while (0)
  1685. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1686. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1687. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1688. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1689. do { \
  1690. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1691. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1692. } while (0)
  1693. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1694. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1695. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1696. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1697. do { \
  1698. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1699. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1700. } while (0)
  1701. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1702. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1703. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1704. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1705. do { \
  1706. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1707. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1708. } while (0)
  1709. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1710. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1711. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1712. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1713. do { \
  1714. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  1715. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  1716. } while (0)
  1717. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1718. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1719. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1720. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1721. do { \
  1722. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  1723. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  1724. } while (0)
  1725. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1726. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1727. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1728. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1729. do { \
  1730. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  1731. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1732. } while (0)
  1733. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1734. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1735. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1736. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1737. do { \
  1738. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1739. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  1740. } while (0)
  1741. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1742. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1743. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1744. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1745. do { \
  1746. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  1747. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1748. } while (0)
  1749. /* DWORD 1 */
  1750. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1751. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1752. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1753. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1754. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1755. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1756. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1757. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1758. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  1759. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  1760. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  1761. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  1762. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  1763. do { \
  1764. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  1765. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  1766. } while (0)
  1767. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  1768. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  1769. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  1770. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  1771. do { \
  1772. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  1773. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  1774. } while (0)
  1775. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  1776. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  1777. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  1778. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  1779. do { \
  1780. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  1781. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  1782. } while (0)
  1783. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  1784. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  1785. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  1786. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  1787. do { \
  1788. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  1789. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  1790. } while (0)
  1791. /* DWORD 2 */
  1792. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  1793. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  1794. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  1795. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  1796. do { \
  1797. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  1798. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  1799. } while (0)
  1800. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  1801. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  1802. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  1803. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  1804. do { \
  1805. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  1806. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  1807. } while (0)
  1808. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  1809. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  1810. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  1811. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  1812. do { \
  1813. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  1814. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  1815. } while (0)
  1816. /* DWORD 5 */
  1817. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  1818. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  1819. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  1820. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  1821. do { \
  1822. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  1823. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  1824. } while (0)
  1825. typedef enum {
  1826. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  1827. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  1828. } htt_tcl_metadata_type;
  1829. /**
  1830. * @brief HTT TCL command number format
  1831. * @details
  1832. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  1833. * available to firmware as tcl_exit_base->tcl_status_number.
  1834. * For regular / multicast packets host will send vdev and mac id and for
  1835. * NAWDS packets, host will send peer id.
  1836. * A_UINT32 is used to avoid endianness conversion problems.
  1837. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  1838. */
  1839. typedef struct {
  1840. A_UINT32
  1841. type: 1, /* vdev_id based or peer_id based */
  1842. rsvd: 31;
  1843. } htt_tx_tcl_vdev_or_peer_t;
  1844. typedef struct {
  1845. A_UINT32
  1846. type: 1, /* vdev_id based or peer_id based */
  1847. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1848. vdev_id: 8,
  1849. pdev_id: 2,
  1850. host_inspected:1,
  1851. rsvd: 19;
  1852. } htt_tx_tcl_vdev_metadata;
  1853. typedef struct {
  1854. A_UINT32
  1855. type: 1, /* vdev_id based or peer_id based */
  1856. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1857. peer_id: 14,
  1858. rsvd: 16;
  1859. } htt_tx_tcl_peer_metadata;
  1860. PREPACK struct htt_tx_tcl_metadata {
  1861. union {
  1862. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  1863. htt_tx_tcl_vdev_metadata vdev_meta;
  1864. htt_tx_tcl_peer_metadata peer_meta;
  1865. };
  1866. } POSTPACK;
  1867. /* DWORD 0 */
  1868. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  1869. #define HTT_TX_TCL_METADATA_TYPE_S 0
  1870. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  1871. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  1872. /* VDEV metadata */
  1873. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  1874. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  1875. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  1876. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  1877. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  1878. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  1879. /* PEER metadata */
  1880. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  1881. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  1882. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  1883. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  1884. HTT_TX_TCL_METADATA_TYPE_S)
  1885. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  1886. do { \
  1887. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  1888. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  1889. } while (0)
  1890. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  1891. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  1892. HTT_TX_TCL_METADATA_VALID_HTT_S)
  1893. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  1894. do { \
  1895. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  1896. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  1897. } while (0)
  1898. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  1899. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  1900. HTT_TX_TCL_METADATA_VDEV_ID_S)
  1901. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  1902. do { \
  1903. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  1904. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  1905. } while (0)
  1906. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  1907. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  1908. HTT_TX_TCL_METADATA_PDEV_ID_S)
  1909. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  1910. do { \
  1911. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  1912. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  1913. } while (0)
  1914. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  1915. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  1916. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  1917. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  1918. do { \
  1919. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  1920. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  1921. } while (0)
  1922. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  1923. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  1924. HTT_TX_TCL_METADATA_PEER_ID_S)
  1925. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  1926. do { \
  1927. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  1928. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  1929. } while (0)
  1930. typedef enum {
  1931. HTT_TX_FW2WBM_TX_STATUS_OK,
  1932. HTT_TX_FW2WBM_TX_STATUS_DROP,
  1933. HTT_TX_FW2WBM_TX_STATUS_TTL,
  1934. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  1935. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  1936. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  1937. HTT_TX_FW2WBM_TX_STATUS_MAX
  1938. } htt_tx_fw2wbm_tx_status_t;
  1939. typedef enum {
  1940. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  1941. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  1942. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  1943. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  1944. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  1945. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  1946. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  1947. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  1948. } htt_tx_fw2wbm_reinject_reason_t;
  1949. /**
  1950. * @brief HTT TX WBM Completion from firmware to host
  1951. * @details
  1952. * This structure is passed from firmware to host overlayed on wbm_release_ring
  1953. * DWORD 3 and 4 for software based completions (Exception frames and
  1954. * TQM bypass frames)
  1955. * For software based completions, wbm_release_ring->release_source_module will
  1956. * be set to release_source_fw
  1957. */
  1958. PREPACK struct htt_tx_wbm_completion {
  1959. A_UINT32
  1960. sch_cmd_id: 24,
  1961. exception_frame: 1, /* If set, this packet was queued via exception path */
  1962. rsvd0_31_25: 7;
  1963. A_UINT32
  1964. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  1965. * reception of an ACK or BA, this field indicates
  1966. * the RSSI of the received ACK or BA frame.
  1967. * When the frame is removed as result of a direct
  1968. * remove command from the SW, this field is set
  1969. * to 0x0 (which is never a valid value when real
  1970. * RSSI is available).
  1971. * Units: dB w.r.t noise floor
  1972. */
  1973. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  1974. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  1975. rsvd1_31_16: 16;
  1976. } POSTPACK;
  1977. /* DWORD 0 */
  1978. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  1979. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  1980. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  1981. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  1982. /* DWORD 1 */
  1983. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  1984. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  1985. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  1986. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  1987. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  1988. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  1989. /* DWORD 0 */
  1990. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  1991. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  1992. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  1993. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  1994. do { \
  1995. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  1996. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  1997. } while (0)
  1998. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  1999. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2000. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2001. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2002. do { \
  2003. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2004. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2005. } while (0)
  2006. /* DWORD 1 */
  2007. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2008. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2009. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2010. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2011. do { \
  2012. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2013. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2014. } while (0)
  2015. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2016. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2017. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2018. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2019. do { \
  2020. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2021. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2022. } while (0)
  2023. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2024. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2025. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2026. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2027. do { \
  2028. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2029. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2030. } while (0)
  2031. /**
  2032. * @brief HTT TX WBM Completion from firmware to host
  2033. * @details
  2034. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2035. * (WBM) offload HW.
  2036. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2037. * For software based completions, release_source_module will
  2038. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2039. * struct wbm_release_ring and then switch to this after looking at
  2040. * release_source_module.
  2041. */
  2042. PREPACK struct htt_tx_wbm_completion_v2 {
  2043. A_UINT32
  2044. used_by_hw0; /* Refer to struct wbm_release_ring */
  2045. A_UINT32
  2046. used_by_hw1; /* Refer to struct wbm_release_ring */
  2047. A_UINT32
  2048. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2049. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2050. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2051. exception_frame: 1,
  2052. rsvd0: 12, /* For future use */
  2053. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2054. rsvd1: 1; /* For future use */
  2055. A_UINT32
  2056. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2057. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2058. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2059. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2060. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2061. */
  2062. A_UINT32
  2063. data1: 32;
  2064. A_UINT32
  2065. data2: 32;
  2066. A_UINT32
  2067. used_by_hw3; /* Refer to struct wbm_release_ring */
  2068. } POSTPACK;
  2069. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2070. /* DWORD 3 */
  2071. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2072. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2073. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2074. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2075. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2076. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2077. /* DWORD 3 */
  2078. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2079. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2080. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2081. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2082. do { \
  2083. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2084. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2085. } while (0)
  2086. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2087. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2088. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2089. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2090. do { \
  2091. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2092. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2093. } while (0)
  2094. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2095. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2096. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2097. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2098. do { \
  2099. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2100. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2101. } while (0)
  2102. /**
  2103. * @brief HTT TX WBM transmit status from firmware to host
  2104. * @details
  2105. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2106. * (WBM) offload HW.
  2107. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2108. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2109. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2110. */
  2111. PREPACK struct htt_tx_wbm_transmit_status {
  2112. A_UINT32
  2113. sch_cmd_id: 24,
  2114. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2115. * reception of an ACK or BA, this field indicates
  2116. * the RSSI of the received ACK or BA frame.
  2117. * When the frame is removed as result of a direct
  2118. * remove command from the SW, this field is set
  2119. * to 0x0 (which is never a valid value when real
  2120. * RSSI is available).
  2121. * Units: dB w.r.t noise floor
  2122. */
  2123. A_UINT32
  2124. sw_peer_id: 16,
  2125. tid_num: 5,
  2126. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2127. * and tid_num fields contain valid data.
  2128. * If this "valid" flag is not set, the
  2129. * sw_peer_id and tid_num fields must be ignored.
  2130. */
  2131. reserved0: 10;
  2132. A_UINT32
  2133. reserved1: 32;
  2134. } POSTPACK;
  2135. /* DWORD 4 */
  2136. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2137. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2138. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2139. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2140. /* DWORD 5 */
  2141. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2142. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2143. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2144. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2145. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2146. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2147. /* DWORD 4 */
  2148. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2149. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2150. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2151. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2152. do { \
  2153. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2154. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2155. } while (0)
  2156. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2157. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2158. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2159. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2160. do { \
  2161. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2162. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2163. } while (0)
  2164. /* DWORD 5 */
  2165. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2166. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2167. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2168. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2169. do { \
  2170. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2171. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2172. } while (0)
  2173. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2174. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2175. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2176. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2177. do { \
  2178. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2179. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2180. } while (0)
  2181. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2182. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2183. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2184. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2185. do { \
  2186. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2187. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2188. } while (0)
  2189. /**
  2190. * @brief HTT TX WBM reinject status from firmware to host
  2191. * @details
  2192. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2193. * (WBM) offload HW.
  2194. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2195. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2196. */
  2197. PREPACK struct htt_tx_wbm_reinject_status {
  2198. A_UINT32
  2199. reserved0: 32;
  2200. A_UINT32
  2201. reserved1: 32;
  2202. A_UINT32
  2203. reserved2: 32;
  2204. } POSTPACK;
  2205. /**
  2206. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2207. * @details
  2208. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2209. * (WBM) offload HW.
  2210. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2211. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2212. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2213. * STA side.
  2214. */
  2215. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2216. A_UINT32
  2217. mec_sa_addr_31_0;
  2218. A_UINT32
  2219. mec_sa_addr_47_32: 16,
  2220. sa_ast_index: 16;
  2221. A_UINT32
  2222. vdev_id: 8,
  2223. reserved0: 24;
  2224. } POSTPACK;
  2225. /* DWORD 4 - mec_sa_addr_31_0 */
  2226. /* DWORD 5 */
  2227. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2228. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2229. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2230. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2231. /* DWORD 6 */
  2232. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2233. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2234. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2235. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2236. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2237. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2238. do { \
  2239. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2240. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2241. } while (0)
  2242. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2243. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2244. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2245. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2246. do { \
  2247. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2248. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2249. } while (0)
  2250. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2251. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2252. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2253. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2254. do { \
  2255. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2256. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2257. } while (0)
  2258. typedef enum {
  2259. TX_FLOW_PRIORITY_BE,
  2260. TX_FLOW_PRIORITY_HIGH,
  2261. TX_FLOW_PRIORITY_LOW,
  2262. } htt_tx_flow_priority_t;
  2263. typedef enum {
  2264. TX_FLOW_LATENCY_SENSITIVE,
  2265. TX_FLOW_LATENCY_INSENSITIVE,
  2266. } htt_tx_flow_latency_t;
  2267. typedef enum {
  2268. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2269. TX_FLOW_INTERACTIVE_TRAFFIC,
  2270. TX_FLOW_PERIODIC_TRAFFIC,
  2271. TX_FLOW_BURSTY_TRAFFIC,
  2272. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2273. } htt_tx_flow_traffic_pattern_t;
  2274. /**
  2275. * @brief HTT TX Flow search metadata format
  2276. * @details
  2277. * Host will set this metadata in flow table's flow search entry along with
  2278. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2279. * firmware and TQM ring if the flow search entry wins.
  2280. * This metadata is available to firmware in that first MSDU's
  2281. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2282. * to one of the available flows for specific tid and returns the tqm flow
  2283. * pointer as part of htt_tx_map_flow_info message.
  2284. */
  2285. PREPACK struct htt_tx_flow_metadata {
  2286. A_UINT32
  2287. rsvd0_1_0: 2,
  2288. tid: 4,
  2289. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2290. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2291. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2292. * Else choose final tid based on latency, priority.
  2293. */
  2294. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2295. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2296. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2297. } POSTPACK;
  2298. /* DWORD 0 */
  2299. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2300. #define HTT_TX_FLOW_METADATA_TID_S 2
  2301. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2302. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2303. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2304. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2305. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2306. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2307. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2308. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2309. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2310. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2311. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2312. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2313. /* DWORD 0 */
  2314. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2315. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2316. HTT_TX_FLOW_METADATA_TID_S)
  2317. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2318. do { \
  2319. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2320. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2321. } while (0)
  2322. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2323. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2324. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2325. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2326. do { \
  2327. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2328. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2329. } while (0)
  2330. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2331. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2332. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2333. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2334. do { \
  2335. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2336. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2337. } while (0)
  2338. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2339. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2340. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2341. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2342. do { \
  2343. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2344. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2345. } while (0)
  2346. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2347. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2348. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2349. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2350. do { \
  2351. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2352. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2353. } while (0)
  2354. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2355. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2356. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2357. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2358. do { \
  2359. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2360. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2361. } while (0)
  2362. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2363. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2364. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2365. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2366. do { \
  2367. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2368. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2369. } while (0)
  2370. /**
  2371. * @brief Used in HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY and HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY messages
  2372. *
  2373. * @details
  2374. * HTT wds entry from source port learning
  2375. * Host will learn wds entries from rx and send this message to firmware
  2376. * to enable firmware to configure/delete AST entries for wds clients.
  2377. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2378. * and when SA's entry is deleted, firmware removes this AST entry
  2379. *
  2380. * The message would appear as follows:
  2381. *
  2382. * |31 30|29 |17 16|15 8|7 0|
  2383. * |----------------+----------------+----------------+----------------|
  2384. * | rsvd0 |PDVID| vdev_id | msg_type |
  2385. * |-------------------------------------------------------------------|
  2386. * | sa_addr_31_0 |
  2387. * |-------------------------------------------------------------------|
  2388. * | | ta_peer_id | sa_addr_47_32 |
  2389. * |-------------------------------------------------------------------|
  2390. * Where PDVID = pdev_id
  2391. *
  2392. * The message is interpreted as follows:
  2393. *
  2394. * dword0 - b'0:7 - msg_type: This will be set to
  2395. * HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY or
  2396. * HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2397. *
  2398. * dword0 - b'8:15 - vdev_id
  2399. *
  2400. * dword0 - b'16:17 - pdev_id
  2401. *
  2402. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2403. *
  2404. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2405. *
  2406. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2407. *
  2408. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2409. */
  2410. PREPACK struct htt_wds_entry {
  2411. A_UINT32
  2412. msg_type: 8,
  2413. vdev_id: 8,
  2414. pdev_id: 2,
  2415. rsvd0: 14;
  2416. A_UINT32 sa_addr_31_0;
  2417. A_UINT32
  2418. sa_addr_47_32: 16,
  2419. ta_peer_id: 14,
  2420. rsvd2: 2;
  2421. } POSTPACK;
  2422. /* DWORD 0 */
  2423. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2424. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2425. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2426. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2427. /* DWORD 2 */
  2428. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2429. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2430. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2431. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2432. /* DWORD 0 */
  2433. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2434. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2435. HTT_WDS_ENTRY_VDEV_ID_S)
  2436. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2437. do { \
  2438. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2439. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2440. } while (0)
  2441. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2442. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2443. HTT_WDS_ENTRY_PDEV_ID_S)
  2444. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2445. do { \
  2446. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2447. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2448. } while (0)
  2449. /* DWORD 2 */
  2450. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2451. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2452. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2453. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2454. do { \
  2455. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2456. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2457. } while (0)
  2458. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2459. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2460. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2461. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2462. do { \
  2463. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2464. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2465. } while (0)
  2466. /**
  2467. * @brief MAC DMA rx ring setup specification
  2468. * @details
  2469. * To allow for dynamic rx ring reconfiguration and to avoid race
  2470. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2471. * it uses. Instead, it sends this message to the target, indicating how
  2472. * the rx ring used by the host should be set up and maintained.
  2473. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2474. * specifications.
  2475. *
  2476. * |31 16|15 8|7 0|
  2477. * |---------------------------------------------------------------|
  2478. * header: | reserved | num rings | msg type |
  2479. * |---------------------------------------------------------------|
  2480. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2481. #if HTT_PADDR64
  2482. * | FW_IDX shadow register physical address (bits 63:32) |
  2483. #endif
  2484. * |---------------------------------------------------------------|
  2485. * | rx ring base physical address (bits 31:0) |
  2486. #if HTT_PADDR64
  2487. * | rx ring base physical address (bits 63:32) |
  2488. #endif
  2489. * |---------------------------------------------------------------|
  2490. * | rx ring buffer size | rx ring length |
  2491. * |---------------------------------------------------------------|
  2492. * | FW_IDX initial value | enabled flags |
  2493. * |---------------------------------------------------------------|
  2494. * | MSDU payload offset | 802.11 header offset |
  2495. * |---------------------------------------------------------------|
  2496. * | PPDU end offset | PPDU start offset |
  2497. * |---------------------------------------------------------------|
  2498. * | MPDU end offset | MPDU start offset |
  2499. * |---------------------------------------------------------------|
  2500. * | MSDU end offset | MSDU start offset |
  2501. * |---------------------------------------------------------------|
  2502. * | frag info offset | rx attention offset |
  2503. * |---------------------------------------------------------------|
  2504. * payload 2, if present, has the same format as payload 1
  2505. * Header fields:
  2506. * - MSG_TYPE
  2507. * Bits 7:0
  2508. * Purpose: identifies this as an rx ring configuration message
  2509. * Value: 0x2
  2510. * - NUM_RINGS
  2511. * Bits 15:8
  2512. * Purpose: indicates whether the host is setting up one rx ring or two
  2513. * Value: 1 or 2
  2514. * Payload:
  2515. * for systems using 64-bit format for bus addresses:
  2516. * - IDX_SHADOW_REG_PADDR_LO
  2517. * Bits 31:0
  2518. * Value: lower 4 bytes of physical address of the host's
  2519. * FW_IDX shadow register
  2520. * - IDX_SHADOW_REG_PADDR_HI
  2521. * Bits 31:0
  2522. * Value: upper 4 bytes of physical address of the host's
  2523. * FW_IDX shadow register
  2524. * - RING_BASE_PADDR_LO
  2525. * Bits 31:0
  2526. * Value: lower 4 bytes of physical address of the host's rx ring
  2527. * - RING_BASE_PADDR_HI
  2528. * Bits 31:0
  2529. * Value: uppper 4 bytes of physical address of the host's rx ring
  2530. * for systems using 32-bit format for bus addresses:
  2531. * - IDX_SHADOW_REG_PADDR
  2532. * Bits 31:0
  2533. * Value: physical address of the host's FW_IDX shadow register
  2534. * - RING_BASE_PADDR
  2535. * Bits 31:0
  2536. * Value: physical address of the host's rx ring
  2537. * - RING_LEN
  2538. * Bits 15:0
  2539. * Value: number of elements in the rx ring
  2540. * - RING_BUF_SZ
  2541. * Bits 31:16
  2542. * Value: size of the buffers referenced by the rx ring, in byte units
  2543. * - ENABLED_FLAGS
  2544. * Bits 15:0
  2545. * Value: 1-bit flags to show whether different rx fields are enabled
  2546. * bit 0: 802.11 header enabled (1) or disabled (0)
  2547. * bit 1: MSDU payload enabled (1) or disabled (0)
  2548. * bit 2: PPDU start enabled (1) or disabled (0)
  2549. * bit 3: PPDU end enabled (1) or disabled (0)
  2550. * bit 4: MPDU start enabled (1) or disabled (0)
  2551. * bit 5: MPDU end enabled (1) or disabled (0)
  2552. * bit 6: MSDU start enabled (1) or disabled (0)
  2553. * bit 7: MSDU end enabled (1) or disabled (0)
  2554. * bit 8: rx attention enabled (1) or disabled (0)
  2555. * bit 9: frag info enabled (1) or disabled (0)
  2556. * bit 10: unicast rx enabled (1) or disabled (0)
  2557. * bit 11: multicast rx enabled (1) or disabled (0)
  2558. * bit 12: ctrl rx enabled (1) or disabled (0)
  2559. * bit 13: mgmt rx enabled (1) or disabled (0)
  2560. * bit 14: null rx enabled (1) or disabled (0)
  2561. * bit 15: phy data rx enabled (1) or disabled (0)
  2562. * - IDX_INIT_VAL
  2563. * Bits 31:16
  2564. * Purpose: Specify the initial value for the FW_IDX.
  2565. * Value: the number of buffers initially present in the host's rx ring
  2566. * - OFFSET_802_11_HDR
  2567. * Bits 15:0
  2568. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2569. * - OFFSET_MSDU_PAYLOAD
  2570. * Bits 31:16
  2571. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2572. * - OFFSET_PPDU_START
  2573. * Bits 15:0
  2574. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2575. * - OFFSET_PPDU_END
  2576. * Bits 31:16
  2577. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2578. * - OFFSET_MPDU_START
  2579. * Bits 15:0
  2580. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2581. * - OFFSET_MPDU_END
  2582. * Bits 31:16
  2583. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2584. * - OFFSET_MSDU_START
  2585. * Bits 15:0
  2586. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2587. * - OFFSET_MSDU_END
  2588. * Bits 31:16
  2589. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2590. * - OFFSET_RX_ATTN
  2591. * Bits 15:0
  2592. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2593. * - OFFSET_FRAG_INFO
  2594. * Bits 31:16
  2595. * Value: offset in QUAD-bytes of frag info table
  2596. */
  2597. /* header fields */
  2598. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2599. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2600. /* payload fields */
  2601. /* for systems using a 64-bit format for bus addresses */
  2602. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2603. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2604. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2605. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2606. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2607. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2608. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2609. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2610. /* for systems using a 32-bit format for bus addresses */
  2611. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2612. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2613. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2614. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2615. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2616. #define HTT_RX_RING_CFG_LEN_S 0
  2617. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2618. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2619. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2620. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2621. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2622. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2623. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2624. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2625. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2626. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2627. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2628. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2629. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2630. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2631. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2632. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2633. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2634. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2635. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2636. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2637. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2638. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2639. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2640. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2641. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2642. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2643. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2644. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2645. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2646. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2647. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2648. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2649. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2650. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2651. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2652. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2653. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2654. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2655. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2656. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2657. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2658. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2659. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2660. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2661. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2662. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2663. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2664. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2665. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2666. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2667. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2668. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2669. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2670. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2671. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2672. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2673. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2674. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2675. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2676. #if HTT_PADDR64
  2677. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2678. #else
  2679. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2680. #endif
  2681. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2682. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2683. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2684. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2685. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2686. do { \
  2687. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2688. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2689. } while (0)
  2690. /* degenerate case for 32-bit fields */
  2691. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  2692. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  2693. ((_var) = (_val))
  2694. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  2695. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  2696. ((_var) = (_val))
  2697. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  2698. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  2699. ((_var) = (_val))
  2700. /* degenerate case for 32-bit fields */
  2701. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  2702. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  2703. ((_var) = (_val))
  2704. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  2705. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  2706. ((_var) = (_val))
  2707. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  2708. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  2709. ((_var) = (_val))
  2710. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  2711. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  2712. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  2713. do { \
  2714. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  2715. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  2716. } while (0)
  2717. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  2718. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  2719. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  2720. do { \
  2721. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  2722. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  2723. } while (0)
  2724. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  2725. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  2726. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  2727. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  2728. do { \
  2729. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  2730. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  2731. } while (0)
  2732. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  2733. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  2734. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  2735. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  2736. do { \
  2737. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  2738. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  2739. } while (0)
  2740. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  2741. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  2742. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  2743. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  2744. do { \
  2745. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  2746. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  2747. } while (0)
  2748. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  2749. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  2750. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  2751. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  2752. do { \
  2753. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  2754. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  2755. } while (0)
  2756. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  2757. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  2758. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  2759. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  2760. do { \
  2761. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  2762. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  2763. } while (0)
  2764. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  2765. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  2766. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  2767. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  2768. do { \
  2769. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  2770. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  2771. } while (0)
  2772. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  2773. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  2774. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  2775. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  2776. do { \
  2777. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  2778. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  2779. } while (0)
  2780. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  2781. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  2782. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  2783. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  2784. do { \
  2785. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  2786. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  2787. } while (0)
  2788. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  2789. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  2790. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  2791. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  2792. do { \
  2793. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  2794. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  2795. } while (0)
  2796. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  2797. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  2798. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  2799. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  2800. do { \
  2801. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  2802. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  2803. } while (0)
  2804. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  2805. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  2806. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  2807. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  2808. do { \
  2809. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  2810. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  2811. } while (0)
  2812. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  2813. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  2814. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  2815. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  2816. do { \
  2817. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  2818. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  2819. } while (0)
  2820. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  2821. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  2822. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  2823. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  2824. do { \
  2825. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  2826. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  2827. } while (0)
  2828. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  2829. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  2830. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  2831. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  2832. do { \
  2833. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  2834. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  2835. } while (0)
  2836. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  2837. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  2838. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  2839. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  2840. do { \
  2841. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  2842. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  2843. } while (0)
  2844. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  2845. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  2846. HTT_RX_RING_CFG_ENABLED_NULL_S)
  2847. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  2848. do { \
  2849. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  2850. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  2851. } while (0)
  2852. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  2853. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  2854. HTT_RX_RING_CFG_ENABLED_PHY_S)
  2855. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  2856. do { \
  2857. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  2858. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  2859. } while (0)
  2860. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  2861. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  2862. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  2863. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  2864. do { \
  2865. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  2866. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  2867. } while (0)
  2868. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  2869. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  2870. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  2871. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  2872. do { \
  2873. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  2874. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  2875. } while (0)
  2876. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  2877. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  2878. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  2879. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  2880. do { \
  2881. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  2882. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  2883. } while (0)
  2884. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  2885. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  2886. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  2887. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  2888. do { \
  2889. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  2890. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  2891. } while (0)
  2892. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  2893. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  2894. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  2895. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  2896. do { \
  2897. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  2898. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  2899. } while (0)
  2900. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  2901. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  2902. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  2903. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  2904. do { \
  2905. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  2906. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  2907. } while (0)
  2908. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  2909. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  2910. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  2911. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  2912. do { \
  2913. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  2914. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  2915. } while (0)
  2916. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  2917. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  2918. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  2919. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  2920. do { \
  2921. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  2922. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  2923. } while (0)
  2924. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  2925. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  2926. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  2927. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  2928. do { \
  2929. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  2930. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  2931. } while (0)
  2932. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  2933. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  2934. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  2935. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  2936. do { \
  2937. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  2938. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  2939. } while (0)
  2940. /**
  2941. * @brief host -> target FW statistics retrieve
  2942. *
  2943. * @details
  2944. * The following field definitions describe the format of the HTT host
  2945. * to target FW stats retrieve message. The message specifies the type of
  2946. * stats host wants to retrieve.
  2947. *
  2948. * |31 24|23 16|15 8|7 0|
  2949. * |-----------------------------------------------------------|
  2950. * | stats types request bitmask | msg type |
  2951. * |-----------------------------------------------------------|
  2952. * | stats types reset bitmask | reserved |
  2953. * |-----------------------------------------------------------|
  2954. * | stats type | config value |
  2955. * |-----------------------------------------------------------|
  2956. * | cookie LSBs |
  2957. * |-----------------------------------------------------------|
  2958. * | cookie MSBs |
  2959. * |-----------------------------------------------------------|
  2960. * Header fields:
  2961. * - MSG_TYPE
  2962. * Bits 7:0
  2963. * Purpose: identifies this is a stats upload request message
  2964. * Value: 0x3
  2965. * - UPLOAD_TYPES
  2966. * Bits 31:8
  2967. * Purpose: identifies which types of FW statistics to upload
  2968. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  2969. * - RESET_TYPES
  2970. * Bits 31:8
  2971. * Purpose: identifies which types of FW statistics to reset
  2972. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  2973. * - CFG_VAL
  2974. * Bits 23:0
  2975. * Purpose: give an opaque configuration value to the specified stats type
  2976. * Value: stats-type specific configuration value
  2977. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  2978. * bits 7:0 - how many per-MPDU byte counts to include in a record
  2979. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  2980. * bits 23:16 - how many per-MSDU byte counts to include in a record
  2981. * - CFG_STAT_TYPE
  2982. * Bits 31:24
  2983. * Purpose: specify which stats type (if any) the config value applies to
  2984. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  2985. * a valid configuration specification
  2986. * - COOKIE_LSBS
  2987. * Bits 31:0
  2988. * Purpose: Provide a mechanism to match a target->host stats confirmation
  2989. * message with its preceding host->target stats request message.
  2990. * Value: LSBs of the opaque cookie specified by the host-side requestor
  2991. * - COOKIE_MSBS
  2992. * Bits 31:0
  2993. * Purpose: Provide a mechanism to match a target->host stats confirmation
  2994. * message with its preceding host->target stats request message.
  2995. * Value: MSBs of the opaque cookie specified by the host-side requestor
  2996. */
  2997. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  2998. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  2999. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3000. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3001. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3002. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3003. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3004. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3005. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3006. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3007. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3008. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3009. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3010. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3011. do { \
  3012. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3013. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3014. } while (0)
  3015. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3016. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3017. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3018. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3019. do { \
  3020. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3021. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3022. } while (0)
  3023. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3024. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3025. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3026. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3027. do { \
  3028. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3029. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3030. } while (0)
  3031. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3032. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3033. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3034. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3035. do { \
  3036. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3037. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3038. } while (0)
  3039. /**
  3040. * @brief host -> target HTT out-of-band sync request
  3041. *
  3042. * @details
  3043. * The HTT SYNC tells the target to suspend processing of subsequent
  3044. * HTT host-to-target messages until some other target agent locally
  3045. * informs the target HTT FW that the current sync counter is equal to
  3046. * or greater than (in a modulo sense) the sync counter specified in
  3047. * the SYNC message.
  3048. * This allows other host-target components to synchronize their operation
  3049. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3050. * security key has been downloaded to and activated by the target.
  3051. * In the absence of any explicit synchronization counter value
  3052. * specification, the target HTT FW will use zero as the default current
  3053. * sync value.
  3054. *
  3055. * |31 24|23 16|15 8|7 0|
  3056. * |-----------------------------------------------------------|
  3057. * | reserved | sync count | msg type |
  3058. * |-----------------------------------------------------------|
  3059. * Header fields:
  3060. * - MSG_TYPE
  3061. * Bits 7:0
  3062. * Purpose: identifies this as a sync message
  3063. * Value: 0x4
  3064. * - SYNC_COUNT
  3065. * Bits 15:8
  3066. * Purpose: specifies what sync value the HTT FW will wait for from
  3067. * an out-of-band specification to resume its operation
  3068. * Value: in-band sync counter value to compare against the out-of-band
  3069. * counter spec.
  3070. * The HTT target FW will suspend its host->target message processing
  3071. * as long as
  3072. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3073. */
  3074. #define HTT_H2T_SYNC_MSG_SZ 4
  3075. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3076. #define HTT_H2T_SYNC_COUNT_S 8
  3077. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3078. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3079. HTT_H2T_SYNC_COUNT_S)
  3080. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3081. do { \
  3082. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3083. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3084. } while (0)
  3085. /**
  3086. * @brief HTT aggregation configuration
  3087. */
  3088. #define HTT_AGGR_CFG_MSG_SZ 4
  3089. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3090. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3091. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3092. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3093. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3094. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3095. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3096. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3097. do { \
  3098. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3099. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3100. } while (0)
  3101. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3102. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3103. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3104. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3105. do { \
  3106. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3107. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3108. } while (0)
  3109. /**
  3110. * @brief host -> target HTT configure max amsdu info per vdev
  3111. *
  3112. * @details
  3113. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3114. *
  3115. * |31 21|20 16|15 8|7 0|
  3116. * |-----------------------------------------------------------|
  3117. * | reserved | vdev id | max amsdu | msg type |
  3118. * |-----------------------------------------------------------|
  3119. * Header fields:
  3120. * - MSG_TYPE
  3121. * Bits 7:0
  3122. * Purpose: identifies this as a aggr cfg ex message
  3123. * Value: 0xa
  3124. * - MAX_NUM_AMSDU_SUBFRM
  3125. * Bits 15:8
  3126. * Purpose: max MSDUs per A-MSDU
  3127. * - VDEV_ID
  3128. * Bits 20:16
  3129. * Purpose: ID of the vdev to which this limit is applied
  3130. */
  3131. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3132. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3133. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3134. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3135. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3136. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3137. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3138. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3139. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3140. do { \
  3141. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3142. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3143. } while (0)
  3144. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3145. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3146. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3147. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3148. do { \
  3149. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3150. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3151. } while (0)
  3152. /**
  3153. * @brief HTT WDI_IPA Config Message
  3154. *
  3155. * @details
  3156. * The HTT WDI_IPA config message is created/sent by host at driver
  3157. * init time. It contains information about data structures used on
  3158. * WDI_IPA TX and RX path.
  3159. * TX CE ring is used for pushing packet metadata from IPA uC
  3160. * to WLAN FW
  3161. * TX Completion ring is used for generating TX completions from
  3162. * WLAN FW to IPA uC
  3163. * RX Indication ring is used for indicating RX packets from FW
  3164. * to IPA uC
  3165. * RX Ring2 is used as either completion ring or as second
  3166. * indication ring. when Ring2 is used as completion ring, IPA uC
  3167. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3168. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3169. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3170. * indicated in RX Indication ring. Please see WDI_IPA specification
  3171. * for more details.
  3172. * |31 24|23 16|15 8|7 0|
  3173. * |----------------+----------------+----------------+----------------|
  3174. * | tx pkt pool size | Rsvd | msg_type |
  3175. * |-------------------------------------------------------------------|
  3176. * | tx comp ring base (bits 31:0) |
  3177. #if HTT_PADDR64
  3178. * | tx comp ring base (bits 63:32) |
  3179. #endif
  3180. * |-------------------------------------------------------------------|
  3181. * | tx comp ring size |
  3182. * |-------------------------------------------------------------------|
  3183. * | tx comp WR_IDX physical address (bits 31:0) |
  3184. #if HTT_PADDR64
  3185. * | tx comp WR_IDX physical address (bits 63:32) |
  3186. #endif
  3187. * |-------------------------------------------------------------------|
  3188. * | tx CE WR_IDX physical address (bits 31:0) |
  3189. #if HTT_PADDR64
  3190. * | tx CE WR_IDX physical address (bits 63:32) |
  3191. #endif
  3192. * |-------------------------------------------------------------------|
  3193. * | rx indication ring base (bits 31:0) |
  3194. #if HTT_PADDR64
  3195. * | rx indication ring base (bits 63:32) |
  3196. #endif
  3197. * |-------------------------------------------------------------------|
  3198. * | rx indication ring size |
  3199. * |-------------------------------------------------------------------|
  3200. * | rx ind RD_IDX physical address (bits 31:0) |
  3201. #if HTT_PADDR64
  3202. * | rx ind RD_IDX physical address (bits 63:32) |
  3203. #endif
  3204. * |-------------------------------------------------------------------|
  3205. * | rx ind WR_IDX physical address (bits 31:0) |
  3206. #if HTT_PADDR64
  3207. * | rx ind WR_IDX physical address (bits 63:32) |
  3208. #endif
  3209. * |-------------------------------------------------------------------|
  3210. * |-------------------------------------------------------------------|
  3211. * | rx ring2 base (bits 31:0) |
  3212. #if HTT_PADDR64
  3213. * | rx ring2 base (bits 63:32) |
  3214. #endif
  3215. * |-------------------------------------------------------------------|
  3216. * | rx ring2 size |
  3217. * |-------------------------------------------------------------------|
  3218. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3219. #if HTT_PADDR64
  3220. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3221. #endif
  3222. * |-------------------------------------------------------------------|
  3223. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3224. #if HTT_PADDR64
  3225. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3226. #endif
  3227. * |-------------------------------------------------------------------|
  3228. *
  3229. * Header fields:
  3230. * Header fields:
  3231. * - MSG_TYPE
  3232. * Bits 7:0
  3233. * Purpose: Identifies this as WDI_IPA config message
  3234. * value: = 0x8
  3235. * - TX_PKT_POOL_SIZE
  3236. * Bits 15:0
  3237. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3238. * WDI_IPA TX path
  3239. * For systems using 32-bit format for bus addresses:
  3240. * - TX_COMP_RING_BASE_ADDR
  3241. * Bits 31:0
  3242. * Purpose: TX Completion Ring base address in DDR
  3243. * - TX_COMP_RING_SIZE
  3244. * Bits 31:0
  3245. * Purpose: TX Completion Ring size (must be power of 2)
  3246. * - TX_COMP_WR_IDX_ADDR
  3247. * Bits 31:0
  3248. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3249. * updates the Write Index for WDI_IPA TX completion ring
  3250. * - TX_CE_WR_IDX_ADDR
  3251. * Bits 31:0
  3252. * Purpose: DDR address where IPA uC
  3253. * updates the WR Index for TX CE ring
  3254. * (needed for fusion platforms)
  3255. * - RX_IND_RING_BASE_ADDR
  3256. * Bits 31:0
  3257. * Purpose: RX Indication Ring base address in DDR
  3258. * - RX_IND_RING_SIZE
  3259. * Bits 31:0
  3260. * Purpose: RX Indication Ring size
  3261. * - RX_IND_RD_IDX_ADDR
  3262. * Bits 31:0
  3263. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3264. * RX indication ring
  3265. * - RX_IND_WR_IDX_ADDR
  3266. * Bits 31:0
  3267. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3268. * updates the Write Index for WDI_IPA RX indication ring
  3269. * - RX_RING2_BASE_ADDR
  3270. * Bits 31:0
  3271. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3272. * - RX_RING2_SIZE
  3273. * Bits 31:0
  3274. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3275. * - RX_RING2_RD_IDX_ADDR
  3276. * Bits 31:0
  3277. * Purpose: If Second RX ring is Indication ring, DDR address where
  3278. * IPA uC updates the Read Index for Ring2.
  3279. * If Second RX ring is completion ring, this is NOT used
  3280. * - RX_RING2_WR_IDX_ADDR
  3281. * Bits 31:0
  3282. * Purpose: If Second RX ring is Indication ring, DDR address where
  3283. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3284. * If second RX ring is completion ring, DDR address where
  3285. * IPA uC updates the Write Index for Ring 2.
  3286. * For systems using 64-bit format for bus addresses:
  3287. * - TX_COMP_RING_BASE_ADDR_LO
  3288. * Bits 31:0
  3289. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3290. * - TX_COMP_RING_BASE_ADDR_HI
  3291. * Bits 31:0
  3292. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3293. * - TX_COMP_RING_SIZE
  3294. * Bits 31:0
  3295. * Purpose: TX Completion Ring size (must be power of 2)
  3296. * - TX_COMP_WR_IDX_ADDR_LO
  3297. * Bits 31:0
  3298. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3299. * Lower 4 bytes of DDR address where WIFI FW
  3300. * updates the Write Index for WDI_IPA TX completion ring
  3301. * - TX_COMP_WR_IDX_ADDR_HI
  3302. * Bits 31:0
  3303. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3304. * Higher 4 bytes of DDR address where WIFI FW
  3305. * updates the Write Index for WDI_IPA TX completion ring
  3306. * - TX_CE_WR_IDX_ADDR_LO
  3307. * Bits 31:0
  3308. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3309. * updates the WR Index for TX CE ring
  3310. * (needed for fusion platforms)
  3311. * - TX_CE_WR_IDX_ADDR_HI
  3312. * Bits 31:0
  3313. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3314. * updates the WR Index for TX CE ring
  3315. * (needed for fusion platforms)
  3316. * - RX_IND_RING_BASE_ADDR_LO
  3317. * Bits 31:0
  3318. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3319. * - RX_IND_RING_BASE_ADDR_HI
  3320. * Bits 31:0
  3321. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3322. * - RX_IND_RING_SIZE
  3323. * Bits 31:0
  3324. * Purpose: RX Indication Ring size
  3325. * - RX_IND_RD_IDX_ADDR_LO
  3326. * Bits 31:0
  3327. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3328. * for WDI_IPA RX indication ring
  3329. * - RX_IND_RD_IDX_ADDR_HI
  3330. * Bits 31:0
  3331. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3332. * for WDI_IPA RX indication ring
  3333. * - RX_IND_WR_IDX_ADDR_LO
  3334. * Bits 31:0
  3335. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3336. * Lower 4 bytes of DDR address where WIFI FW
  3337. * updates the Write Index for WDI_IPA RX indication ring
  3338. * - RX_IND_WR_IDX_ADDR_HI
  3339. * Bits 31:0
  3340. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3341. * Higher 4 bytes of DDR address where WIFI FW
  3342. * updates the Write Index for WDI_IPA RX indication ring
  3343. * - RX_RING2_BASE_ADDR_LO
  3344. * Bits 31:0
  3345. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3346. * - RX_RING2_BASE_ADDR_HI
  3347. * Bits 31:0
  3348. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3349. * - RX_RING2_SIZE
  3350. * Bits 31:0
  3351. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3352. * - RX_RING2_RD_IDX_ADDR_LO
  3353. * Bits 31:0
  3354. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3355. * DDR address where IPA uC updates the Read Index for Ring2.
  3356. * If Second RX ring is completion ring, this is NOT used
  3357. * - RX_RING2_RD_IDX_ADDR_HI
  3358. * Bits 31:0
  3359. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3360. * DDR address where IPA uC updates the Read Index for Ring2.
  3361. * If Second RX ring is completion ring, this is NOT used
  3362. * - RX_RING2_WR_IDX_ADDR_LO
  3363. * Bits 31:0
  3364. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3365. * DDR address where WIFI FW updates the Write Index
  3366. * for WDI_IPA RX ring2
  3367. * If second RX ring is completion ring, lower 4 bytes of
  3368. * DDR address where IPA uC updates the Write Index for Ring 2.
  3369. * - RX_RING2_WR_IDX_ADDR_HI
  3370. * Bits 31:0
  3371. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3372. * DDR address where WIFI FW updates the Write Index
  3373. * for WDI_IPA RX ring2
  3374. * If second RX ring is completion ring, higher 4 bytes of
  3375. * DDR address where IPA uC updates the Write Index for Ring 2.
  3376. */
  3377. #if HTT_PADDR64
  3378. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3379. #else
  3380. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3381. #endif
  3382. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3383. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3384. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3385. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3386. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3387. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3388. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3389. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3390. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3391. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3392. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3393. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3394. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3395. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3396. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3397. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3398. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3399. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3400. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3401. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3402. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3403. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3404. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3405. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3406. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3407. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3408. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3409. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3410. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3411. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3412. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3413. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3414. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3415. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3416. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3417. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3418. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3419. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3420. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3421. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3422. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3423. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3424. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3425. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3426. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3427. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3428. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3429. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3430. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3431. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3432. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3433. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3434. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3435. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3436. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3437. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3438. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3439. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3440. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3441. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3442. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3443. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3444. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3445. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3446. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3447. do { \
  3448. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3449. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3450. } while (0)
  3451. /* for systems using 32-bit format for bus addr */
  3452. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3453. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3454. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3455. do { \
  3456. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3457. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3458. } while (0)
  3459. /* for systems using 64-bit format for bus addr */
  3460. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3461. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3462. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3463. do { \
  3464. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3465. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3466. } while (0)
  3467. /* for systems using 64-bit format for bus addr */
  3468. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3469. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3470. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3471. do { \
  3472. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3473. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3474. } while (0)
  3475. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3476. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3477. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3478. do { \
  3479. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3480. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3481. } while (0)
  3482. /* for systems using 32-bit format for bus addr */
  3483. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3484. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3485. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3486. do { \
  3487. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3488. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3489. } while (0)
  3490. /* for systems using 64-bit format for bus addr */
  3491. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3492. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3493. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3494. do { \
  3495. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3496. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3497. } while (0)
  3498. /* for systems using 64-bit format for bus addr */
  3499. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3500. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3501. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3502. do { \
  3503. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3504. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3505. } while (0)
  3506. /* for systems using 32-bit format for bus addr */
  3507. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3508. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3509. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3510. do { \
  3511. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3512. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3513. } while (0)
  3514. /* for systems using 64-bit format for bus addr */
  3515. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3516. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3517. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3518. do { \
  3519. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3520. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3521. } while (0)
  3522. /* for systems using 64-bit format for bus addr */
  3523. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3524. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3525. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3526. do { \
  3527. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3528. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3529. } while (0)
  3530. /* for systems using 32-bit format for bus addr */
  3531. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3532. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3533. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3534. do { \
  3535. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3536. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3537. } while (0)
  3538. /* for systems using 64-bit format for bus addr */
  3539. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3540. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3541. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3542. do { \
  3543. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3544. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3545. } while (0)
  3546. /* for systems using 64-bit format for bus addr */
  3547. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3548. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3549. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3550. do { \
  3551. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3552. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3553. } while (0)
  3554. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3555. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3556. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3557. do { \
  3558. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3559. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3560. } while (0)
  3561. /* for systems using 32-bit format for bus addr */
  3562. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3563. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3564. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3565. do { \
  3566. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3567. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3568. } while (0)
  3569. /* for systems using 64-bit format for bus addr */
  3570. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3571. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3572. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3573. do { \
  3574. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3575. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3576. } while (0)
  3577. /* for systems using 64-bit format for bus addr */
  3578. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3579. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3580. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3581. do { \
  3582. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3583. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3584. } while (0)
  3585. /* for systems using 32-bit format for bus addr */
  3586. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3587. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3588. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3589. do { \
  3590. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3591. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3592. } while (0)
  3593. /* for systems using 64-bit format for bus addr */
  3594. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3595. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3596. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3597. do { \
  3598. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3599. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3600. } while (0)
  3601. /* for systems using 64-bit format for bus addr */
  3602. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3603. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3604. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3605. do { \
  3606. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3607. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3608. } while (0)
  3609. /* for systems using 32-bit format for bus addr */
  3610. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3611. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3612. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3613. do { \
  3614. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3615. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3616. } while (0)
  3617. /* for systems using 64-bit format for bus addr */
  3618. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3619. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3620. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3621. do { \
  3622. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3623. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3624. } while (0)
  3625. /* for systems using 64-bit format for bus addr */
  3626. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3627. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3628. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3629. do { \
  3630. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3631. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3632. } while (0)
  3633. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3634. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3635. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3636. do { \
  3637. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3638. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3639. } while (0)
  3640. /* for systems using 32-bit format for bus addr */
  3641. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3642. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3643. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3644. do { \
  3645. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3646. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3647. } while (0)
  3648. /* for systems using 64-bit format for bus addr */
  3649. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3650. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3651. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3652. do { \
  3653. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3654. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3655. } while (0)
  3656. /* for systems using 64-bit format for bus addr */
  3657. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3658. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3659. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3660. do { \
  3661. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3662. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3663. } while (0)
  3664. /* for systems using 32-bit format for bus addr */
  3665. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3666. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3667. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3668. do { \
  3669. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3670. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3671. } while (0)
  3672. /* for systems using 64-bit format for bus addr */
  3673. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3674. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3675. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3676. do { \
  3677. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3678. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3679. } while (0)
  3680. /* for systems using 64-bit format for bus addr */
  3681. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  3682. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  3683. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  3684. do { \
  3685. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  3686. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  3687. } while (0)
  3688. /*
  3689. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  3690. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  3691. * addresses are stored in a XXX-bit field.
  3692. * This macro is used to define both htt_wdi_ipa_config32_t and
  3693. * htt_wdi_ipa_config64_t structs.
  3694. */
  3695. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  3696. _paddr__tx_comp_ring_base_addr_, \
  3697. _paddr__tx_comp_wr_idx_addr_, \
  3698. _paddr__tx_ce_wr_idx_addr_, \
  3699. _paddr__rx_ind_ring_base_addr_, \
  3700. _paddr__rx_ind_rd_idx_addr_, \
  3701. _paddr__rx_ind_wr_idx_addr_, \
  3702. _paddr__rx_ring2_base_addr_,\
  3703. _paddr__rx_ring2_rd_idx_addr_,\
  3704. _paddr__rx_ring2_wr_idx_addr_) \
  3705. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  3706. { \
  3707. /* DWORD 0: flags and meta-data */ \
  3708. A_UINT32 \
  3709. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  3710. reserved: 8, \
  3711. tx_pkt_pool_size: 16;\
  3712. /* DWORD 1 */\
  3713. _paddr__tx_comp_ring_base_addr_;\
  3714. /* DWORD 2 (or 3)*/\
  3715. A_UINT32 tx_comp_ring_size;\
  3716. /* DWORD 3 (or 4)*/\
  3717. _paddr__tx_comp_wr_idx_addr_;\
  3718. /* DWORD 4 (or 6)*/\
  3719. _paddr__tx_ce_wr_idx_addr_;\
  3720. /* DWORD 5 (or 8)*/\
  3721. _paddr__rx_ind_ring_base_addr_;\
  3722. /* DWORD 6 (or 10)*/\
  3723. A_UINT32 rx_ind_ring_size;\
  3724. /* DWORD 7 (or 11)*/\
  3725. _paddr__rx_ind_rd_idx_addr_;\
  3726. /* DWORD 8 (or 13)*/\
  3727. _paddr__rx_ind_wr_idx_addr_;\
  3728. /* DWORD 9 (or 15)*/\
  3729. _paddr__rx_ring2_base_addr_;\
  3730. /* DWORD 10 (or 17) */\
  3731. A_UINT32 rx_ring2_size;\
  3732. /* DWORD 11 (or 18) */\
  3733. _paddr__rx_ring2_rd_idx_addr_;\
  3734. /* DWORD 12 (or 20) */\
  3735. _paddr__rx_ring2_wr_idx_addr_;\
  3736. } POSTPACK
  3737. /* define a htt_wdi_ipa_config32_t type */
  3738. 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));
  3739. /* define a htt_wdi_ipa_config64_t type */
  3740. 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));
  3741. #if HTT_PADDR64
  3742. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  3743. #else
  3744. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  3745. #endif
  3746. enum htt_wdi_ipa_op_code {
  3747. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  3748. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  3749. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  3750. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  3751. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  3752. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  3753. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  3754. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  3755. /* keep this last */
  3756. HTT_WDI_IPA_OPCODE_MAX
  3757. };
  3758. /**
  3759. * @brief HTT WDI_IPA Operation Request Message
  3760. *
  3761. * @details
  3762. * HTT WDI_IPA Operation Request message is sent by host
  3763. * to either suspend or resume WDI_IPA TX or RX path.
  3764. * |31 24|23 16|15 8|7 0|
  3765. * |----------------+----------------+----------------+----------------|
  3766. * | op_code | Rsvd | msg_type |
  3767. * |-------------------------------------------------------------------|
  3768. *
  3769. * Header fields:
  3770. * - MSG_TYPE
  3771. * Bits 7:0
  3772. * Purpose: Identifies this as WDI_IPA Operation Request message
  3773. * value: = 0x9
  3774. * - OP_CODE
  3775. * Bits 31:16
  3776. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  3777. * value: = enum htt_wdi_ipa_op_code
  3778. */
  3779. PREPACK struct htt_wdi_ipa_op_request_t
  3780. {
  3781. /* DWORD 0: flags and meta-data */
  3782. A_UINT32
  3783. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  3784. reserved: 8,
  3785. op_code: 16;
  3786. } POSTPACK;
  3787. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  3788. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  3789. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  3790. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  3791. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  3792. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  3793. do { \
  3794. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  3795. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  3796. } while (0)
  3797. /*
  3798. * @brief host -> target HTT_SRING_SETUP message
  3799. *
  3800. * @details
  3801. * After target is booted up, Host can send SRING setup message for
  3802. * each host facing LMAC SRING. Target setups up HW registers based
  3803. * on setup message and confirms back to Host if response_required is set.
  3804. * Host should wait for confirmation message before sending new SRING
  3805. * setup message
  3806. *
  3807. * The message would appear as follows:
  3808. * |31 24|23 20|19|18 16|15|14 8|7 0|
  3809. * |--------------- +-----------------+----------------+------------------|
  3810. * | ring_type | ring_id | pdev_id | msg_type |
  3811. * |----------------------------------------------------------------------|
  3812. * | ring_base_addr_lo |
  3813. * |----------------------------------------------------------------------|
  3814. * | ring_base_addr_hi |
  3815. * |----------------------------------------------------------------------|
  3816. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  3817. * |----------------------------------------------------------------------|
  3818. * | ring_head_offset32_remote_addr_lo |
  3819. * |----------------------------------------------------------------------|
  3820. * | ring_head_offset32_remote_addr_hi |
  3821. * |----------------------------------------------------------------------|
  3822. * | ring_tail_offset32_remote_addr_lo |
  3823. * |----------------------------------------------------------------------|
  3824. * | ring_tail_offset32_remote_addr_hi |
  3825. * |----------------------------------------------------------------------|
  3826. * | ring_msi_addr_lo |
  3827. * |----------------------------------------------------------------------|
  3828. * | ring_msi_addr_hi |
  3829. * |----------------------------------------------------------------------|
  3830. * | ring_msi_data |
  3831. * |----------------------------------------------------------------------|
  3832. * | intr_timer_th |IM| intr_batch_counter_th |
  3833. * |----------------------------------------------------------------------|
  3834. * | reserved |RR|PTCF| intr_low_threshold |
  3835. * |----------------------------------------------------------------------|
  3836. * Where
  3837. * IM = sw_intr_mode
  3838. * RR = response_required
  3839. * PTCF = prefetch_timer_cfg
  3840. *
  3841. * The message is interpreted as follows:
  3842. * dword0 - b'0:7 - msg_type: This will be set to
  3843. * HTT_H2T_MSG_TYPE_SRING_SETUP
  3844. * b'8:15 - pdev_id:
  3845. * 0 (for rings at SOC/UMAC level),
  3846. * 1/2/3 mac id (for rings at LMAC level)
  3847. * b'16:23 - ring_id: identify which ring is to setup,
  3848. * more details can be got from enum htt_srng_ring_id
  3849. * b'24:31 - ring_type: identify type of host rings,
  3850. * more details can be got from enum htt_srng_ring_type
  3851. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  3852. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  3853. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  3854. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  3855. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  3856. * SW_TO_HW_RING.
  3857. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  3858. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  3859. * Lower 32 bits of memory address of the remote variable
  3860. * storing the 4-byte word offset that identifies the head
  3861. * element within the ring.
  3862. * (The head offset variable has type A_UINT32.)
  3863. * Valid for HW_TO_SW and SW_TO_SW rings.
  3864. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  3865. * Upper 32 bits of memory address of the remote variable
  3866. * storing the 4-byte word offset that identifies the head
  3867. * element within the ring.
  3868. * (The head offset variable has type A_UINT32.)
  3869. * Valid for HW_TO_SW and SW_TO_SW rings.
  3870. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  3871. * Lower 32 bits of memory address of the remote variable
  3872. * storing the 4-byte word offset that identifies the tail
  3873. * element within the ring.
  3874. * (The tail offset variable has type A_UINT32.)
  3875. * Valid for HW_TO_SW and SW_TO_SW rings.
  3876. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  3877. * Upper 32 bits of memory address of the remote variable
  3878. * storing the 4-byte word offset that identifies the tail
  3879. * element within the ring.
  3880. * (The tail offset variable has type A_UINT32.)
  3881. * Valid for HW_TO_SW and SW_TO_SW rings.
  3882. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  3883. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3884. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  3885. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3886. * dword10 - b'0:31 - ring_msi_data: MSI data
  3887. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  3888. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3889. * dword11 - b'0:14 - intr_batch_counter_th:
  3890. * batch counter threshold is in units of 4-byte words.
  3891. * HW internally maintains and increments batch count.
  3892. * (see SRING spec for detail description).
  3893. * When batch count reaches threshold value, an interrupt
  3894. * is generated by HW.
  3895. * b'15 - sw_intr_mode:
  3896. * This configuration shall be static.
  3897. * Only programmed at power up.
  3898. * 0: generate pulse style sw interrupts
  3899. * 1: generate level style sw interrupts
  3900. * b'16:31 - intr_timer_th:
  3901. * The timer init value when timer is idle or is
  3902. * initialized to start downcounting.
  3903. * In 8us units (to cover a range of 0 to 524 ms)
  3904. * dword12 - b'0:15 - intr_low_threshold:
  3905. * Used only by Consumer ring to generate ring_sw_int_p.
  3906. * Ring entries low threshold water mark, that is used
  3907. * in combination with the interrupt timer as well as
  3908. * the the clearing of the level interrupt.
  3909. * b'16:18 - prefetch_timer_cfg:
  3910. * Used only by Consumer ring to set timer mode to
  3911. * support Application prefetch handling.
  3912. * The external tail offset/pointer will be updated
  3913. * at following intervals:
  3914. * 3'b000: (Prefetch feature disabled; used only for debug)
  3915. * 3'b001: 1 usec
  3916. * 3'b010: 4 usec
  3917. * 3'b011: 8 usec (default)
  3918. * 3'b100: 16 usec
  3919. * Others: Reserverd
  3920. * b'19 - response_required:
  3921. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  3922. * b'20:31 - reserved: reserved for future use
  3923. */
  3924. PREPACK struct htt_sring_setup_t {
  3925. A_UINT32 msg_type: 8,
  3926. pdev_id: 8,
  3927. ring_id: 8,
  3928. ring_type: 8;
  3929. A_UINT32 ring_base_addr_lo;
  3930. A_UINT32 ring_base_addr_hi;
  3931. A_UINT32 ring_size: 16,
  3932. ring_entry_size: 8,
  3933. ring_misc_cfg_flag: 8;
  3934. A_UINT32 ring_head_offset32_remote_addr_lo;
  3935. A_UINT32 ring_head_offset32_remote_addr_hi;
  3936. A_UINT32 ring_tail_offset32_remote_addr_lo;
  3937. A_UINT32 ring_tail_offset32_remote_addr_hi;
  3938. A_UINT32 ring_msi_addr_lo;
  3939. A_UINT32 ring_msi_addr_hi;
  3940. A_UINT32 ring_msi_data;
  3941. A_UINT32 intr_batch_counter_th: 15,
  3942. sw_intr_mode: 1,
  3943. intr_timer_th: 16;
  3944. A_UINT32 intr_low_threshold: 16,
  3945. prefetch_timer_cfg: 3,
  3946. response_required: 1,
  3947. reserved1: 12;
  3948. } POSTPACK;
  3949. enum htt_srng_ring_type {
  3950. HTT_HW_TO_SW_RING = 0,
  3951. HTT_SW_TO_HW_RING,
  3952. HTT_SW_TO_SW_RING,
  3953. /* Insert new ring types above this line */
  3954. };
  3955. enum htt_srng_ring_id {
  3956. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  3957. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  3958. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  3959. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  3960. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  3961. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  3962. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  3963. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  3964. /* Add Other SRING which can't be directly configured by host software above this line */
  3965. };
  3966. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  3967. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  3968. #define HTT_SRING_SETUP_PDEV_ID_S 8
  3969. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  3970. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  3971. HTT_SRING_SETUP_PDEV_ID_S)
  3972. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  3973. do { \
  3974. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  3975. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  3976. } while (0)
  3977. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  3978. #define HTT_SRING_SETUP_RING_ID_S 16
  3979. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  3980. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  3981. HTT_SRING_SETUP_RING_ID_S)
  3982. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  3983. do { \
  3984. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  3985. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  3986. } while (0)
  3987. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  3988. #define HTT_SRING_SETUP_RING_TYPE_S 24
  3989. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  3990. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  3991. HTT_SRING_SETUP_RING_TYPE_S)
  3992. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  3993. do { \
  3994. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  3995. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  3996. } while (0)
  3997. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  3998. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  3999. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4000. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4001. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4002. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4003. do { \
  4004. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4005. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4006. } while (0)
  4007. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4008. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4009. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4010. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4011. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4012. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4013. do { \
  4014. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4015. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4016. } while (0)
  4017. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4018. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4019. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4020. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4021. HTT_SRING_SETUP_RING_SIZE_S)
  4022. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4023. do { \
  4024. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4025. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4026. } while (0)
  4027. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4028. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4029. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4030. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4031. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4032. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4033. do { \
  4034. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4035. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4036. } while (0)
  4037. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4038. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4039. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4040. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4041. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4042. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4043. do { \
  4044. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4045. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4046. } while (0)
  4047. /* This control bit is applicable to only Producer, which updates Ring ID field
  4048. * of each descriptor before pushing into the ring.
  4049. * 0: updates ring_id(default)
  4050. * 1: ring_id updating disabled */
  4051. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4052. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4053. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4054. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4055. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4056. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4057. do { \
  4058. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4059. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4060. } while (0)
  4061. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4062. * of each descriptor before pushing into the ring.
  4063. * 0: updates Loopcnt(default)
  4064. * 1: Loopcnt updating disabled */
  4065. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4066. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4067. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4068. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4069. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4070. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4071. do { \
  4072. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4073. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4074. } while (0)
  4075. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4076. * into security_id port of GXI/AXI. */
  4077. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4078. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4079. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4080. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4081. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4082. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4083. do { \
  4084. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4085. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4086. } while (0)
  4087. /* During MSI write operation, SRNG drives value of this register bit into
  4088. * swap bit of GXI/AXI. */
  4089. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4090. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4091. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4092. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4093. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4094. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4095. do { \
  4096. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4097. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4098. } while (0)
  4099. /* During Pointer write operation, SRNG drives value of this register bit into
  4100. * swap bit of GXI/AXI. */
  4101. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4102. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4103. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4104. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4105. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4106. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4107. do { \
  4108. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4109. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4110. } while (0)
  4111. /* During any data or TLV write operation, SRNG drives value of this register
  4112. * bit into swap bit of GXI/AXI. */
  4113. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4114. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4115. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4116. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4117. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4118. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4119. do { \
  4120. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4121. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4122. } while (0)
  4123. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4124. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4125. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4126. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4127. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4128. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4129. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4130. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4131. do { \
  4132. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4133. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4134. } while (0)
  4135. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4136. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4137. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4138. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4139. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4140. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4141. do { \
  4142. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4143. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4144. } while (0)
  4145. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4146. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4147. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4148. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4149. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4150. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4151. do { \
  4152. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4153. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4154. } while (0)
  4155. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4156. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4157. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4158. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4159. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4160. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4161. do { \
  4162. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4163. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4164. } while (0)
  4165. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4166. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4167. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4168. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4169. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4170. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4171. do { \
  4172. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4173. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4174. } while (0)
  4175. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4176. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4177. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4178. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4179. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4180. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4181. do { \
  4182. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4183. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4184. } while (0)
  4185. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4186. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4187. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4188. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4189. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4190. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4191. do { \
  4192. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4193. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4194. } while (0)
  4195. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4196. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4197. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4198. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4199. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4200. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4201. do { \
  4202. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4203. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4204. } while (0)
  4205. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4206. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4207. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4208. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4209. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4210. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4211. do { \
  4212. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4213. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4214. } while (0)
  4215. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4216. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4217. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4218. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4219. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4220. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4221. do { \
  4222. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4223. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4224. } while (0)
  4225. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4226. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4227. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4228. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4229. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4230. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4231. do { \
  4232. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4233. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4234. } while (0)
  4235. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4236. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4237. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4238. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4239. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4240. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4241. do { \
  4242. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4243. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4244. } while (0)
  4245. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4246. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4247. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4248. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4249. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4250. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4251. do { \
  4252. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4253. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4254. } while (0)
  4255. /**
  4256. * @brief HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG Message
  4257. *
  4258. * @details
  4259. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4260. * configure RXDMA rings.
  4261. * The configuration is per ring based and includes both packet subtypes
  4262. * and PPDU/MPDU TLVs.
  4263. *
  4264. * The message would appear as follows:
  4265. *
  4266. * |31 26|25|24|23 16|15 8|7 0|
  4267. * |-----------------+----------------+----------------+---------------|
  4268. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  4269. * |-------------------------------------------------------------------|
  4270. * | rsvd2 | ring_buffer_size |
  4271. * |-------------------------------------------------------------------|
  4272. * | packet_type_enable_flags_0 |
  4273. * |-------------------------------------------------------------------|
  4274. * | packet_type_enable_flags_1 |
  4275. * |-------------------------------------------------------------------|
  4276. * | packet_type_enable_flags_2 |
  4277. * |-------------------------------------------------------------------|
  4278. * | packet_type_enable_flags_3 |
  4279. * |-------------------------------------------------------------------|
  4280. * | tlv_filter_in_flags |
  4281. * |-------------------------------------------------------------------|
  4282. * Where:
  4283. * PS = pkt_swap
  4284. * SS = status_swap
  4285. * The message is interpreted as follows:
  4286. * dword0 - b'0:7 - msg_type: This will be set to
  4287. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4288. * b'8:15 - pdev_id:
  4289. * 0 (for rings at SOC/UMAC level),
  4290. * 1/2/3 mac id (for rings at LMAC level)
  4291. * b'16:23 - ring_id : Identify the ring to configure.
  4292. * More details can be got from enum htt_srng_ring_id
  4293. * b'24 - status_swap: 1 is to swap status TLV
  4294. * b'25 - pkt_swap: 1 is to swap packet TLV
  4295. * b'26:31 - rsvd1: reserved for future use
  4296. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4297. * in byte units.
  4298. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4299. * - b'16:31 - rsvd2: Reserved for future use
  4300. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4301. * Enable MGMT packet from 0b0000 to 0b1001
  4302. * bits from low to high: FP, MD, MO - 3 bits
  4303. * FP: Filter_Pass
  4304. * MD: Monitor_Direct
  4305. * MO: Monitor_Other
  4306. * 10 mgmt subtypes * 3 bits -> 30 bits
  4307. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4308. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4309. * Enable MGMT packet from 0b1010 to 0b1111
  4310. * bits from low to high: FP, MD, MO - 3 bits
  4311. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4312. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4313. * Enable CTRL packet from 0b0000 to 0b1001
  4314. * bits from low to high: FP, MD, MO - 3 bits
  4315. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4316. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4317. * Enable CTRL packet from 0b1010 to 0b1111,
  4318. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4319. * bits from low to high: FP, MD, MO - 3 bits
  4320. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4321. * dword6 - b'0:31 - tlv_filter_in_flags:
  4322. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4323. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4324. */
  4325. PREPACK struct htt_rx_ring_selection_cfg_t {
  4326. A_UINT32 msg_type: 8,
  4327. pdev_id: 8,
  4328. ring_id: 8,
  4329. status_swap: 1,
  4330. pkt_swap: 1,
  4331. rsvd1: 6;
  4332. A_UINT32 ring_buffer_size: 16,
  4333. rsvd2: 16;
  4334. A_UINT32 packet_type_enable_flags_0;
  4335. A_UINT32 packet_type_enable_flags_1;
  4336. A_UINT32 packet_type_enable_flags_2;
  4337. A_UINT32 packet_type_enable_flags_3;
  4338. A_UINT32 tlv_filter_in_flags;
  4339. } POSTPACK;
  4340. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4341. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4342. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4343. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4344. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4345. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4346. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4347. do { \
  4348. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4349. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4350. } while (0)
  4351. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4352. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4353. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4354. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4355. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4356. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4357. do { \
  4358. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4359. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4360. } while (0)
  4361. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4362. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4363. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4364. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4365. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4366. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4367. do { \
  4368. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  4369. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4370. } while (0)
  4371. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4372. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4373. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4374. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4375. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4376. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4377. do { \
  4378. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  4379. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4380. } while (0)
  4381. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4382. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4383. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4384. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4385. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4386. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4387. do { \
  4388. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  4389. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4390. } while (0)
  4391. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4392. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4393. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4394. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4395. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4396. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4397. do { \
  4398. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  4399. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4400. } while (0)
  4401. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4402. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4403. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4404. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4405. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4406. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4407. do { \
  4408. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  4409. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4410. } while (0)
  4411. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4412. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4413. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4414. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4415. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4416. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4417. do { \
  4418. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  4419. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4420. } while (0)
  4421. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4422. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4423. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4424. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4425. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4426. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4427. do { \
  4428. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  4429. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4430. } while (0)
  4431. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4432. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4433. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4434. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4435. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4436. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4437. do { \
  4438. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4439. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4440. } while (0)
  4441. /*
  4442. * Subtype based MGMT frames enable bits.
  4443. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4444. */
  4445. /* association request */
  4446. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  4447. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4448. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  4449. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4450. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  4451. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4452. /* association response */
  4453. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  4454. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4455. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  4456. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4457. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  4458. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4459. /* Reassociation request */
  4460. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  4461. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  4462. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  4463. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  4464. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  4465. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  4466. /* Reassociation response */
  4467. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  4468. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  4469. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  4470. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  4471. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  4472. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  4473. /* Probe request */
  4474. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  4475. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  4476. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  4477. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  4478. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  4479. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  4480. /* Probe response */
  4481. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  4482. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  4483. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  4484. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  4485. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  4486. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  4487. /* Timing Advertisement */
  4488. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  4489. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  4490. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  4491. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  4492. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  4493. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  4494. /* Reserved */
  4495. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  4496. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  4497. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  4498. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  4499. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  4500. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  4501. /* Beacon */
  4502. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000001
  4503. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  4504. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000001
  4505. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  4506. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x00000001
  4507. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  4508. /* ATIM */
  4509. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x00000001
  4510. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  4511. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x00000001
  4512. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  4513. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x00000001
  4514. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  4515. /* Disassociation */
  4516. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  4517. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  4518. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  4519. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  4520. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  4521. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  4522. /* Authentication */
  4523. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  4524. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  4525. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  4526. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  4527. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  4528. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  4529. /* Deauthentication */
  4530. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  4531. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  4532. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  4533. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  4534. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  4535. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  4536. /* Action */
  4537. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  4538. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  4539. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  4540. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  4541. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  4542. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  4543. /* Action No Ack */
  4544. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  4545. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  4546. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  4547. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  4548. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  4549. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  4550. /* Reserved */
  4551. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  4552. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  4553. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  4554. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  4555. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  4556. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  4557. /*
  4558. * Subtype based CTRL frames enable bits.
  4559. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  4560. */
  4561. /* Reserved */
  4562. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  4563. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  4564. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  4565. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  4566. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  4567. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  4568. /* Reserved */
  4569. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  4570. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  4571. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  4572. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  4573. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  4574. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  4575. /* Reserved */
  4576. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  4577. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  4578. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  4579. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  4580. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  4581. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  4582. /* Reserved */
  4583. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  4584. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  4585. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  4586. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  4587. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  4588. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  4589. /* Reserved */
  4590. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  4591. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  4592. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  4593. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  4594. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  4595. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  4596. /* Reserved */
  4597. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  4598. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  4599. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  4600. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  4601. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  4602. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  4603. /* Reserved */
  4604. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  4605. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  4606. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  4607. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  4608. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  4609. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  4610. /* Control Wrapper */
  4611. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  4612. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  4613. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  4614. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  4615. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  4616. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  4617. /* Block Ack Request */
  4618. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  4619. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  4620. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  4621. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  4622. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  4623. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  4624. /* Block Ack*/
  4625. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  4626. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  4627. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  4628. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  4629. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  4630. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  4631. /* PS-POLL */
  4632. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  4633. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  4634. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  4635. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  4636. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  4637. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  4638. /* RTS */
  4639. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  4640. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  4641. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  4642. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  4643. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  4644. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  4645. /* CTS */
  4646. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  4647. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  4648. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  4649. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  4650. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  4651. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  4652. /* ACK */
  4653. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  4654. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  4655. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  4656. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  4657. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  4658. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  4659. /* CF-END */
  4660. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  4661. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  4662. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  4663. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  4664. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  4665. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  4666. /* CF-END + CF-ACK */
  4667. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  4668. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  4669. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  4670. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  4671. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  4672. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  4673. /* Multicast data */
  4674. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  4675. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  4676. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  4677. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  4678. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  4679. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  4680. /* Unicast data */
  4681. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  4682. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  4683. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  4684. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  4685. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  4686. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  4687. /* NULL data */
  4688. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  4689. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  4690. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  4691. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  4692. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  4693. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  4694. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  4695. do { \
  4696. HTT_CHECK_SET_VAL(httsym, value); \
  4697. (word) |= (value) << httsym##_S; \
  4698. } while (0)
  4699. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  4700. (((word) & httsym##_M) >> httsym##_S)
  4701. #define htt_rx_ring_pkt_enable_subtype_set( \
  4702. word, flag, mode, type, subtype, val) \
  4703. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  4704. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  4705. #define htt_rx_ring_pkt_enable_subtype_get( \
  4706. word, flag, mode, type, subtype) \
  4707. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  4708. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  4709. /* Definition to filter in TLVs */
  4710. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  4711. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  4712. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  4713. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  4714. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  4715. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  4716. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  4717. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  4718. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  4719. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  4720. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  4721. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  4722. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  4723. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  4724. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  4725. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  4726. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  4727. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  4728. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  4729. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  4730. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  4731. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  4732. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  4733. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  4734. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  4735. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  4736. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  4737. do { \
  4738. HTT_CHECK_SET_VAL(httsym, enable); \
  4739. (word) |= (enable) << httsym##_S; \
  4740. } while (0)
  4741. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  4742. (((word) & httsym##_M) >> httsym##_S)
  4743. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  4744. HTT_RX_RING_TLV_ENABLE_SET( \
  4745. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  4746. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  4747. HTT_RX_RING_TLV_ENABLE_GET( \
  4748. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  4749. /**
  4750. * @brief HTT_H2T_MSG_TYPE_RFS_CONFIG
  4751. * host --> target Receive Flow Steering configuration message definition.
  4752. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  4753. * The reason for this is we want RFS to be configured and ready before MAC
  4754. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  4755. *
  4756. * |31 24|23 16|15 9|8|7 0|
  4757. * |----------------+----------------+----------------+----------------|
  4758. * | reserved |E| msg type |
  4759. * |-------------------------------------------------------------------|
  4760. * Where E = RFS enable flag
  4761. *
  4762. * The RFS_CONFIG message consists of a single 4-byte word.
  4763. *
  4764. * Header fields:
  4765. * - MSG_TYPE
  4766. * Bits 7:0
  4767. * Purpose: identifies this as a RFS config msg
  4768. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  4769. * - RFS_CONFIG
  4770. * Bit 8
  4771. * Purpose: Tells target whether to enable (1) or disable (0)
  4772. * flow steering feature when sending rx indication messages to host
  4773. */
  4774. #define HTT_H2T_RFS_CONFIG_M 0x100
  4775. #define HTT_H2T_RFS_CONFIG_S 8
  4776. #define HTT_RX_RFS_CONFIG_GET(_var) \
  4777. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  4778. HTT_H2T_RFS_CONFIG_S)
  4779. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  4780. do { \
  4781. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  4782. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  4783. } while (0)
  4784. #define HTT_RFS_CFG_REQ_BYTES 4
  4785. /**
  4786. * @brief host -> target FW extended statistics retrieve
  4787. *
  4788. * @details
  4789. * The following field definitions describe the format of the HTT host
  4790. * to target FW extended stats retrieve message.
  4791. * The message specifies the type of stats the host wants to retrieve.
  4792. *
  4793. * |31 24|23 16|15 8|7 0|
  4794. * |-----------------------------------------------------------|
  4795. * | reserved | stats type | pdev_mask | msg type |
  4796. * |-----------------------------------------------------------|
  4797. * | config param [0] |
  4798. * |-----------------------------------------------------------|
  4799. * | config param [1] |
  4800. * |-----------------------------------------------------------|
  4801. * | config param [2] |
  4802. * |-----------------------------------------------------------|
  4803. * | config param [3] |
  4804. * |-----------------------------------------------------------|
  4805. * | reserved |
  4806. * |-----------------------------------------------------------|
  4807. * | cookie LSBs |
  4808. * |-----------------------------------------------------------|
  4809. * | cookie MSBs |
  4810. * |-----------------------------------------------------------|
  4811. * Header fields:
  4812. * - MSG_TYPE
  4813. * Bits 7:0
  4814. * Purpose: identifies this is a extended stats upload request message
  4815. * Value: 0x10
  4816. * - PDEV_MASK
  4817. * Bits 8:15
  4818. * Purpose: identifies the mask of PDEVs to retrieve stats from
  4819. * Value: This is a overloaded field, refer to usage and interpretation of
  4820. * PDEV in interface document.
  4821. * Bit 8 : Reserved for SOC stats
  4822. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  4823. * Indicates MACID_MASK in DBS
  4824. * - STATS_TYPE
  4825. * Bits 23:16
  4826. * Purpose: identifies which FW statistics to upload
  4827. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  4828. * - Reserved
  4829. * Bits 31:24
  4830. * - CONFIG_PARAM [0]
  4831. * Bits 31:0
  4832. * Purpose: give an opaque configuration value to the specified stats type
  4833. * Value: stats-type specific configuration value
  4834. * Refer to htt_stats.h for interpretation for each stats sub_type
  4835. * - CONFIG_PARAM [1]
  4836. * Bits 31:0
  4837. * Purpose: give an opaque configuration value to the specified stats type
  4838. * Value: stats-type specific configuration value
  4839. * Refer to htt_stats.h for interpretation for each stats sub_type
  4840. * - CONFIG_PARAM [2]
  4841. * Bits 31:0
  4842. * Purpose: give an opaque configuration value to the specified stats type
  4843. * Value: stats-type specific configuration value
  4844. * Refer to htt_stats.h for interpretation for each stats sub_type
  4845. * - CONFIG_PARAM [3]
  4846. * Bits 31:0
  4847. * Purpose: give an opaque configuration value to the specified stats type
  4848. * Value: stats-type specific configuration value
  4849. * Refer to htt_stats.h for interpretation for each stats sub_type
  4850. * - Reserved [31:0] for future use.
  4851. * - COOKIE_LSBS
  4852. * Bits 31:0
  4853. * Purpose: Provide a mechanism to match a target->host stats confirmation
  4854. * message with its preceding host->target stats request message.
  4855. * Value: LSBs of the opaque cookie specified by the host-side requestor
  4856. * - COOKIE_MSBS
  4857. * Bits 31:0
  4858. * Purpose: Provide a mechanism to match a target->host stats confirmation
  4859. * message with its preceding host->target stats request message.
  4860. * Value: MSBs of the opaque cookie specified by the host-side requestor
  4861. */
  4862. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  4863. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  4864. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  4865. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  4866. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  4867. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  4868. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  4869. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  4870. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  4871. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  4872. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  4873. do { \
  4874. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  4875. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  4876. } while (0)
  4877. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  4878. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  4879. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  4880. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  4881. do { \
  4882. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  4883. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  4884. } while (0)
  4885. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  4886. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  4887. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  4888. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  4889. do { \
  4890. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  4891. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  4892. } while (0)
  4893. /**
  4894. * @brief host -> target FW PPDU_STATS request message
  4895. *
  4896. * @details
  4897. * The following field definitions describe the format of the HTT host
  4898. * to target FW for PPDU_STATS_CFG msg.
  4899. * The message allows the host to configure the PPDU_STATS_IND messages
  4900. * produced by the target.
  4901. *
  4902. * |31 24|23 16|15 8|7 0|
  4903. * |-----------------------------------------------------------|
  4904. * | REQ bit mask | pdev_mask | msg type |
  4905. * |-----------------------------------------------------------|
  4906. * Header fields:
  4907. * - MSG_TYPE
  4908. * Bits 7:0
  4909. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  4910. * Value: 0x11
  4911. * - PDEV_MASK
  4912. * Bits 8:15
  4913. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  4914. * Value: This is a overloaded field, refer to usage and interpretation of
  4915. * PDEV in interface document.
  4916. * Bit 8 : Reserved for SOC stats
  4917. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  4918. * Indicates MACID_MASK in DBS
  4919. * - REQ_TLV_BIT_MASK
  4920. * Bits 16:31
  4921. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  4922. * needs to be included in the target's PPDU_STATS_IND messages.
  4923. * Value: refer htt_ppdu_stats_tlv_tag_t
  4924. *
  4925. */
  4926. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  4927. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  4928. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  4929. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  4930. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  4931. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  4932. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  4933. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  4934. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  4935. do { \
  4936. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  4937. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  4938. } while (0)
  4939. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  4940. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  4941. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  4942. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  4943. do { \
  4944. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  4945. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  4946. } while (0)
  4947. /*=== target -> host messages ===============================================*/
  4948. enum htt_t2h_msg_type {
  4949. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  4950. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  4951. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  4952. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  4953. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  4954. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  4955. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  4956. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  4957. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  4958. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  4959. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  4960. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  4961. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  4962. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  4963. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  4964. /* only used for HL, add HTT MSG for HTT CREDIT update */
  4965. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  4966. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  4967. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  4968. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  4969. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  4970. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  4971. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  4972. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  4973. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  4974. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  4975. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  4976. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  4977. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  4978. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  4979. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  4980. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  4981. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  4982. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  4983. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  4984. HTT_T2H_MSG_TYPE_TEST,
  4985. /* keep this last */
  4986. HTT_T2H_NUM_MSGS
  4987. };
  4988. /*
  4989. * HTT target to host message type -
  4990. * stored in bits 7:0 of the first word of the message
  4991. */
  4992. #define HTT_T2H_MSG_TYPE_M 0xff
  4993. #define HTT_T2H_MSG_TYPE_S 0
  4994. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  4995. do { \
  4996. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  4997. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  4998. } while (0)
  4999. #define HTT_T2H_MSG_TYPE_GET(word) \
  5000. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  5001. /**
  5002. * @brief target -> host version number confirmation message definition
  5003. *
  5004. * |31 24|23 16|15 8|7 0|
  5005. * |----------------+----------------+----------------+----------------|
  5006. * | reserved | major number | minor number | msg type |
  5007. * |-------------------------------------------------------------------|
  5008. * : option request TLV (optional) |
  5009. * :...................................................................:
  5010. *
  5011. * The VER_CONF message may consist of a single 4-byte word, or may be
  5012. * extended with TLVs that specify HTT options selected by the target.
  5013. * The following option TLVs may be appended to the VER_CONF message:
  5014. * - LL_BUS_ADDR_SIZE
  5015. * - HL_SUPPRESS_TX_COMPL_IND
  5016. * - MAX_TX_QUEUE_GROUPS
  5017. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  5018. * may be appended to the VER_CONF message (but only one TLV of each type).
  5019. *
  5020. * Header fields:
  5021. * - MSG_TYPE
  5022. * Bits 7:0
  5023. * Purpose: identifies this as a version number confirmation message
  5024. * Value: 0x0
  5025. * - VER_MINOR
  5026. * Bits 15:8
  5027. * Purpose: Specify the minor number of the HTT message library version
  5028. * in use by the target firmware.
  5029. * The minor number specifies the specific revision within a range
  5030. * of fundamentally compatible HTT message definition revisions.
  5031. * Compatible revisions involve adding new messages or perhaps
  5032. * adding new fields to existing messages, in a backwards-compatible
  5033. * manner.
  5034. * Incompatible revisions involve changing the message type values,
  5035. * or redefining existing messages.
  5036. * Value: minor number
  5037. * - VER_MAJOR
  5038. * Bits 15:8
  5039. * Purpose: Specify the major number of the HTT message library version
  5040. * in use by the target firmware.
  5041. * The major number specifies the family of minor revisions that are
  5042. * fundamentally compatible with each other, but not with prior or
  5043. * later families.
  5044. * Value: major number
  5045. */
  5046. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  5047. #define HTT_VER_CONF_MINOR_S 8
  5048. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  5049. #define HTT_VER_CONF_MAJOR_S 16
  5050. #define HTT_VER_CONF_MINOR_SET(word, value) \
  5051. do { \
  5052. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  5053. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  5054. } while (0)
  5055. #define HTT_VER_CONF_MINOR_GET(word) \
  5056. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  5057. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  5058. do { \
  5059. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  5060. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  5061. } while (0)
  5062. #define HTT_VER_CONF_MAJOR_GET(word) \
  5063. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  5064. #define HTT_VER_CONF_BYTES 4
  5065. /**
  5066. * @brief - target -> host HTT Rx In order indication message
  5067. *
  5068. * @details
  5069. *
  5070. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  5071. * |----------------+-------------------+---------------------+---------------|
  5072. * | peer ID | P| F| O| ext TID | msg type |
  5073. * |--------------------------------------------------------------------------|
  5074. * | MSDU count | Reserved | vdev id |
  5075. * |--------------------------------------------------------------------------|
  5076. * | MSDU 0 bus address (bits 31:0) |
  5077. #if HTT_PADDR64
  5078. * | MSDU 0 bus address (bits 63:32) |
  5079. #endif
  5080. * |--------------------------------------------------------------------------|
  5081. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  5082. * |--------------------------------------------------------------------------|
  5083. * | MSDU 1 bus address (bits 31:0) |
  5084. #if HTT_PADDR64
  5085. * | MSDU 1 bus address (bits 63:32) |
  5086. #endif
  5087. * |--------------------------------------------------------------------------|
  5088. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  5089. * |--------------------------------------------------------------------------|
  5090. */
  5091. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  5092. *
  5093. * @details
  5094. * bits
  5095. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  5096. * |-----+----+-------+--------+--------+---------+---------+-----------|
  5097. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  5098. * | | frag | | | | fail |chksum fail|
  5099. * |-----+----+-------+--------+--------+---------+---------+-----------|
  5100. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  5101. */
  5102. struct htt_rx_in_ord_paddr_ind_hdr_t
  5103. {
  5104. A_UINT32 /* word 0 */
  5105. msg_type: 8,
  5106. ext_tid: 5,
  5107. offload: 1,
  5108. frag: 1,
  5109. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  5110. peer_id: 16;
  5111. A_UINT32 /* word 1 */
  5112. vap_id: 8,
  5113. reserved_1: 8,
  5114. msdu_cnt: 16;
  5115. };
  5116. struct htt_rx_in_ord_paddr_ind_msdu32_t
  5117. {
  5118. A_UINT32 dma_addr;
  5119. A_UINT32
  5120. length: 16,
  5121. fw_desc: 8,
  5122. msdu_info:8;
  5123. };
  5124. struct htt_rx_in_ord_paddr_ind_msdu64_t
  5125. {
  5126. A_UINT32 dma_addr_lo;
  5127. A_UINT32 dma_addr_hi;
  5128. A_UINT32
  5129. length: 16,
  5130. fw_desc: 8,
  5131. msdu_info:8;
  5132. };
  5133. #if HTT_PADDR64
  5134. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  5135. #else
  5136. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  5137. #endif
  5138. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  5139. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  5140. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  5141. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  5142. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  5143. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  5144. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  5145. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  5146. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  5147. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  5148. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  5149. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  5150. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  5151. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  5152. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  5153. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  5154. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  5155. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  5156. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  5157. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  5158. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  5159. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  5160. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  5161. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  5162. /* for systems using 64-bit format for bus addresses */
  5163. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  5164. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  5165. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  5166. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  5167. /* for systems using 32-bit format for bus addresses */
  5168. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  5169. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  5170. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  5171. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  5172. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  5173. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  5174. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  5175. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  5176. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  5177. do { \
  5178. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  5179. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  5180. } while (0)
  5181. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  5182. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  5183. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  5184. do { \
  5185. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  5186. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  5187. } while (0)
  5188. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  5189. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  5190. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  5191. do { \
  5192. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  5193. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  5194. } while (0)
  5195. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  5196. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  5197. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  5198. do { \
  5199. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  5200. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  5201. } while (0)
  5202. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  5203. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  5204. /* for systems using 64-bit format for bus addresses */
  5205. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  5206. do { \
  5207. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  5208. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  5209. } while (0)
  5210. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  5211. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  5212. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  5213. do { \
  5214. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  5215. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  5216. } while (0)
  5217. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  5218. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  5219. /* for systems using 32-bit format for bus addresses */
  5220. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  5221. do { \
  5222. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  5223. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  5224. } while (0)
  5225. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  5226. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  5227. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  5228. do { \
  5229. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  5230. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  5231. } while (0)
  5232. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  5233. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  5234. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  5235. do { \
  5236. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  5237. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  5238. } while (0)
  5239. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  5240. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  5241. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  5242. do { \
  5243. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  5244. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  5245. } while (0)
  5246. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  5247. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  5248. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  5249. do { \
  5250. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  5251. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  5252. } while (0)
  5253. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  5254. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  5255. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  5256. do { \
  5257. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  5258. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  5259. } while (0)
  5260. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  5261. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  5262. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  5263. do { \
  5264. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  5265. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  5266. } while (0)
  5267. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  5268. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  5269. /* definitions used within target -> host rx indication message */
  5270. PREPACK struct htt_rx_ind_hdr_prefix_t
  5271. {
  5272. A_UINT32 /* word 0 */
  5273. msg_type: 8,
  5274. ext_tid: 5,
  5275. release_valid: 1,
  5276. flush_valid: 1,
  5277. reserved0: 1,
  5278. peer_id: 16;
  5279. A_UINT32 /* word 1 */
  5280. flush_start_seq_num: 6,
  5281. flush_end_seq_num: 6,
  5282. release_start_seq_num: 6,
  5283. release_end_seq_num: 6,
  5284. num_mpdu_ranges: 8;
  5285. } POSTPACK;
  5286. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  5287. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  5288. #define HTT_TGT_RSSI_INVALID 0x80
  5289. PREPACK struct htt_rx_ppdu_desc_t
  5290. {
  5291. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  5292. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  5293. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  5294. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  5295. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  5296. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  5297. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  5298. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  5299. A_UINT32 /* word 0 */
  5300. rssi_cmb: 8,
  5301. timestamp_submicrosec: 8,
  5302. phy_err_code: 8,
  5303. phy_err: 1,
  5304. legacy_rate: 4,
  5305. legacy_rate_sel: 1,
  5306. end_valid: 1,
  5307. start_valid: 1;
  5308. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  5309. union {
  5310. A_UINT32 /* word 1 */
  5311. rssi0_pri20: 8,
  5312. rssi0_ext20: 8,
  5313. rssi0_ext40: 8,
  5314. rssi0_ext80: 8;
  5315. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  5316. } u0;
  5317. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  5318. union {
  5319. A_UINT32 /* word 2 */
  5320. rssi1_pri20: 8,
  5321. rssi1_ext20: 8,
  5322. rssi1_ext40: 8,
  5323. rssi1_ext80: 8;
  5324. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  5325. } u1;
  5326. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  5327. union {
  5328. A_UINT32 /* word 3 */
  5329. rssi2_pri20: 8,
  5330. rssi2_ext20: 8,
  5331. rssi2_ext40: 8,
  5332. rssi2_ext80: 8;
  5333. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  5334. } u2;
  5335. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  5336. union {
  5337. A_UINT32 /* word 4 */
  5338. rssi3_pri20: 8,
  5339. rssi3_ext20: 8,
  5340. rssi3_ext40: 8,
  5341. rssi3_ext80: 8;
  5342. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  5343. } u3;
  5344. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  5345. A_UINT32 tsf32; /* word 5 */
  5346. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  5347. A_UINT32 timestamp_microsec; /* word 6 */
  5348. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  5349. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  5350. A_UINT32 /* word 7 */
  5351. vht_sig_a1: 24,
  5352. preamble_type: 8;
  5353. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  5354. A_UINT32 /* word 8 */
  5355. vht_sig_a2: 24,
  5356. reserved0: 8;
  5357. } POSTPACK;
  5358. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  5359. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  5360. PREPACK struct htt_rx_ind_hdr_suffix_t
  5361. {
  5362. A_UINT32 /* word 0 */
  5363. fw_rx_desc_bytes: 16,
  5364. reserved0: 16;
  5365. } POSTPACK;
  5366. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  5367. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  5368. PREPACK struct htt_rx_ind_hdr_t
  5369. {
  5370. struct htt_rx_ind_hdr_prefix_t prefix;
  5371. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  5372. struct htt_rx_ind_hdr_suffix_t suffix;
  5373. } POSTPACK;
  5374. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  5375. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  5376. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  5377. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  5378. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  5379. /*
  5380. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  5381. * the offset into the HTT rx indication message at which the
  5382. * FW rx PPDU descriptor resides
  5383. */
  5384. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  5385. /*
  5386. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  5387. * the offset into the HTT rx indication message at which the
  5388. * header suffix (FW rx MSDU byte count) resides
  5389. */
  5390. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  5391. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  5392. /*
  5393. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  5394. * the offset into the HTT rx indication message at which the per-MSDU
  5395. * information starts
  5396. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  5397. * per-MSDU information portion of the message. The per-MSDU info itself
  5398. * starts at byte 12.
  5399. */
  5400. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  5401. /**
  5402. * @brief target -> host rx indication message definition
  5403. *
  5404. * @details
  5405. * The following field definitions describe the format of the rx indication
  5406. * message sent from the target to the host.
  5407. * The message consists of three major sections:
  5408. * 1. a fixed-length header
  5409. * 2. a variable-length list of firmware rx MSDU descriptors
  5410. * 3. one or more 4-octet MPDU range information elements
  5411. * The fixed length header itself has two sub-sections
  5412. * 1. the message meta-information, including identification of the
  5413. * sender and type of the received data, and a 4-octet flush/release IE
  5414. * 2. the firmware rx PPDU descriptor
  5415. *
  5416. * The format of the message is depicted below.
  5417. * in this depiction, the following abbreviations are used for information
  5418. * elements within the message:
  5419. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  5420. * elements associated with the PPDU start are valid.
  5421. * Specifically, the following fields are valid only if SV is set:
  5422. * RSSI (all variants), L, legacy rate, preamble type, service,
  5423. * VHT-SIG-A
  5424. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  5425. * elements associated with the PPDU end are valid.
  5426. * Specifically, the following fields are valid only if EV is set:
  5427. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  5428. * - L - Legacy rate selector - if legacy rates are used, this flag
  5429. * indicates whether the rate is from a CCK (L == 1) or OFDM
  5430. * (L == 0) PHY.
  5431. * - P - PHY error flag - boolean indication of whether the rx frame had
  5432. * a PHY error
  5433. *
  5434. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  5435. * |----------------+-------------------+---------------------+---------------|
  5436. * | peer ID | |RV|FV| ext TID | msg type |
  5437. * |--------------------------------------------------------------------------|
  5438. * | num | release | release | flush | flush |
  5439. * | MPDU | end | start | end | start |
  5440. * | ranges | seq num | seq num | seq num | seq num |
  5441. * |==========================================================================|
  5442. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  5443. * |V|V| | rate | | | timestamp | RSSI |
  5444. * |--------------------------------------------------------------------------|
  5445. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  5446. * |--------------------------------------------------------------------------|
  5447. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  5448. * |--------------------------------------------------------------------------|
  5449. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  5450. * |--------------------------------------------------------------------------|
  5451. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  5452. * |--------------------------------------------------------------------------|
  5453. * | TSF LSBs |
  5454. * |--------------------------------------------------------------------------|
  5455. * | microsec timestamp |
  5456. * |--------------------------------------------------------------------------|
  5457. * | preamble type | HT-SIG / VHT-SIG-A1 |
  5458. * |--------------------------------------------------------------------------|
  5459. * | service | HT-SIG / VHT-SIG-A2 |
  5460. * |==========================================================================|
  5461. * | reserved | FW rx desc bytes |
  5462. * |--------------------------------------------------------------------------|
  5463. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  5464. * | desc B3 | desc B2 | desc B1 | desc B0 |
  5465. * |--------------------------------------------------------------------------|
  5466. * : : :
  5467. * |--------------------------------------------------------------------------|
  5468. * | alignment | MSDU Rx |
  5469. * | padding | desc Bn |
  5470. * |--------------------------------------------------------------------------|
  5471. * | reserved | MPDU range status | MPDU count |
  5472. * |--------------------------------------------------------------------------|
  5473. * : reserved : MPDU range status : MPDU count :
  5474. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  5475. *
  5476. * Header fields:
  5477. * - MSG_TYPE
  5478. * Bits 7:0
  5479. * Purpose: identifies this as an rx indication message
  5480. * Value: 0x1
  5481. * - EXT_TID
  5482. * Bits 12:8
  5483. * Purpose: identify the traffic ID of the rx data, including
  5484. * special "extended" TID values for multicast, broadcast, and
  5485. * non-QoS data frames
  5486. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  5487. * - FLUSH_VALID (FV)
  5488. * Bit 13
  5489. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  5490. * is valid
  5491. * Value:
  5492. * 1 -> flush IE is valid and needs to be processed
  5493. * 0 -> flush IE is not valid and should be ignored
  5494. * - REL_VALID (RV)
  5495. * Bit 13
  5496. * Purpose: indicate whether the release IE (start/end sequence numbers)
  5497. * is valid
  5498. * Value:
  5499. * 1 -> release IE is valid and needs to be processed
  5500. * 0 -> release IE is not valid and should be ignored
  5501. * - PEER_ID
  5502. * Bits 31:16
  5503. * Purpose: Identify, by ID, which peer sent the rx data
  5504. * Value: ID of the peer who sent the rx data
  5505. * - FLUSH_SEQ_NUM_START
  5506. * Bits 5:0
  5507. * Purpose: Indicate the start of a series of MPDUs to flush
  5508. * Not all MPDUs within this series are necessarily valid - the host
  5509. * must check each sequence number within this range to see if the
  5510. * corresponding MPDU is actually present.
  5511. * This field is only valid if the FV bit is set.
  5512. * Value:
  5513. * The sequence number for the first MPDUs to check to flush.
  5514. * The sequence number is masked by 0x3f.
  5515. * - FLUSH_SEQ_NUM_END
  5516. * Bits 11:6
  5517. * Purpose: Indicate the end of a series of MPDUs to flush
  5518. * Value:
  5519. * The sequence number one larger than the sequence number of the
  5520. * last MPDU to check to flush.
  5521. * The sequence number is masked by 0x3f.
  5522. * Not all MPDUs within this series are necessarily valid - the host
  5523. * must check each sequence number within this range to see if the
  5524. * corresponding MPDU is actually present.
  5525. * This field is only valid if the FV bit is set.
  5526. * - REL_SEQ_NUM_START
  5527. * Bits 17:12
  5528. * Purpose: Indicate the start of a series of MPDUs to release.
  5529. * All MPDUs within this series are present and valid - the host
  5530. * need not check each sequence number within this range to see if
  5531. * the corresponding MPDU is actually present.
  5532. * This field is only valid if the RV bit is set.
  5533. * Value:
  5534. * The sequence number for the first MPDUs to check to release.
  5535. * The sequence number is masked by 0x3f.
  5536. * - REL_SEQ_NUM_END
  5537. * Bits 23:18
  5538. * Purpose: Indicate the end of a series of MPDUs to release.
  5539. * Value:
  5540. * The sequence number one larger than the sequence number of the
  5541. * last MPDU to check to release.
  5542. * The sequence number is masked by 0x3f.
  5543. * All MPDUs within this series are present and valid - the host
  5544. * need not check each sequence number within this range to see if
  5545. * the corresponding MPDU is actually present.
  5546. * This field is only valid if the RV bit is set.
  5547. * - NUM_MPDU_RANGES
  5548. * Bits 31:24
  5549. * Purpose: Indicate how many ranges of MPDUs are present.
  5550. * Each MPDU range consists of a series of contiguous MPDUs within the
  5551. * rx frame sequence which all have the same MPDU status.
  5552. * Value: 1-63 (typically a small number, like 1-3)
  5553. *
  5554. * Rx PPDU descriptor fields:
  5555. * - RSSI_CMB
  5556. * Bits 7:0
  5557. * Purpose: Combined RSSI from all active rx chains, across the active
  5558. * bandwidth.
  5559. * Value: RSSI dB units w.r.t. noise floor
  5560. * - TIMESTAMP_SUBMICROSEC
  5561. * Bits 15:8
  5562. * Purpose: high-resolution timestamp
  5563. * Value:
  5564. * Sub-microsecond time of PPDU reception.
  5565. * This timestamp ranges from [0,MAC clock MHz).
  5566. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  5567. * to form a high-resolution, large range rx timestamp.
  5568. * - PHY_ERR_CODE
  5569. * Bits 23:16
  5570. * Purpose:
  5571. * If the rx frame processing resulted in a PHY error, indicate what
  5572. * type of rx PHY error occurred.
  5573. * Value:
  5574. * This field is valid if the "P" (PHY_ERR) flag is set.
  5575. * TBD: document/specify the values for this field
  5576. * - PHY_ERR
  5577. * Bit 24
  5578. * Purpose: indicate whether the rx PPDU had a PHY error
  5579. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  5580. * - LEGACY_RATE
  5581. * Bits 28:25
  5582. * Purpose:
  5583. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  5584. * specify which rate was used.
  5585. * Value:
  5586. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  5587. * flag.
  5588. * If LEGACY_RATE_SEL is 0:
  5589. * 0x8: OFDM 48 Mbps
  5590. * 0x9: OFDM 24 Mbps
  5591. * 0xA: OFDM 12 Mbps
  5592. * 0xB: OFDM 6 Mbps
  5593. * 0xC: OFDM 54 Mbps
  5594. * 0xD: OFDM 36 Mbps
  5595. * 0xE: OFDM 18 Mbps
  5596. * 0xF: OFDM 9 Mbps
  5597. * If LEGACY_RATE_SEL is 1:
  5598. * 0x8: CCK 11 Mbps long preamble
  5599. * 0x9: CCK 5.5 Mbps long preamble
  5600. * 0xA: CCK 2 Mbps long preamble
  5601. * 0xB: CCK 1 Mbps long preamble
  5602. * 0xC: CCK 11 Mbps short preamble
  5603. * 0xD: CCK 5.5 Mbps short preamble
  5604. * 0xE: CCK 2 Mbps short preamble
  5605. * - LEGACY_RATE_SEL
  5606. * Bit 29
  5607. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  5608. * Value:
  5609. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  5610. * used a legacy rate.
  5611. * 0 -> OFDM, 1 -> CCK
  5612. * - END_VALID
  5613. * Bit 30
  5614. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5615. * the start of the PPDU are valid. Specifically, the following
  5616. * fields are only valid if END_VALID is set:
  5617. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  5618. * TIMESTAMP_SUBMICROSEC
  5619. * Value:
  5620. * 0 -> rx PPDU desc end fields are not valid
  5621. * 1 -> rx PPDU desc end fields are valid
  5622. * - START_VALID
  5623. * Bit 31
  5624. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5625. * the end of the PPDU are valid. Specifically, the following
  5626. * fields are only valid if START_VALID is set:
  5627. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  5628. * VHT-SIG-A
  5629. * Value:
  5630. * 0 -> rx PPDU desc start fields are not valid
  5631. * 1 -> rx PPDU desc start fields are valid
  5632. * - RSSI0_PRI20
  5633. * Bits 7:0
  5634. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  5635. * Value: RSSI dB units w.r.t. noise floor
  5636. *
  5637. * - RSSI0_EXT20
  5638. * Bits 7:0
  5639. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  5640. * (if the rx bandwidth was >= 40 MHz)
  5641. * Value: RSSI dB units w.r.t. noise floor
  5642. * - RSSI0_EXT40
  5643. * Bits 7:0
  5644. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  5645. * (if the rx bandwidth was >= 80 MHz)
  5646. * Value: RSSI dB units w.r.t. noise floor
  5647. * - RSSI0_EXT80
  5648. * Bits 7:0
  5649. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  5650. * (if the rx bandwidth was >= 160 MHz)
  5651. * Value: RSSI dB units w.r.t. noise floor
  5652. *
  5653. * - RSSI1_PRI20
  5654. * Bits 7:0
  5655. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  5656. * Value: RSSI dB units w.r.t. noise floor
  5657. * - RSSI1_EXT20
  5658. * Bits 7:0
  5659. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  5660. * (if the rx bandwidth was >= 40 MHz)
  5661. * Value: RSSI dB units w.r.t. noise floor
  5662. * - RSSI1_EXT40
  5663. * Bits 7:0
  5664. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  5665. * (if the rx bandwidth was >= 80 MHz)
  5666. * Value: RSSI dB units w.r.t. noise floor
  5667. * - RSSI1_EXT80
  5668. * Bits 7:0
  5669. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  5670. * (if the rx bandwidth was >= 160 MHz)
  5671. * Value: RSSI dB units w.r.t. noise floor
  5672. *
  5673. * - RSSI2_PRI20
  5674. * Bits 7:0
  5675. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  5676. * Value: RSSI dB units w.r.t. noise floor
  5677. * - RSSI2_EXT20
  5678. * Bits 7:0
  5679. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  5680. * (if the rx bandwidth was >= 40 MHz)
  5681. * Value: RSSI dB units w.r.t. noise floor
  5682. * - RSSI2_EXT40
  5683. * Bits 7:0
  5684. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  5685. * (if the rx bandwidth was >= 80 MHz)
  5686. * Value: RSSI dB units w.r.t. noise floor
  5687. * - RSSI2_EXT80
  5688. * Bits 7:0
  5689. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  5690. * (if the rx bandwidth was >= 160 MHz)
  5691. * Value: RSSI dB units w.r.t. noise floor
  5692. *
  5693. * - RSSI3_PRI20
  5694. * Bits 7:0
  5695. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  5696. * Value: RSSI dB units w.r.t. noise floor
  5697. * - RSSI3_EXT20
  5698. * Bits 7:0
  5699. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  5700. * (if the rx bandwidth was >= 40 MHz)
  5701. * Value: RSSI dB units w.r.t. noise floor
  5702. * - RSSI3_EXT40
  5703. * Bits 7:0
  5704. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  5705. * (if the rx bandwidth was >= 80 MHz)
  5706. * Value: RSSI dB units w.r.t. noise floor
  5707. * - RSSI3_EXT80
  5708. * Bits 7:0
  5709. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  5710. * (if the rx bandwidth was >= 160 MHz)
  5711. * Value: RSSI dB units w.r.t. noise floor
  5712. *
  5713. * - TSF32
  5714. * Bits 31:0
  5715. * Purpose: specify the time the rx PPDU was received, in TSF units
  5716. * Value: 32 LSBs of the TSF
  5717. * - TIMESTAMP_MICROSEC
  5718. * Bits 31:0
  5719. * Purpose: specify the time the rx PPDU was received, in microsecond units
  5720. * Value: PPDU rx time, in microseconds
  5721. * - VHT_SIG_A1
  5722. * Bits 23:0
  5723. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  5724. * from the rx PPDU
  5725. * Value:
  5726. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  5727. * VHT-SIG-A1 data.
  5728. * If PREAMBLE_TYPE specifies HT, then this field contains the
  5729. * first 24 bits of the HT-SIG data.
  5730. * Otherwise, this field is invalid.
  5731. * Refer to the the 802.11 protocol for the definition of the
  5732. * HT-SIG and VHT-SIG-A1 fields
  5733. * - VHT_SIG_A2
  5734. * Bits 23:0
  5735. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  5736. * from the rx PPDU
  5737. * Value:
  5738. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  5739. * VHT-SIG-A2 data.
  5740. * If PREAMBLE_TYPE specifies HT, then this field contains the
  5741. * last 24 bits of the HT-SIG data.
  5742. * Otherwise, this field is invalid.
  5743. * Refer to the the 802.11 protocol for the definition of the
  5744. * HT-SIG and VHT-SIG-A2 fields
  5745. * - PREAMBLE_TYPE
  5746. * Bits 31:24
  5747. * Purpose: indicate the PHY format of the received burst
  5748. * Value:
  5749. * 0x4: Legacy (OFDM/CCK)
  5750. * 0x8: HT
  5751. * 0x9: HT with TxBF
  5752. * 0xC: VHT
  5753. * 0xD: VHT with TxBF
  5754. * - SERVICE
  5755. * Bits 31:24
  5756. * Purpose: TBD
  5757. * Value: TBD
  5758. *
  5759. * Rx MSDU descriptor fields:
  5760. * - FW_RX_DESC_BYTES
  5761. * Bits 15:0
  5762. * Purpose: Indicate how many bytes in the Rx indication are used for
  5763. * FW Rx descriptors
  5764. *
  5765. * Payload fields:
  5766. * - MPDU_COUNT
  5767. * Bits 7:0
  5768. * Purpose: Indicate how many sequential MPDUs share the same status.
  5769. * All MPDUs within the indicated list are from the same RA-TA-TID.
  5770. * - MPDU_STATUS
  5771. * Bits 15:8
  5772. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  5773. * received successfully.
  5774. * Value:
  5775. * 0x1: success
  5776. * 0x2: FCS error
  5777. * 0x3: duplicate error
  5778. * 0x4: replay error
  5779. * 0x5: invalid peer
  5780. */
  5781. /* header fields */
  5782. #define HTT_RX_IND_EXT_TID_M 0x1f00
  5783. #define HTT_RX_IND_EXT_TID_S 8
  5784. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  5785. #define HTT_RX_IND_FLUSH_VALID_S 13
  5786. #define HTT_RX_IND_REL_VALID_M 0x4000
  5787. #define HTT_RX_IND_REL_VALID_S 14
  5788. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  5789. #define HTT_RX_IND_PEER_ID_S 16
  5790. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  5791. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  5792. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  5793. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  5794. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  5795. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  5796. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  5797. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  5798. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  5799. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  5800. /* rx PPDU descriptor fields */
  5801. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  5802. #define HTT_RX_IND_RSSI_CMB_S 0
  5803. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  5804. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  5805. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  5806. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  5807. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  5808. #define HTT_RX_IND_PHY_ERR_S 24
  5809. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  5810. #define HTT_RX_IND_LEGACY_RATE_S 25
  5811. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  5812. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  5813. #define HTT_RX_IND_END_VALID_M 0x40000000
  5814. #define HTT_RX_IND_END_VALID_S 30
  5815. #define HTT_RX_IND_START_VALID_M 0x80000000
  5816. #define HTT_RX_IND_START_VALID_S 31
  5817. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  5818. #define HTT_RX_IND_RSSI_PRI20_S 0
  5819. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  5820. #define HTT_RX_IND_RSSI_EXT20_S 8
  5821. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  5822. #define HTT_RX_IND_RSSI_EXT40_S 16
  5823. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  5824. #define HTT_RX_IND_RSSI_EXT80_S 24
  5825. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  5826. #define HTT_RX_IND_VHT_SIG_A1_S 0
  5827. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  5828. #define HTT_RX_IND_VHT_SIG_A2_S 0
  5829. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  5830. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  5831. #define HTT_RX_IND_SERVICE_M 0xff000000
  5832. #define HTT_RX_IND_SERVICE_S 24
  5833. /* rx MSDU descriptor fields */
  5834. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  5835. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  5836. /* payload fields */
  5837. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  5838. #define HTT_RX_IND_MPDU_COUNT_S 0
  5839. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  5840. #define HTT_RX_IND_MPDU_STATUS_S 8
  5841. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  5842. do { \
  5843. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  5844. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  5845. } while (0)
  5846. #define HTT_RX_IND_EXT_TID_GET(word) \
  5847. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  5848. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  5849. do { \
  5850. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  5851. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  5852. } while (0)
  5853. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  5854. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  5855. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  5856. do { \
  5857. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  5858. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  5859. } while (0)
  5860. #define HTT_RX_IND_REL_VALID_GET(word) \
  5861. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  5862. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  5863. do { \
  5864. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  5865. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  5866. } while (0)
  5867. #define HTT_RX_IND_PEER_ID_GET(word) \
  5868. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  5869. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  5870. do { \
  5871. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  5872. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  5873. } while (0)
  5874. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  5875. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  5876. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  5877. do { \
  5878. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  5879. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  5880. } while (0)
  5881. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  5882. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  5883. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  5884. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  5885. do { \
  5886. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  5887. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  5888. } while (0)
  5889. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  5890. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  5891. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  5892. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  5893. do { \
  5894. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  5895. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  5896. } while (0)
  5897. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  5898. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  5899. HTT_RX_IND_REL_SEQ_NUM_START_S)
  5900. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  5901. do { \
  5902. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  5903. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  5904. } while (0)
  5905. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  5906. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  5907. HTT_RX_IND_REL_SEQ_NUM_END_S)
  5908. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  5909. do { \
  5910. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  5911. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  5912. } while (0)
  5913. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  5914. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  5915. HTT_RX_IND_NUM_MPDU_RANGES_S)
  5916. /* FW rx PPDU descriptor fields */
  5917. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  5918. do { \
  5919. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  5920. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  5921. } while (0)
  5922. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  5923. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  5924. HTT_RX_IND_RSSI_CMB_S)
  5925. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  5926. do { \
  5927. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  5928. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  5929. } while (0)
  5930. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  5931. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  5932. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  5933. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  5934. do { \
  5935. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  5936. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  5937. } while (0)
  5938. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  5939. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  5940. HTT_RX_IND_PHY_ERR_CODE_S)
  5941. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  5942. do { \
  5943. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  5944. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  5945. } while (0)
  5946. #define HTT_RX_IND_PHY_ERR_GET(word) \
  5947. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  5948. HTT_RX_IND_PHY_ERR_S)
  5949. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  5950. do { \
  5951. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  5952. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  5953. } while (0)
  5954. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  5955. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  5956. HTT_RX_IND_LEGACY_RATE_S)
  5957. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  5958. do { \
  5959. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  5960. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  5961. } while (0)
  5962. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  5963. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  5964. HTT_RX_IND_LEGACY_RATE_SEL_S)
  5965. #define HTT_RX_IND_END_VALID_SET(word, value) \
  5966. do { \
  5967. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  5968. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  5969. } while (0)
  5970. #define HTT_RX_IND_END_VALID_GET(word) \
  5971. (((word) & HTT_RX_IND_END_VALID_M) >> \
  5972. HTT_RX_IND_END_VALID_S)
  5973. #define HTT_RX_IND_START_VALID_SET(word, value) \
  5974. do { \
  5975. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  5976. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  5977. } while (0)
  5978. #define HTT_RX_IND_START_VALID_GET(word) \
  5979. (((word) & HTT_RX_IND_START_VALID_M) >> \
  5980. HTT_RX_IND_START_VALID_S)
  5981. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  5982. do { \
  5983. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  5984. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  5985. } while (0)
  5986. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  5987. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  5988. HTT_RX_IND_RSSI_PRI20_S)
  5989. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  5990. do { \
  5991. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  5992. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  5993. } while (0)
  5994. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  5995. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  5996. HTT_RX_IND_RSSI_EXT20_S)
  5997. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  5998. do { \
  5999. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  6000. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  6001. } while (0)
  6002. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  6003. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  6004. HTT_RX_IND_RSSI_EXT40_S)
  6005. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  6006. do { \
  6007. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  6008. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  6009. } while (0)
  6010. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  6011. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  6012. HTT_RX_IND_RSSI_EXT80_S)
  6013. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  6014. do { \
  6015. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  6016. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  6017. } while (0)
  6018. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  6019. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  6020. HTT_RX_IND_VHT_SIG_A1_S)
  6021. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  6022. do { \
  6023. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  6024. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  6025. } while (0)
  6026. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  6027. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  6028. HTT_RX_IND_VHT_SIG_A2_S)
  6029. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  6030. do { \
  6031. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  6032. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  6033. } while (0)
  6034. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  6035. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  6036. HTT_RX_IND_PREAMBLE_TYPE_S)
  6037. #define HTT_RX_IND_SERVICE_SET(word, value) \
  6038. do { \
  6039. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  6040. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  6041. } while (0)
  6042. #define HTT_RX_IND_SERVICE_GET(word) \
  6043. (((word) & HTT_RX_IND_SERVICE_M) >> \
  6044. HTT_RX_IND_SERVICE_S)
  6045. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  6046. do { \
  6047. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  6048. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  6049. } while (0)
  6050. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  6051. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  6052. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  6053. do { \
  6054. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  6055. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  6056. } while (0)
  6057. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  6058. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  6059. #define HTT_RX_IND_HL_BYTES \
  6060. (HTT_RX_IND_HDR_BYTES + \
  6061. 4 /* single FW rx MSDU descriptor, plus padding */ + \
  6062. 4 /* single MPDU range information element */)
  6063. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  6064. /* Could we use one macro entry? */
  6065. #define HTT_WORD_SET(word, field, value) \
  6066. do { \
  6067. HTT_CHECK_SET_VAL(field, value); \
  6068. (word) |= ((value) << field ## _S); \
  6069. } while (0)
  6070. #define HTT_WORD_GET(word, field) \
  6071. (((word) & field ## _M) >> field ## _S)
  6072. PREPACK struct hl_htt_rx_ind_base {
  6073. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  6074. } POSTPACK;
  6075. /*
  6076. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  6077. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  6078. * HL host needed info. The field is just after the msdu fw rx desc.
  6079. */
  6080. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  6081. struct htt_rx_ind_hl_rx_desc_t {
  6082. A_UINT8 ver;
  6083. A_UINT8 len;
  6084. struct {
  6085. A_UINT8
  6086. first_msdu: 1,
  6087. last_msdu: 1,
  6088. c3_failed: 1,
  6089. c4_failed: 1,
  6090. ipv6: 1,
  6091. tcp: 1,
  6092. udp: 1,
  6093. reserved: 1;
  6094. } flags;
  6095. };
  6096. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  6097. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6098. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  6099. #define HTT_RX_IND_HL_RX_DESC_VER 0
  6100. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  6101. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6102. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  6103. #define HTT_RX_IND_HL_FLAG_OFFSET \
  6104. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6105. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  6106. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  6107. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  6108. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  6109. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  6110. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  6111. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  6112. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  6113. /* This structure is used in HL, the basic descriptor information
  6114. * used by host. the structure is translated by FW from HW desc
  6115. * or generated by FW. But in HL monitor mode, the host would use
  6116. * the same structure with LL.
  6117. */
  6118. PREPACK struct hl_htt_rx_desc_base {
  6119. A_UINT32
  6120. seq_num:12,
  6121. encrypted:1,
  6122. chan_info_present:1,
  6123. resv0:2,
  6124. mcast_bcast:1,
  6125. fragment:1,
  6126. key_id_oct:8,
  6127. resv1:6;
  6128. A_UINT32
  6129. pn_31_0;
  6130. union {
  6131. struct {
  6132. A_UINT16 pn_47_32;
  6133. A_UINT16 pn_63_48;
  6134. } pn16;
  6135. A_UINT32 pn_63_32;
  6136. } u0;
  6137. A_UINT32
  6138. pn_95_64;
  6139. A_UINT32
  6140. pn_127_96;
  6141. } POSTPACK;
  6142. /*
  6143. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  6144. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  6145. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  6146. * Please see htt_chan_change_t for description of the fields.
  6147. */
  6148. PREPACK struct htt_chan_info_t
  6149. {
  6150. A_UINT32 primary_chan_center_freq_mhz: 16,
  6151. contig_chan1_center_freq_mhz: 16;
  6152. A_UINT32 contig_chan2_center_freq_mhz: 16,
  6153. phy_mode: 8,
  6154. reserved: 8;
  6155. } POSTPACK;
  6156. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  6157. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  6158. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  6159. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  6160. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  6161. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  6162. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  6163. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  6164. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  6165. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  6166. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  6167. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  6168. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  6169. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  6170. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  6171. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  6172. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  6173. /* Channel information */
  6174. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  6175. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  6176. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  6177. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  6178. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  6179. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  6180. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  6181. #define HTT_CHAN_INFO_PHY_MODE_S 16
  6182. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  6183. do { \
  6184. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  6185. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  6186. } while (0)
  6187. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  6188. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  6189. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  6190. do { \
  6191. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  6192. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  6193. } while (0)
  6194. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  6195. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  6196. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  6197. do { \
  6198. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  6199. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  6200. } while (0)
  6201. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  6202. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  6203. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  6204. do { \
  6205. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  6206. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  6207. } while (0)
  6208. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  6209. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  6210. /*
  6211. * @brief target -> host rx reorder flush message definition
  6212. *
  6213. * @details
  6214. * The following field definitions describe the format of the rx flush
  6215. * message sent from the target to the host.
  6216. * The message consists of a 4-octet header, followed by one or more
  6217. * 4-octet payload information elements.
  6218. *
  6219. * |31 24|23 8|7 0|
  6220. * |--------------------------------------------------------------|
  6221. * | TID | peer ID | msg type |
  6222. * |--------------------------------------------------------------|
  6223. * | seq num end | seq num start | MPDU status | reserved |
  6224. * |--------------------------------------------------------------|
  6225. * First DWORD:
  6226. * - MSG_TYPE
  6227. * Bits 7:0
  6228. * Purpose: identifies this as an rx flush message
  6229. * Value: 0x2
  6230. * - PEER_ID
  6231. * Bits 23:8 (only bits 18:8 actually used)
  6232. * Purpose: identify which peer's rx data is being flushed
  6233. * Value: (rx) peer ID
  6234. * - TID
  6235. * Bits 31:24 (only bits 27:24 actually used)
  6236. * Purpose: Specifies which traffic identifier's rx data is being flushed
  6237. * Value: traffic identifier
  6238. * Second DWORD:
  6239. * - MPDU_STATUS
  6240. * Bits 15:8
  6241. * Purpose:
  6242. * Indicate whether the flushed MPDUs should be discarded or processed.
  6243. * Value:
  6244. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  6245. * stages of rx processing
  6246. * other: discard the MPDUs
  6247. * It is anticipated that flush messages will always have
  6248. * MPDU status == 1, but the status flag is included for
  6249. * flexibility.
  6250. * - SEQ_NUM_START
  6251. * Bits 23:16
  6252. * Purpose:
  6253. * Indicate the start of a series of consecutive MPDUs being flushed.
  6254. * Not all MPDUs within this range are necessarily valid - the host
  6255. * must check each sequence number within this range to see if the
  6256. * corresponding MPDU is actually present.
  6257. * Value:
  6258. * The sequence number for the first MPDU in the sequence.
  6259. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6260. * - SEQ_NUM_END
  6261. * Bits 30:24
  6262. * Purpose:
  6263. * Indicate the end of a series of consecutive MPDUs being flushed.
  6264. * Value:
  6265. * The sequence number one larger than the sequence number of the
  6266. * last MPDU being flushed.
  6267. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6268. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  6269. * are to be released for further rx processing.
  6270. * Not all MPDUs within this range are necessarily valid - the host
  6271. * must check each sequence number within this range to see if the
  6272. * corresponding MPDU is actually present.
  6273. */
  6274. /* first DWORD */
  6275. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  6276. #define HTT_RX_FLUSH_PEER_ID_S 8
  6277. #define HTT_RX_FLUSH_TID_M 0xff000000
  6278. #define HTT_RX_FLUSH_TID_S 24
  6279. /* second DWORD */
  6280. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  6281. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  6282. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  6283. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  6284. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  6285. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  6286. #define HTT_RX_FLUSH_BYTES 8
  6287. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  6288. do { \
  6289. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  6290. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  6291. } while (0)
  6292. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  6293. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  6294. #define HTT_RX_FLUSH_TID_SET(word, value) \
  6295. do { \
  6296. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  6297. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  6298. } while (0)
  6299. #define HTT_RX_FLUSH_TID_GET(word) \
  6300. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  6301. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  6302. do { \
  6303. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  6304. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  6305. } while (0)
  6306. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  6307. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  6308. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  6309. do { \
  6310. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  6311. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  6312. } while (0)
  6313. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  6314. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  6315. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  6316. do { \
  6317. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  6318. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  6319. } while (0)
  6320. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  6321. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  6322. /*
  6323. * @brief target -> host rx pn check indication message
  6324. *
  6325. * @details
  6326. * The following field definitions describe the format of the Rx PN check
  6327. * indication message sent from the target to the host.
  6328. * The message consists of a 4-octet header, followed by the start and
  6329. * end sequence numbers to be released, followed by the PN IEs. Each PN
  6330. * IE is one octet containing the sequence number that failed the PN
  6331. * check.
  6332. *
  6333. * |31 24|23 8|7 0|
  6334. * |--------------------------------------------------------------|
  6335. * | TID | peer ID | msg type |
  6336. * |--------------------------------------------------------------|
  6337. * | Reserved | PN IE count | seq num end | seq num start|
  6338. * |--------------------------------------------------------------|
  6339. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  6340. * |--------------------------------------------------------------|
  6341. * First DWORD:
  6342. * - MSG_TYPE
  6343. * Bits 7:0
  6344. * Purpose: Identifies this as an rx pn check indication message
  6345. * Value: 0x2
  6346. * - PEER_ID
  6347. * Bits 23:8 (only bits 18:8 actually used)
  6348. * Purpose: identify which peer
  6349. * Value: (rx) peer ID
  6350. * - TID
  6351. * Bits 31:24 (only bits 27:24 actually used)
  6352. * Purpose: identify traffic identifier
  6353. * Value: traffic identifier
  6354. * Second DWORD:
  6355. * - SEQ_NUM_START
  6356. * Bits 7:0
  6357. * Purpose:
  6358. * Indicates the starting sequence number of the MPDU in this
  6359. * series of MPDUs that went though PN check.
  6360. * Value:
  6361. * The sequence number for the first MPDU in the sequence.
  6362. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6363. * - SEQ_NUM_END
  6364. * Bits 15:8
  6365. * Purpose:
  6366. * Indicates the ending sequence number of the MPDU in this
  6367. * series of MPDUs that went though PN check.
  6368. * Value:
  6369. * The sequence number one larger then the sequence number of the last
  6370. * MPDU being flushed.
  6371. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6372. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  6373. * for invalid PN numbers and are ready to be released for further processing.
  6374. * Not all MPDUs within this range are necessarily valid - the host
  6375. * must check each sequence number within this range to see if the
  6376. * corresponding MPDU is actually present.
  6377. * - PN_IE_COUNT
  6378. * Bits 23:16
  6379. * Purpose:
  6380. * Used to determine the variable number of PN information elements in this
  6381. * message
  6382. *
  6383. * PN information elements:
  6384. * - PN_IE_x-
  6385. * Purpose:
  6386. * Each PN information element contains the sequence number of the MPDU that
  6387. * has failed the target PN check.
  6388. * Value:
  6389. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  6390. * that failed the PN check.
  6391. */
  6392. /* first DWORD */
  6393. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  6394. #define HTT_RX_PN_IND_PEER_ID_S 8
  6395. #define HTT_RX_PN_IND_TID_M 0xff000000
  6396. #define HTT_RX_PN_IND_TID_S 24
  6397. /* second DWORD */
  6398. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  6399. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  6400. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  6401. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  6402. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  6403. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  6404. #define HTT_RX_PN_IND_BYTES 8
  6405. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  6406. do { \
  6407. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  6408. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  6409. } while (0)
  6410. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  6411. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  6412. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  6413. do { \
  6414. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  6415. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  6416. } while (0)
  6417. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  6418. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  6419. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  6420. do { \
  6421. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  6422. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  6423. } while (0)
  6424. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  6425. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  6426. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  6427. do { \
  6428. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  6429. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  6430. } while (0)
  6431. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  6432. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  6433. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  6434. do { \
  6435. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  6436. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  6437. } while (0)
  6438. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  6439. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  6440. /*
  6441. * @brief target -> host rx offload deliver message for LL system
  6442. *
  6443. * @details
  6444. * In a low latency system this message is sent whenever the offload
  6445. * manager flushes out the packets it has coalesced in its coalescing buffer.
  6446. * The DMA of the actual packets into host memory is done before sending out
  6447. * this message. This message indicates only how many MSDUs to reap. The
  6448. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  6449. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  6450. * DMA'd by the MAC directly into host memory these packets do not contain
  6451. * the MAC descriptors in the header portion of the packet. Instead they contain
  6452. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  6453. * message, the packets are delivered directly to the NW stack without going
  6454. * through the regular reorder buffering and PN checking path since it has
  6455. * already been done in target.
  6456. *
  6457. * |31 24|23 16|15 8|7 0|
  6458. * |-----------------------------------------------------------------------|
  6459. * | Total MSDU count | reserved | msg type |
  6460. * |-----------------------------------------------------------------------|
  6461. *
  6462. * @brief target -> host rx offload deliver message for HL system
  6463. *
  6464. * @details
  6465. * In a high latency system this message is sent whenever the offload manager
  6466. * flushes out the packets it has coalesced in its coalescing buffer. The
  6467. * actual packets are also carried along with this message. When the host
  6468. * receives this message, it is expected to deliver these packets to the NW
  6469. * stack directly instead of routing them through the reorder buffering and
  6470. * PN checking path since it has already been done in target.
  6471. *
  6472. * |31 24|23 16|15 8|7 0|
  6473. * |-----------------------------------------------------------------------|
  6474. * | Total MSDU count | reserved | msg type |
  6475. * |-----------------------------------------------------------------------|
  6476. * | peer ID | MSDU length |
  6477. * |-----------------------------------------------------------------------|
  6478. * | MSDU payload | FW Desc | tid | vdev ID |
  6479. * |-----------------------------------------------------------------------|
  6480. * | MSDU payload contd. |
  6481. * |-----------------------------------------------------------------------|
  6482. * | peer ID | MSDU length |
  6483. * |-----------------------------------------------------------------------|
  6484. * | MSDU payload | FW Desc | tid | vdev ID |
  6485. * |-----------------------------------------------------------------------|
  6486. * | MSDU payload contd. |
  6487. * |-----------------------------------------------------------------------|
  6488. *
  6489. */
  6490. /* first DWORD */
  6491. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  6492. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  6493. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  6494. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  6495. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  6496. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  6497. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  6498. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  6499. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  6500. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  6501. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  6502. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  6503. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  6504. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  6505. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  6506. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  6507. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  6508. do { \
  6509. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  6510. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  6511. } while (0)
  6512. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  6513. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  6514. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  6515. do { \
  6516. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  6517. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  6518. } while (0)
  6519. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  6520. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  6521. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  6522. do { \
  6523. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  6524. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  6525. } while (0)
  6526. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  6527. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  6528. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  6529. do { \
  6530. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  6531. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  6532. } while (0)
  6533. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  6534. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  6535. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  6536. do { \
  6537. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  6538. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  6539. } while (0)
  6540. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  6541. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  6542. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  6543. do { \
  6544. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  6545. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  6546. } while (0)
  6547. /**
  6548. * @brief target -> host rx peer map/unmap message definition
  6549. *
  6550. * @details
  6551. * The following diagram shows the format of the rx peer map message sent
  6552. * from the target to the host. This layout assumes the target operates
  6553. * as little-endian.
  6554. *
  6555. * This message always contains a SW peer ID. The main purpose of the
  6556. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  6557. * with, so that the host can use that peer ID to determine which peer
  6558. * transmitted the rx frame. This SW peer ID is sometimes also used for
  6559. * other purposes, such as identifying during tx completions which peer
  6560. * the tx frames in question were transmitted to.
  6561. *
  6562. * In certain generations of chips, the peer map message also contains
  6563. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  6564. * to identify which peer the frame needs to be forwarded to (i.e. the
  6565. * peer assocated with the Destination MAC Address within the packet),
  6566. * and particularly which vdev needs to transmit the frame (for cases
  6567. * of inter-vdev rx --> tx forwarding).
  6568. * This DA-based peer ID that is provided for certain rx frames
  6569. * (the rx frames that need to be re-transmitted as tx frames)
  6570. * is the ID that the HW uses for referring to the peer in question,
  6571. * rather than the peer ID that the SW+FW use to refer to the peer.
  6572. *
  6573. *
  6574. * |31 24|23 16|15 8|7 0|
  6575. * |-----------------------------------------------------------------------|
  6576. * | SW peer ID | VDEV ID | msg type |
  6577. * |-----------------------------------------------------------------------|
  6578. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6579. * |-----------------------------------------------------------------------|
  6580. * | HW peer ID | MAC addr 5 | MAC addr 4 |
  6581. * |-----------------------------------------------------------------------|
  6582. *
  6583. *
  6584. * The following diagram shows the format of the rx peer unmap message sent
  6585. * from the target to the host.
  6586. *
  6587. * |31 24|23 16|15 8|7 0|
  6588. * |-----------------------------------------------------------------------|
  6589. * | SW peer ID | VDEV ID | msg type |
  6590. * |-----------------------------------------------------------------------|
  6591. *
  6592. * The following field definitions describe the format of the rx peer map
  6593. * and peer unmap messages sent from the target to the host.
  6594. * - MSG_TYPE
  6595. * Bits 7:0
  6596. * Purpose: identifies this as an rx peer map or peer unmap message
  6597. * Value: peer map -> 0x3, peer unmap -> 0x4
  6598. * - VDEV_ID
  6599. * Bits 15:8
  6600. * Purpose: Indicates which virtual device the peer is associated
  6601. * with.
  6602. * Value: vdev ID (used in the host to look up the vdev object)
  6603. * - PEER_ID (a.k.a. SW_PEER_ID)
  6604. * Bits 31:16
  6605. * Purpose: The peer ID (index) that WAL is allocating (map) or
  6606. * freeing (unmap)
  6607. * Value: (rx) peer ID
  6608. * - MAC_ADDR_L32 (peer map only)
  6609. * Bits 31:0
  6610. * Purpose: Identifies which peer node the peer ID is for.
  6611. * Value: lower 4 bytes of peer node's MAC address
  6612. * - MAC_ADDR_U16 (peer map only)
  6613. * Bits 15:0
  6614. * Purpose: Identifies which peer node the peer ID is for.
  6615. * Value: upper 2 bytes of peer node's MAC address
  6616. * - HW_PEER_ID
  6617. * Bits 31:16
  6618. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  6619. * address, so for rx frames marked for rx --> tx forwarding, the
  6620. * host can determine from the HW peer ID provided as meta-data with
  6621. * the rx frame which peer the frame is supposed to be forwarded to.
  6622. * Value: ID used by the MAC HW to identify the peer
  6623. */
  6624. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  6625. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  6626. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  6627. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  6628. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  6629. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  6630. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  6631. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  6632. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  6633. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  6634. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  6635. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  6636. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  6637. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  6638. do { \
  6639. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  6640. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  6641. } while (0)
  6642. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  6643. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  6644. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  6645. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  6646. do { \
  6647. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  6648. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  6649. } while (0)
  6650. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  6651. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  6652. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  6653. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  6654. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  6655. do { \
  6656. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  6657. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  6658. } while (0)
  6659. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  6660. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  6661. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  6662. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  6663. #define HTT_RX_PEER_MAP_BYTES 12
  6664. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  6665. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  6666. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  6667. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  6668. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  6669. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  6670. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  6671. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  6672. #define HTT_RX_PEER_UNMAP_BYTES 4
  6673. /**
  6674. * @brief target -> host rx peer map V2 message definition
  6675. *
  6676. * @details
  6677. * The following diagram shows the format of the rx peer map v2 message sent
  6678. * from the target to the host. This layout assumes the target operates
  6679. * as little-endian.
  6680. *
  6681. * This message always contains a SW peer ID. The main purpose of the
  6682. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  6683. * with, so that the host can use that peer ID to determine which peer
  6684. * transmitted the rx frame. This SW peer ID is sometimes also used for
  6685. * other purposes, such as identifying during tx completions which peer
  6686. * the tx frames in question were transmitted to.
  6687. *
  6688. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  6689. * is used during rx --> tx frame forwarding to identify which peer the
  6690. * frame needs to be forwarded to (i.e. the peer assocated with the
  6691. * Destination MAC Address within the packet), and particularly which vdev
  6692. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  6693. * This DA-based peer ID that is provided for certain rx frames
  6694. * (the rx frames that need to be re-transmitted as tx frames)
  6695. * is the ID that the HW uses for referring to the peer in question,
  6696. * rather than the peer ID that the SW+FW use to refer to the peer.
  6697. *
  6698. *
  6699. * |31 24|23 16|15 8|7 0|
  6700. * |-----------------------------------------------------------------------|
  6701. * | SW peer ID | VDEV ID | msg type |
  6702. * |-----------------------------------------------------------------------|
  6703. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6704. * |-----------------------------------------------------------------------|
  6705. * | HW peer ID | MAC addr 5 | MAC addr 4 |
  6706. * |-----------------------------------------------------------------------|
  6707. * | Reserved_17_31 | Next Hop | AST Hash Value |
  6708. * |-----------------------------------------------------------------------|
  6709. * | Reserved_0 |
  6710. * |-----------------------------------------------------------------------|
  6711. * | Reserved_1 |
  6712. * |-----------------------------------------------------------------------|
  6713. * | Reserved_2 |
  6714. * |-----------------------------------------------------------------------|
  6715. * | Reserved_3 |
  6716. * |-----------------------------------------------------------------------|
  6717. *
  6718. *
  6719. * The following field definitions describe the format of the rx peer map v2
  6720. * messages sent from the target to the host.
  6721. * - MSG_TYPE
  6722. * Bits 7:0
  6723. * Purpose: identifies this as an rx peer map v2 message
  6724. * Value: peer map v2 -> 0x1e
  6725. * - VDEV_ID
  6726. * Bits 15:8
  6727. * Purpose: Indicates which virtual device the peer is associated with.
  6728. * Value: vdev ID (used in the host to look up the vdev object)
  6729. * - SW_PEER_ID
  6730. * Bits 31:16
  6731. * Purpose: The peer ID (index) that WAL is allocating
  6732. * Value: (rx) peer ID
  6733. * - MAC_ADDR_L32
  6734. * Bits 31:0
  6735. * Purpose: Identifies which peer node the peer ID is for.
  6736. * Value: lower 4 bytes of peer node's MAC address
  6737. * - MAC_ADDR_U16
  6738. * Bits 15:0
  6739. * Purpose: Identifies which peer node the peer ID is for.
  6740. * Value: upper 2 bytes of peer node's MAC address
  6741. * - HW_PEER_ID
  6742. * Bits 31:16
  6743. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  6744. * address, so for rx frames marked for rx --> tx forwarding, the
  6745. * host can determine from the HW peer ID provided as meta-data with
  6746. * the rx frame which peer the frame is supposed to be forwarded to.
  6747. * Value: ID used by the MAC HW to identify the peer
  6748. * - AST_HASH_VALUE
  6749. * Bits 15:0
  6750. * Purpose: Indicates AST Hash value is required for the TCL AST index
  6751. * override feature.
  6752. * - NEXT_HOP
  6753. * Bit 16
  6754. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  6755. * (Wireless Distribution System).
  6756. */
  6757. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  6758. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  6759. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  6760. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  6761. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  6762. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  6763. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  6764. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  6765. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  6766. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  6767. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  6768. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  6769. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  6770. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  6771. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  6772. do { \
  6773. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  6774. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  6775. } while (0)
  6776. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  6777. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  6778. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  6779. do { \
  6780. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  6781. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  6782. } while (0)
  6783. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  6784. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  6785. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  6786. do { \
  6787. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  6788. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  6789. } while (0)
  6790. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  6791. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  6792. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  6793. do { \
  6794. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  6795. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  6796. } while (0)
  6797. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  6798. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  6799. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  6800. do { \
  6801. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  6802. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  6803. } while (0)
  6804. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  6805. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  6806. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  6807. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  6808. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  6809. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  6810. #define HTT_RX_PEER_MAP_V2_BYTES 32
  6811. /**
  6812. * @brief target -> host rx peer unmap V2 message definition
  6813. *
  6814. *
  6815. * The following diagram shows the format of the rx peer unmap message sent
  6816. * from the target to the host.
  6817. *
  6818. * |31 24|23 16|15 8|7 0|
  6819. * |-----------------------------------------------------------------------|
  6820. * | SW peer ID | VDEV ID | msg type |
  6821. * |-----------------------------------------------------------------------|
  6822. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6823. * |-----------------------------------------------------------------------|
  6824. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  6825. * |-----------------------------------------------------------------------|
  6826. * | Peer Delete Duration |
  6827. * |-----------------------------------------------------------------------|
  6828. * | Reserved_0 |
  6829. * |-----------------------------------------------------------------------|
  6830. * | Reserved_1 |
  6831. * |-----------------------------------------------------------------------|
  6832. * | Reserved_2 |
  6833. * |-----------------------------------------------------------------------|
  6834. *
  6835. *
  6836. * The following field definitions describe the format of the rx peer unmap
  6837. * messages sent from the target to the host.
  6838. * - MSG_TYPE
  6839. * Bits 7:0
  6840. * Purpose: identifies this as an rx peer unmap v2 message
  6841. * Value: peer unmap v2 -> 0x1f
  6842. * - VDEV_ID
  6843. * Bits 15:8
  6844. * Purpose: Indicates which virtual device the peer is associated
  6845. * with.
  6846. * Value: vdev ID (used in the host to look up the vdev object)
  6847. * - SW_PEER_ID
  6848. * Bits 31:16
  6849. * Purpose: The peer ID (index) that WAL is freeing
  6850. * Value: (rx) peer ID
  6851. * - MAC_ADDR_L32
  6852. * Bits 31:0
  6853. * Purpose: Identifies which peer node the peer ID is for.
  6854. * Value: lower 4 bytes of peer node's MAC address
  6855. * - MAC_ADDR_U16
  6856. * Bits 15:0
  6857. * Purpose: Identifies which peer node the peer ID is for.
  6858. * Value: upper 2 bytes of peer node's MAC address
  6859. * - NEXT_HOP
  6860. * Bits 16
  6861. * Purpose: Bit indicates next_hop AST entry used for WDS
  6862. * (Wireless Distribution System).
  6863. * - PEER_DELETE_DURATION
  6864. * Bits 31:0
  6865. * Purpose: Time taken to delete peer, in msec,
  6866. * Used for monitoring / debugging PEER delete response delay
  6867. */
  6868. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  6869. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  6870. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  6871. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  6872. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  6873. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  6874. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  6875. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  6876. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  6877. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  6878. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  6879. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  6880. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  6881. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  6882. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  6883. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  6884. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  6885. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  6886. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  6887. do { \
  6888. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  6889. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  6890. } while (0)
  6891. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  6892. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  6893. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  6894. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  6895. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  6896. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  6897. /**
  6898. * @brief target -> host message specifying security parameters
  6899. *
  6900. * @details
  6901. * The following diagram shows the format of the security specification
  6902. * message sent from the target to the host.
  6903. * This security specification message tells the host whether a PN check is
  6904. * necessary on rx data frames, and if so, how large the PN counter is.
  6905. * This message also tells the host about the security processing to apply
  6906. * to defragmented rx frames - specifically, whether a Message Integrity
  6907. * Check is required, and the Michael key to use.
  6908. *
  6909. * |31 24|23 16|15|14 8|7 0|
  6910. * |-----------------------------------------------------------------------|
  6911. * | peer ID | U| security type | msg type |
  6912. * |-----------------------------------------------------------------------|
  6913. * | Michael Key K0 |
  6914. * |-----------------------------------------------------------------------|
  6915. * | Michael Key K1 |
  6916. * |-----------------------------------------------------------------------|
  6917. * | WAPI RSC Low0 |
  6918. * |-----------------------------------------------------------------------|
  6919. * | WAPI RSC Low1 |
  6920. * |-----------------------------------------------------------------------|
  6921. * | WAPI RSC Hi0 |
  6922. * |-----------------------------------------------------------------------|
  6923. * | WAPI RSC Hi1 |
  6924. * |-----------------------------------------------------------------------|
  6925. *
  6926. * The following field definitions describe the format of the security
  6927. * indication message sent from the target to the host.
  6928. * - MSG_TYPE
  6929. * Bits 7:0
  6930. * Purpose: identifies this as a security specification message
  6931. * Value: 0xb
  6932. * - SEC_TYPE
  6933. * Bits 14:8
  6934. * Purpose: specifies which type of security applies to the peer
  6935. * Value: htt_sec_type enum value
  6936. * - UNICAST
  6937. * Bit 15
  6938. * Purpose: whether this security is applied to unicast or multicast data
  6939. * Value: 1 -> unicast, 0 -> multicast
  6940. * - PEER_ID
  6941. * Bits 31:16
  6942. * Purpose: The ID number for the peer the security specification is for
  6943. * Value: peer ID
  6944. * - MICHAEL_KEY_K0
  6945. * Bits 31:0
  6946. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  6947. * Value: Michael Key K0 (if security type is TKIP)
  6948. * - MICHAEL_KEY_K1
  6949. * Bits 31:0
  6950. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  6951. * Value: Michael Key K1 (if security type is TKIP)
  6952. * - WAPI_RSC_LOW0
  6953. * Bits 31:0
  6954. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  6955. * Value: WAPI RSC Low0 (if security type is WAPI)
  6956. * - WAPI_RSC_LOW1
  6957. * Bits 31:0
  6958. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  6959. * Value: WAPI RSC Low1 (if security type is WAPI)
  6960. * - WAPI_RSC_HI0
  6961. * Bits 31:0
  6962. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  6963. * Value: WAPI RSC Hi0 (if security type is WAPI)
  6964. * - WAPI_RSC_HI1
  6965. * Bits 31:0
  6966. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  6967. * Value: WAPI RSC Hi1 (if security type is WAPI)
  6968. */
  6969. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  6970. #define HTT_SEC_IND_SEC_TYPE_S 8
  6971. #define HTT_SEC_IND_UNICAST_M 0x00008000
  6972. #define HTT_SEC_IND_UNICAST_S 15
  6973. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  6974. #define HTT_SEC_IND_PEER_ID_S 16
  6975. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  6976. do { \
  6977. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  6978. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  6979. } while (0)
  6980. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  6981. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  6982. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  6983. do { \
  6984. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  6985. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  6986. } while (0)
  6987. #define HTT_SEC_IND_UNICAST_GET(word) \
  6988. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  6989. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  6990. do { \
  6991. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  6992. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  6993. } while (0)
  6994. #define HTT_SEC_IND_PEER_ID_GET(word) \
  6995. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  6996. #define HTT_SEC_IND_BYTES 28
  6997. /**
  6998. * @brief target -> host rx ADDBA / DELBA message definitions
  6999. *
  7000. * @details
  7001. * The following diagram shows the format of the rx ADDBA message sent
  7002. * from the target to the host:
  7003. *
  7004. * |31 20|19 16|15 8|7 0|
  7005. * |---------------------------------------------------------------------|
  7006. * | peer ID | TID | window size | msg type |
  7007. * |---------------------------------------------------------------------|
  7008. *
  7009. * The following diagram shows the format of the rx DELBA message sent
  7010. * from the target to the host:
  7011. *
  7012. * |31 20|19 16|15 8|7 0|
  7013. * |---------------------------------------------------------------------|
  7014. * | peer ID | TID | reserved | msg type |
  7015. * |---------------------------------------------------------------------|
  7016. *
  7017. * The following field definitions describe the format of the rx ADDBA
  7018. * and DELBA messages sent from the target to the host.
  7019. * - MSG_TYPE
  7020. * Bits 7:0
  7021. * Purpose: identifies this as an rx ADDBA or DELBA message
  7022. * Value: ADDBA -> 0x5, DELBA -> 0x6
  7023. * - WIN_SIZE
  7024. * Bits 15:8 (ADDBA only)
  7025. * Purpose: Specifies the length of the block ack window (max = 64).
  7026. * Value:
  7027. * block ack window length specified by the received ADDBA
  7028. * management message.
  7029. * - TID
  7030. * Bits 19:16
  7031. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  7032. * Value:
  7033. * TID specified by the received ADDBA or DELBA management message.
  7034. * - PEER_ID
  7035. * Bits 31:20
  7036. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  7037. * Value:
  7038. * ID (hash value) used by the host for fast, direct lookup of
  7039. * host SW peer info, including rx reorder states.
  7040. */
  7041. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  7042. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  7043. #define HTT_RX_ADDBA_TID_M 0xf0000
  7044. #define HTT_RX_ADDBA_TID_S 16
  7045. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  7046. #define HTT_RX_ADDBA_PEER_ID_S 20
  7047. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  7048. do { \
  7049. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  7050. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  7051. } while (0)
  7052. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  7053. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  7054. #define HTT_RX_ADDBA_TID_SET(word, value) \
  7055. do { \
  7056. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  7057. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  7058. } while (0)
  7059. #define HTT_RX_ADDBA_TID_GET(word) \
  7060. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  7061. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  7062. do { \
  7063. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  7064. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  7065. } while (0)
  7066. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  7067. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  7068. #define HTT_RX_ADDBA_BYTES 4
  7069. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  7070. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  7071. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  7072. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  7073. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  7074. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  7075. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  7076. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  7077. #define HTT_RX_DELBA_BYTES 4
  7078. /**
  7079. * @brief tx queue group information element definition
  7080. *
  7081. * @details
  7082. * The following diagram shows the format of the tx queue group
  7083. * information element, which can be included in target --> host
  7084. * messages to specify the number of tx "credits" (tx descriptors
  7085. * for LL, or tx buffers for HL) available to a particular group
  7086. * of host-side tx queues, and which host-side tx queues belong to
  7087. * the group.
  7088. *
  7089. * |31|30 24|23 16|15|14|13 0|
  7090. * |------------------------------------------------------------------------|
  7091. * | X| reserved | tx queue grp ID | A| S| credit count |
  7092. * |------------------------------------------------------------------------|
  7093. * | vdev ID mask | AC mask |
  7094. * |------------------------------------------------------------------------|
  7095. *
  7096. * The following definitions describe the fields within the tx queue group
  7097. * information element:
  7098. * - credit_count
  7099. * Bits 13:1
  7100. * Purpose: specify how many tx credits are available to the tx queue group
  7101. * Value: An absolute or relative, positive or negative credit value
  7102. * The 'A' bit specifies whether the value is absolute or relative.
  7103. * The 'S' bit specifies whether the value is positive or negative.
  7104. * A negative value can only be relative, not absolute.
  7105. * An absolute value replaces any prior credit value the host has for
  7106. * the tx queue group in question.
  7107. * A relative value is added to the prior credit value the host has for
  7108. * the tx queue group in question.
  7109. * - sign
  7110. * Bit 14
  7111. * Purpose: specify whether the credit count is positive or negative
  7112. * Value: 0 -> positive, 1 -> negative
  7113. * - absolute
  7114. * Bit 15
  7115. * Purpose: specify whether the credit count is absolute or relative
  7116. * Value: 0 -> relative, 1 -> absolute
  7117. * - txq_group_id
  7118. * Bits 23:16
  7119. * Purpose: indicate which tx queue group's credit and/or membership are
  7120. * being specified
  7121. * Value: 0 to max_tx_queue_groups-1
  7122. * - reserved
  7123. * Bits 30:16
  7124. * Value: 0x0
  7125. * - eXtension
  7126. * Bit 31
  7127. * Purpose: specify whether another tx queue group info element follows
  7128. * Value: 0 -> no more tx queue group information elements
  7129. * 1 -> another tx queue group information element immediately follows
  7130. * - ac_mask
  7131. * Bits 15:0
  7132. * Purpose: specify which Access Categories belong to the tx queue group
  7133. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  7134. * the tx queue group.
  7135. * The AC bit-mask values are obtained by left-shifting by the
  7136. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  7137. * - vdev_id_mask
  7138. * Bits 31:16
  7139. * Purpose: specify which vdev's tx queues belong to the tx queue group
  7140. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  7141. * belong to the tx queue group.
  7142. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  7143. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  7144. */
  7145. PREPACK struct htt_txq_group {
  7146. A_UINT32
  7147. credit_count: 14,
  7148. sign: 1,
  7149. absolute: 1,
  7150. tx_queue_group_id: 8,
  7151. reserved0: 7,
  7152. extension: 1;
  7153. A_UINT32
  7154. ac_mask: 16,
  7155. vdev_id_mask: 16;
  7156. } POSTPACK;
  7157. /* first word */
  7158. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  7159. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  7160. #define HTT_TXQ_GROUP_SIGN_S 14
  7161. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  7162. #define HTT_TXQ_GROUP_ABS_S 15
  7163. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  7164. #define HTT_TXQ_GROUP_ID_S 16
  7165. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  7166. #define HTT_TXQ_GROUP_EXT_S 31
  7167. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  7168. /* second word */
  7169. #define HTT_TXQ_GROUP_AC_MASK_S 0
  7170. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  7171. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  7172. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  7173. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  7174. do { \
  7175. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  7176. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  7177. } while (0)
  7178. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  7179. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  7180. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  7181. do { \
  7182. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  7183. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  7184. } while (0)
  7185. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  7186. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  7187. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  7188. do { \
  7189. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  7190. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  7191. } while (0)
  7192. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  7193. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  7194. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  7195. do { \
  7196. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  7197. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  7198. } while (0)
  7199. #define HTT_TXQ_GROUP_ID_GET(_info) \
  7200. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  7201. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  7202. do { \
  7203. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  7204. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  7205. } while (0)
  7206. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  7207. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  7208. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  7209. do { \
  7210. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  7211. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  7212. } while (0)
  7213. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  7214. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  7215. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  7216. do { \
  7217. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  7218. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  7219. } while (0)
  7220. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  7221. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  7222. /**
  7223. * @brief target -> host TX completion indication message definition
  7224. *
  7225. * @details
  7226. * The following diagram shows the format of the TX completion indication sent
  7227. * from the target to the host
  7228. *
  7229. * |31 27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  7230. * |------------------------------------------------------------|
  7231. * header: | rsvd |TP|A1|A0| num | t_i| tid |status| msg_type |
  7232. * |------------------------------------------------------------|
  7233. * payload: | MSDU1 ID | MSDU0 ID |
  7234. * |------------------------------------------------------------|
  7235. * : MSDU3 ID : MSDU2 ID :
  7236. * |------------------------------------------------------------|
  7237. * | struct htt_tx_compl_ind_append_retries |
  7238. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7239. * | struct htt_tx_compl_ind_append_tx_tstamp |
  7240. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7241. * Where:
  7242. * A0 = append (a.k.a. append0)
  7243. * A1 = append1
  7244. * TP = MSDU tx power presence
  7245. *
  7246. * The following field definitions describe the format of the TX completion
  7247. * indication sent from the target to the host
  7248. * Header fields:
  7249. * - msg_type
  7250. * Bits 7:0
  7251. * Purpose: identifies this as HTT TX completion indication
  7252. * Value: 0x7
  7253. * - status
  7254. * Bits 10:8
  7255. * Purpose: the TX completion status of payload fragmentations descriptors
  7256. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  7257. * - tid
  7258. * Bits 14:11
  7259. * Purpose: the tid associated with those fragmentation descriptors. It is
  7260. * valid or not, depending on the tid_invalid bit.
  7261. * Value: 0 to 15
  7262. * - tid_invalid
  7263. * Bits 15:15
  7264. * Purpose: this bit indicates whether the tid field is valid or not
  7265. * Value: 0 indicates valid; 1 indicates invalid
  7266. * - num
  7267. * Bits 23:16
  7268. * Purpose: the number of payload in this indication
  7269. * Value: 1 to 255
  7270. * - append (a.k.a. append0)
  7271. * Bits 24:24
  7272. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  7273. * the number of tx retries for one MSDU at the end of this message
  7274. * Value: 0 indicates no appending; 1 indicates appending
  7275. * - append1
  7276. * Bits 25:25
  7277. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  7278. * contains the timestamp info for each TX msdu id in payload.
  7279. * The order of the timestamps matches the order of the MSDU IDs.
  7280. * Note that a big-endian host needs to account for the reordering
  7281. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  7282. * conversion) when determining which tx timestamp corresponds to
  7283. * which MSDU ID.
  7284. * Value: 0 indicates no appending; 1 indicates appending
  7285. * - msdu_tx_power_presence
  7286. * Bits 26:26
  7287. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  7288. * for each MSDU referenced by the TX_COMPL_IND message.
  7289. * The tx power is reported in 0.5 dBm units.
  7290. * The order of the per-MSDU tx power reports matches the order
  7291. * of the MSDU IDs.
  7292. * Note that a big-endian host needs to account for the reordering
  7293. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  7294. * conversion) when determining which Tx Power corresponds to
  7295. * which MSDU ID.
  7296. * Value: 0 indicates MSDU tx power reports are not appended,
  7297. * 1 indicates MSDU tx power reports are appended
  7298. * Payload fields:
  7299. * - hmsdu_id
  7300. * Bits 15:0
  7301. * Purpose: this ID is used to track the Tx buffer in host
  7302. * Value: 0 to "size of host MSDU descriptor pool - 1"
  7303. */
  7304. #define HTT_TX_COMPL_IND_STATUS_S 8
  7305. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  7306. #define HTT_TX_COMPL_IND_TID_S 11
  7307. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  7308. #define HTT_TX_COMPL_IND_TID_INV_S 15
  7309. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  7310. #define HTT_TX_COMPL_IND_NUM_S 16
  7311. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  7312. #define HTT_TX_COMPL_IND_APPEND_S 24
  7313. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  7314. #define HTT_TX_COMPL_IND_APPEND1_S 25
  7315. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  7316. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  7317. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  7318. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  7319. do { \
  7320. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  7321. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  7322. } while (0)
  7323. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  7324. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  7325. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  7326. do { \
  7327. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  7328. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  7329. } while (0)
  7330. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  7331. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  7332. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  7333. do { \
  7334. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  7335. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  7336. } while (0)
  7337. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  7338. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  7339. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  7340. do { \
  7341. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  7342. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  7343. } while (0)
  7344. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  7345. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  7346. HTT_TX_COMPL_IND_TID_INV_S)
  7347. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  7348. do { \
  7349. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  7350. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  7351. } while (0)
  7352. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  7353. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  7354. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  7355. do { \
  7356. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  7357. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  7358. } while (0)
  7359. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  7360. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  7361. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  7362. do { \
  7363. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  7364. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  7365. } while (0)
  7366. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  7367. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  7368. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  7369. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  7370. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  7371. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  7372. #define HTT_TX_COMPL_IND_STAT_OK 0
  7373. /* DISCARD:
  7374. * current meaning:
  7375. * MSDUs were queued for transmission but filtered by HW or SW
  7376. * without any over the air attempts
  7377. * legacy meaning (HL Rome):
  7378. * MSDUs were discarded by the target FW without any over the air
  7379. * attempts due to lack of space
  7380. */
  7381. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  7382. /* NO_ACK:
  7383. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  7384. */
  7385. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  7386. /* POSTPONE:
  7387. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  7388. * be downloaded again later (in the appropriate order), when they are
  7389. * deliverable.
  7390. */
  7391. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  7392. /*
  7393. * The PEER_DEL tx completion status is used for HL cases
  7394. * where the peer the frame is for has been deleted.
  7395. * The host has already discarded its copy of the frame, but
  7396. * it still needs the tx completion to restore its credit.
  7397. */
  7398. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  7399. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  7400. #define HTT_TX_COMPL_IND_STAT_DROP 5
  7401. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  7402. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  7403. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  7404. PREPACK struct htt_tx_compl_ind_base {
  7405. A_UINT32 hdr;
  7406. A_UINT16 payload[1/*or more*/];
  7407. } POSTPACK;
  7408. PREPACK struct htt_tx_compl_ind_append_retries {
  7409. A_UINT16 msdu_id;
  7410. A_UINT8 tx_retries;
  7411. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  7412. 0: this is the last append_retries struct */
  7413. } POSTPACK;
  7414. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  7415. A_UINT32 timestamp[1/*or more*/];
  7416. } POSTPACK;
  7417. /**
  7418. * @brief target -> host rate-control update indication message
  7419. *
  7420. * @details
  7421. * The following diagram shows the format of the RC Update message
  7422. * sent from the target to the host, while processing the tx-completion
  7423. * of a transmitted PPDU.
  7424. *
  7425. * |31 24|23 16|15 8|7 0|
  7426. * |-------------------------------------------------------------|
  7427. * | peer ID | vdev ID | msg_type |
  7428. * |-------------------------------------------------------------|
  7429. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  7430. * |-------------------------------------------------------------|
  7431. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  7432. * |-------------------------------------------------------------|
  7433. * | : |
  7434. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  7435. * | : |
  7436. * |-------------------------------------------------------------|
  7437. * | : |
  7438. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  7439. * | : |
  7440. * |-------------------------------------------------------------|
  7441. * : :
  7442. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  7443. *
  7444. */
  7445. typedef struct {
  7446. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  7447. A_UINT32 rate_code_flags;
  7448. A_UINT32 flags; /* Encodes information such as excessive
  7449. retransmission, aggregate, some info
  7450. from .11 frame control,
  7451. STBC, LDPC, (SGI and Tx Chain Mask
  7452. are encoded in ptx_rc->flags field),
  7453. AMPDU truncation (BT/time based etc.),
  7454. RTS/CTS attempt */
  7455. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  7456. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  7457. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  7458. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  7459. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  7460. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  7461. } HTT_RC_TX_DONE_PARAMS;
  7462. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  7463. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  7464. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  7465. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  7466. #define HTT_RC_UPDATE_VDEVID_S 8
  7467. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  7468. #define HTT_RC_UPDATE_PEERID_S 16
  7469. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  7470. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  7471. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  7472. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  7473. do { \
  7474. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  7475. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  7476. } while (0)
  7477. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  7478. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  7479. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  7480. do { \
  7481. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  7482. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  7483. } while (0)
  7484. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  7485. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  7486. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  7487. do { \
  7488. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  7489. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  7490. } while (0)
  7491. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  7492. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  7493. /**
  7494. * @brief target -> host rx fragment indication message definition
  7495. *
  7496. * @details
  7497. * The following field definitions describe the format of the rx fragment
  7498. * indication message sent from the target to the host.
  7499. * The rx fragment indication message shares the format of the
  7500. * rx indication message, but not all fields from the rx indication message
  7501. * are relevant to the rx fragment indication message.
  7502. *
  7503. *
  7504. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  7505. * |-----------+-------------------+---------------------+-------------|
  7506. * | peer ID | |FV| ext TID | msg type |
  7507. * |-------------------------------------------------------------------|
  7508. * | | flush | flush |
  7509. * | | end | start |
  7510. * | | seq num | seq num |
  7511. * |-------------------------------------------------------------------|
  7512. * | reserved | FW rx desc bytes |
  7513. * |-------------------------------------------------------------------|
  7514. * | | FW MSDU Rx |
  7515. * | | desc B0 |
  7516. * |-------------------------------------------------------------------|
  7517. * Header fields:
  7518. * - MSG_TYPE
  7519. * Bits 7:0
  7520. * Purpose: identifies this as an rx fragment indication message
  7521. * Value: 0xa
  7522. * - EXT_TID
  7523. * Bits 12:8
  7524. * Purpose: identify the traffic ID of the rx data, including
  7525. * special "extended" TID values for multicast, broadcast, and
  7526. * non-QoS data frames
  7527. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  7528. * - FLUSH_VALID (FV)
  7529. * Bit 13
  7530. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  7531. * is valid
  7532. * Value:
  7533. * 1 -> flush IE is valid and needs to be processed
  7534. * 0 -> flush IE is not valid and should be ignored
  7535. * - PEER_ID
  7536. * Bits 31:16
  7537. * Purpose: Identify, by ID, which peer sent the rx data
  7538. * Value: ID of the peer who sent the rx data
  7539. * - FLUSH_SEQ_NUM_START
  7540. * Bits 5:0
  7541. * Purpose: Indicate the start of a series of MPDUs to flush
  7542. * Not all MPDUs within this series are necessarily valid - the host
  7543. * must check each sequence number within this range to see if the
  7544. * corresponding MPDU is actually present.
  7545. * This field is only valid if the FV bit is set.
  7546. * Value:
  7547. * The sequence number for the first MPDUs to check to flush.
  7548. * The sequence number is masked by 0x3f.
  7549. * - FLUSH_SEQ_NUM_END
  7550. * Bits 11:6
  7551. * Purpose: Indicate the end of a series of MPDUs to flush
  7552. * Value:
  7553. * The sequence number one larger than the sequence number of the
  7554. * last MPDU to check to flush.
  7555. * The sequence number is masked by 0x3f.
  7556. * Not all MPDUs within this series are necessarily valid - the host
  7557. * must check each sequence number within this range to see if the
  7558. * corresponding MPDU is actually present.
  7559. * This field is only valid if the FV bit is set.
  7560. * Rx descriptor fields:
  7561. * - FW_RX_DESC_BYTES
  7562. * Bits 15:0
  7563. * Purpose: Indicate how many bytes in the Rx indication are used for
  7564. * FW Rx descriptors
  7565. * Value: 1
  7566. */
  7567. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  7568. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  7569. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  7570. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  7571. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  7572. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  7573. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  7574. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  7575. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  7576. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  7577. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  7578. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  7579. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  7580. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  7581. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  7582. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  7583. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  7584. #define HTT_RX_FRAG_IND_BYTES \
  7585. (4 /* msg hdr */ + \
  7586. 4 /* flush spec */ + \
  7587. 4 /* (unused) FW rx desc bytes spec */ + \
  7588. 4 /* FW rx desc */)
  7589. /**
  7590. * @brief target -> host test message definition
  7591. *
  7592. * @details
  7593. * The following field definitions describe the format of the test
  7594. * message sent from the target to the host.
  7595. * The message consists of a 4-octet header, followed by a variable
  7596. * number of 32-bit integer values, followed by a variable number
  7597. * of 8-bit character values.
  7598. *
  7599. * |31 16|15 8|7 0|
  7600. * |-----------------------------------------------------------|
  7601. * | num chars | num ints | msg type |
  7602. * |-----------------------------------------------------------|
  7603. * | int 0 |
  7604. * |-----------------------------------------------------------|
  7605. * | int 1 |
  7606. * |-----------------------------------------------------------|
  7607. * | ... |
  7608. * |-----------------------------------------------------------|
  7609. * | char 3 | char 2 | char 1 | char 0 |
  7610. * |-----------------------------------------------------------|
  7611. * | | | ... | char 4 |
  7612. * |-----------------------------------------------------------|
  7613. * - MSG_TYPE
  7614. * Bits 7:0
  7615. * Purpose: identifies this as a test message
  7616. * Value: HTT_MSG_TYPE_TEST
  7617. * - NUM_INTS
  7618. * Bits 15:8
  7619. * Purpose: indicate how many 32-bit integers follow the message header
  7620. * - NUM_CHARS
  7621. * Bits 31:16
  7622. * Purpose: indicate how many 8-bit charaters follow the series of integers
  7623. */
  7624. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  7625. #define HTT_RX_TEST_NUM_INTS_S 8
  7626. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  7627. #define HTT_RX_TEST_NUM_CHARS_S 16
  7628. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  7629. do { \
  7630. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  7631. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  7632. } while (0)
  7633. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  7634. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  7635. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  7636. do { \
  7637. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  7638. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  7639. } while (0)
  7640. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  7641. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  7642. /**
  7643. * @brief target -> host packet log message
  7644. *
  7645. * @details
  7646. * The following field definitions describe the format of the packet log
  7647. * message sent from the target to the host.
  7648. * The message consists of a 4-octet header,followed by a variable number
  7649. * of 32-bit character values.
  7650. *
  7651. * |31 16|15 12|11 10|9 8|7 0|
  7652. * |------------------------------------------------------------------|
  7653. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  7654. * |------------------------------------------------------------------|
  7655. * | payload |
  7656. * |------------------------------------------------------------------|
  7657. * - MSG_TYPE
  7658. * Bits 7:0
  7659. * Purpose: identifies this as a pktlog message
  7660. * Value: HTT_T2H_MSG_TYPE_PKTLOG
  7661. * - mac_id
  7662. * Bits 9:8
  7663. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  7664. * Value: 0-3
  7665. * - pdev_id
  7666. * Bits 11:10
  7667. * Purpose: pdev_id
  7668. * Value: 0-3
  7669. * 0 (for rings at SOC level),
  7670. * 1/2/3 PDEV -> 0/1/2
  7671. * - payload_size
  7672. * Bits 31:16
  7673. * Purpose: explicitly specify the payload size
  7674. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  7675. */
  7676. PREPACK struct htt_pktlog_msg {
  7677. A_UINT32 header;
  7678. A_UINT32 payload[1/* or more */];
  7679. } POSTPACK;
  7680. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  7681. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  7682. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  7683. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  7684. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  7685. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  7686. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  7687. do { \
  7688. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  7689. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  7690. } while (0)
  7691. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  7692. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  7693. HTT_T2H_PKTLOG_MAC_ID_S)
  7694. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  7695. do { \
  7696. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  7697. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  7698. } while (0)
  7699. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  7700. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  7701. HTT_T2H_PKTLOG_PDEV_ID_S)
  7702. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  7703. do { \
  7704. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  7705. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  7706. } while (0)
  7707. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  7708. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  7709. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  7710. /*
  7711. * Rx reorder statistics
  7712. * NB: all the fields must be defined in 4 octets size.
  7713. */
  7714. struct rx_reorder_stats {
  7715. /* Non QoS MPDUs received */
  7716. A_UINT32 deliver_non_qos;
  7717. /* MPDUs received in-order */
  7718. A_UINT32 deliver_in_order;
  7719. /* Flush due to reorder timer expired */
  7720. A_UINT32 deliver_flush_timeout;
  7721. /* Flush due to move out of window */
  7722. A_UINT32 deliver_flush_oow;
  7723. /* Flush due to DELBA */
  7724. A_UINT32 deliver_flush_delba;
  7725. /* MPDUs dropped due to FCS error */
  7726. A_UINT32 fcs_error;
  7727. /* MPDUs dropped due to monitor mode non-data packet */
  7728. A_UINT32 mgmt_ctrl;
  7729. /* Unicast-data MPDUs dropped due to invalid peer */
  7730. A_UINT32 invalid_peer;
  7731. /* MPDUs dropped due to duplication (non aggregation) */
  7732. A_UINT32 dup_non_aggr;
  7733. /* MPDUs dropped due to processed before */
  7734. A_UINT32 dup_past;
  7735. /* MPDUs dropped due to duplicate in reorder queue */
  7736. A_UINT32 dup_in_reorder;
  7737. /* Reorder timeout happened */
  7738. A_UINT32 reorder_timeout;
  7739. /* invalid bar ssn */
  7740. A_UINT32 invalid_bar_ssn;
  7741. /* reorder reset due to bar ssn */
  7742. A_UINT32 ssn_reset;
  7743. /* Flush due to delete peer */
  7744. A_UINT32 deliver_flush_delpeer;
  7745. /* Flush due to offload*/
  7746. A_UINT32 deliver_flush_offload;
  7747. /* Flush due to out of buffer*/
  7748. A_UINT32 deliver_flush_oob;
  7749. /* MPDUs dropped due to PN check fail */
  7750. A_UINT32 pn_fail;
  7751. /* MPDUs dropped due to unable to allocate memory */
  7752. A_UINT32 store_fail;
  7753. /* Number of times the tid pool alloc succeeded */
  7754. A_UINT32 tid_pool_alloc_succ;
  7755. /* Number of times the MPDU pool alloc succeeded */
  7756. A_UINT32 mpdu_pool_alloc_succ;
  7757. /* Number of times the MSDU pool alloc succeeded */
  7758. A_UINT32 msdu_pool_alloc_succ;
  7759. /* Number of times the tid pool alloc failed */
  7760. A_UINT32 tid_pool_alloc_fail;
  7761. /* Number of times the MPDU pool alloc failed */
  7762. A_UINT32 mpdu_pool_alloc_fail;
  7763. /* Number of times the MSDU pool alloc failed */
  7764. A_UINT32 msdu_pool_alloc_fail;
  7765. /* Number of times the tid pool freed */
  7766. A_UINT32 tid_pool_free;
  7767. /* Number of times the MPDU pool freed */
  7768. A_UINT32 mpdu_pool_free;
  7769. /* Number of times the MSDU pool freed */
  7770. A_UINT32 msdu_pool_free;
  7771. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  7772. A_UINT32 msdu_queued;
  7773. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  7774. A_UINT32 msdu_recycled;
  7775. /* Number of MPDUs with invalid peer but A2 found in AST */
  7776. A_UINT32 invalid_peer_a2_in_ast;
  7777. /* Number of MPDUs with invalid peer but A3 found in AST */
  7778. A_UINT32 invalid_peer_a3_in_ast;
  7779. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  7780. A_UINT32 invalid_peer_bmc_mpdus;
  7781. /* Number of MSDUs with err attention word */
  7782. A_UINT32 rxdesc_err_att;
  7783. /* Number of MSDUs with flag of peer_idx_invalid */
  7784. A_UINT32 rxdesc_err_peer_idx_inv;
  7785. /* Number of MSDUs with flag of peer_idx_timeout */
  7786. A_UINT32 rxdesc_err_peer_idx_to;
  7787. /* Number of MSDUs with flag of overflow */
  7788. A_UINT32 rxdesc_err_ov;
  7789. /* Number of MSDUs with flag of msdu_length_err */
  7790. A_UINT32 rxdesc_err_msdu_len;
  7791. /* Number of MSDUs with flag of mpdu_length_err */
  7792. A_UINT32 rxdesc_err_mpdu_len;
  7793. /* Number of MSDUs with flag of tkip_mic_err */
  7794. A_UINT32 rxdesc_err_tkip_mic;
  7795. /* Number of MSDUs with flag of decrypt_err */
  7796. A_UINT32 rxdesc_err_decrypt;
  7797. /* Number of MSDUs with flag of fcs_err */
  7798. A_UINT32 rxdesc_err_fcs;
  7799. /* Number of Unicast (bc_mc bit is not set in attention word)
  7800. * frames with invalid peer handler
  7801. */
  7802. A_UINT32 rxdesc_uc_msdus_inv_peer;
  7803. /* Number of unicast frame directly (direct bit is set in attention word)
  7804. * to DUT with invalid peer handler
  7805. */
  7806. A_UINT32 rxdesc_direct_msdus_inv_peer;
  7807. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  7808. * frames with invalid peer handler
  7809. */
  7810. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  7811. /* Number of MSDUs dropped due to no first MSDU flag */
  7812. A_UINT32 rxdesc_no_1st_msdu;
  7813. /* Number of MSDUs droped due to ring overflow */
  7814. A_UINT32 msdu_drop_ring_ov;
  7815. /* Number of MSDUs dropped due to FC mismatch */
  7816. A_UINT32 msdu_drop_fc_mismatch;
  7817. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  7818. A_UINT32 msdu_drop_mgmt_remote_ring;
  7819. /* Number of MSDUs dropped due to errors not reported in attention word */
  7820. A_UINT32 msdu_drop_misc;
  7821. /* Number of MSDUs go to offload before reorder */
  7822. A_UINT32 offload_msdu_wal;
  7823. /* Number of data frame dropped by offload after reorder */
  7824. A_UINT32 offload_msdu_reorder;
  7825. /* Number of MPDUs with sequence number in the past and within the BA window */
  7826. A_UINT32 dup_past_within_window;
  7827. /* Number of MPDUs with sequence number in the past and outside the BA window */
  7828. A_UINT32 dup_past_outside_window;
  7829. /* Number of MSDUs with decrypt/MIC error */
  7830. A_UINT32 rxdesc_err_decrypt_mic;
  7831. /* Number of data MSDUs received on both local and remote rings */
  7832. A_UINT32 data_msdus_on_both_rings;
  7833. /* MPDUs never filled */
  7834. A_UINT32 holes_not_filled;
  7835. };
  7836. /*
  7837. * Rx Remote buffer statistics
  7838. * NB: all the fields must be defined in 4 octets size.
  7839. */
  7840. struct rx_remote_buffer_mgmt_stats {
  7841. /* Total number of MSDUs reaped for Rx processing */
  7842. A_UINT32 remote_reaped;
  7843. /* MSDUs recycled within firmware */
  7844. A_UINT32 remote_recycled;
  7845. /* MSDUs stored by Data Rx */
  7846. A_UINT32 data_rx_msdus_stored;
  7847. /* Number of HTT indications from WAL Rx MSDU */
  7848. A_UINT32 wal_rx_ind;
  7849. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  7850. A_UINT32 wal_rx_ind_unconsumed;
  7851. /* Number of HTT indications from Data Rx MSDU */
  7852. A_UINT32 data_rx_ind;
  7853. /* Number of unconsumed HTT indications from Data Rx MSDU */
  7854. A_UINT32 data_rx_ind_unconsumed;
  7855. /* Number of HTT indications from ATHBUF */
  7856. A_UINT32 athbuf_rx_ind;
  7857. /* Number of remote buffers requested for refill */
  7858. A_UINT32 refill_buf_req;
  7859. /* Number of remote buffers filled by the host */
  7860. A_UINT32 refill_buf_rsp;
  7861. /* Number of times MAC hw_index = f/w write_index */
  7862. A_INT32 mac_no_bufs;
  7863. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  7864. A_INT32 fw_indices_equal;
  7865. /* Number of times f/w finds no buffers to post */
  7866. A_INT32 host_no_bufs;
  7867. };
  7868. /*
  7869. * TXBF MU/SU packets and NDPA statistics
  7870. * NB: all the fields must be defined in 4 octets size.
  7871. */
  7872. struct rx_txbf_musu_ndpa_pkts_stats {
  7873. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  7874. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  7875. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  7876. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  7877. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  7878. A_UINT32 reserved[3]; /* must be set to 0x0 */
  7879. };
  7880. /*
  7881. * htt_dbg_stats_status -
  7882. * present - The requested stats have been delivered in full.
  7883. * This indicates that either the stats information was contained
  7884. * in its entirety within this message, or else this message
  7885. * completes the delivery of the requested stats info that was
  7886. * partially delivered through earlier STATS_CONF messages.
  7887. * partial - The requested stats have been delivered in part.
  7888. * One or more subsequent STATS_CONF messages with the same
  7889. * cookie value will be sent to deliver the remainder of the
  7890. * information.
  7891. * error - The requested stats could not be delivered, for example due
  7892. * to a shortage of memory to construct a message holding the
  7893. * requested stats.
  7894. * invalid - The requested stat type is either not recognized, or the
  7895. * target is configured to not gather the stats type in question.
  7896. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  7897. * series_done - This special value indicates that no further stats info
  7898. * elements are present within a series of stats info elems
  7899. * (within a stats upload confirmation message).
  7900. */
  7901. enum htt_dbg_stats_status {
  7902. HTT_DBG_STATS_STATUS_PRESENT = 0,
  7903. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  7904. HTT_DBG_STATS_STATUS_ERROR = 2,
  7905. HTT_DBG_STATS_STATUS_INVALID = 3,
  7906. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  7907. };
  7908. /**
  7909. * @brief target -> host statistics upload
  7910. *
  7911. * @details
  7912. * The following field definitions describe the format of the HTT target
  7913. * to host stats upload confirmation message.
  7914. * The message contains a cookie echoed from the HTT host->target stats
  7915. * upload request, which identifies which request the confirmation is
  7916. * for, and a series of tag-length-value stats information elements.
  7917. * The tag-length header for each stats info element also includes a
  7918. * status field, to indicate whether the request for the stat type in
  7919. * question was fully met, partially met, unable to be met, or invalid
  7920. * (if the stat type in question is disabled in the target).
  7921. * A special value of all 1's in this status field is used to indicate
  7922. * the end of the series of stats info elements.
  7923. *
  7924. *
  7925. * |31 16|15 8|7 5|4 0|
  7926. * |------------------------------------------------------------|
  7927. * | reserved | msg type |
  7928. * |------------------------------------------------------------|
  7929. * | cookie LSBs |
  7930. * |------------------------------------------------------------|
  7931. * | cookie MSBs |
  7932. * |------------------------------------------------------------|
  7933. * | stats entry length | reserved | S |stat type|
  7934. * |------------------------------------------------------------|
  7935. * | |
  7936. * | type-specific stats info |
  7937. * | |
  7938. * |------------------------------------------------------------|
  7939. * | stats entry length | reserved | S |stat type|
  7940. * |------------------------------------------------------------|
  7941. * | |
  7942. * | type-specific stats info |
  7943. * | |
  7944. * |------------------------------------------------------------|
  7945. * | n/a | reserved | 111 | n/a |
  7946. * |------------------------------------------------------------|
  7947. * Header fields:
  7948. * - MSG_TYPE
  7949. * Bits 7:0
  7950. * Purpose: identifies this is a statistics upload confirmation message
  7951. * Value: 0x9
  7952. * - COOKIE_LSBS
  7953. * Bits 31:0
  7954. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7955. * message with its preceding host->target stats request message.
  7956. * Value: LSBs of the opaque cookie specified by the host-side requestor
  7957. * - COOKIE_MSBS
  7958. * Bits 31:0
  7959. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7960. * message with its preceding host->target stats request message.
  7961. * Value: MSBs of the opaque cookie specified by the host-side requestor
  7962. *
  7963. * Stats Information Element tag-length header fields:
  7964. * - STAT_TYPE
  7965. * Bits 4:0
  7966. * Purpose: identifies the type of statistics info held in the
  7967. * following information element
  7968. * Value: htt_dbg_stats_type
  7969. * - STATUS
  7970. * Bits 7:5
  7971. * Purpose: indicate whether the requested stats are present
  7972. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  7973. * the completion of the stats entry series
  7974. * - LENGTH
  7975. * Bits 31:16
  7976. * Purpose: indicate the stats information size
  7977. * Value: This field specifies the number of bytes of stats information
  7978. * that follows the element tag-length header.
  7979. * It is expected but not required that this length is a multiple of
  7980. * 4 bytes. Even if the length is not an integer multiple of 4, the
  7981. * subsequent stats entry header will begin on a 4-byte aligned
  7982. * boundary.
  7983. */
  7984. #define HTT_T2H_STATS_COOKIE_SIZE 8
  7985. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  7986. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  7987. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  7988. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  7989. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  7990. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  7991. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  7992. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  7993. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  7994. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  7995. do { \
  7996. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  7997. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  7998. } while (0)
  7999. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  8000. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  8001. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  8002. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  8003. do { \
  8004. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  8005. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  8006. } while (0)
  8007. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  8008. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  8009. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  8010. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  8011. do { \
  8012. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  8013. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  8014. } while (0)
  8015. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  8016. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  8017. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  8018. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  8019. #define HTT_MAX_AGGR 64
  8020. #define HTT_HL_MAX_AGGR 18
  8021. /**
  8022. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  8023. *
  8024. * @details
  8025. * The following field definitions describe the format of the HTT host
  8026. * to target frag_desc/msdu_ext bank configuration message.
  8027. * The message contains the based address and the min and max id of the
  8028. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  8029. * MSDU_EXT/FRAG_DESC.
  8030. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  8031. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  8032. * the hardware does the mapping/translation.
  8033. *
  8034. * Total banks that can be configured is configured to 16.
  8035. *
  8036. * This should be called before any TX has be initiated by the HTT
  8037. *
  8038. * |31 16|15 8|7 5|4 0|
  8039. * |------------------------------------------------------------|
  8040. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  8041. * |------------------------------------------------------------|
  8042. * | BANK0_BASE_ADDRESS (bits 31:0) |
  8043. #if HTT_PADDR64
  8044. * | BANK0_BASE_ADDRESS (bits 63:32) |
  8045. #endif
  8046. * |------------------------------------------------------------|
  8047. * | ... |
  8048. * |------------------------------------------------------------|
  8049. * | BANK15_BASE_ADDRESS (bits 31:0) |
  8050. #if HTT_PADDR64
  8051. * | BANK15_BASE_ADDRESS (bits 63:32) |
  8052. #endif
  8053. * |------------------------------------------------------------|
  8054. * | BANK0_MAX_ID | BANK0_MIN_ID |
  8055. * |------------------------------------------------------------|
  8056. * | ... |
  8057. * |------------------------------------------------------------|
  8058. * | BANK15_MAX_ID | BANK15_MIN_ID |
  8059. * |------------------------------------------------------------|
  8060. * Header fields:
  8061. * - MSG_TYPE
  8062. * Bits 7:0
  8063. * Value: 0x6
  8064. * for systems with 64-bit format for bus addresses:
  8065. * - BANKx_BASE_ADDRESS_LO
  8066. * Bits 31:0
  8067. * Purpose: Provide a mechanism to specify the base address of the
  8068. * MSDU_EXT bank physical/bus address.
  8069. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  8070. * - BANKx_BASE_ADDRESS_HI
  8071. * Bits 31:0
  8072. * Purpose: Provide a mechanism to specify the base address of the
  8073. * MSDU_EXT bank physical/bus address.
  8074. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  8075. * for systems with 32-bit format for bus addresses:
  8076. * - BANKx_BASE_ADDRESS
  8077. * Bits 31:0
  8078. * Purpose: Provide a mechanism to specify the base address of the
  8079. * MSDU_EXT bank physical/bus address.
  8080. * Value: MSDU_EXT bank physical / bus address
  8081. * - BANKx_MIN_ID
  8082. * Bits 15:0
  8083. * Purpose: Provide a mechanism to specify the min index that needs to
  8084. * mapped.
  8085. * - BANKx_MAX_ID
  8086. * Bits 31:16
  8087. * Purpose: Provide a mechanism to specify the max index that needs to
  8088. * mapped.
  8089. *
  8090. */
  8091. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  8092. * safe value.
  8093. * @note MAX supported banks is 16.
  8094. */
  8095. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  8096. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  8097. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  8098. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  8099. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  8100. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  8101. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  8102. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  8103. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  8104. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  8105. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  8106. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  8107. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  8108. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  8109. do { \
  8110. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  8111. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  8112. } while (0)
  8113. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  8114. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  8115. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  8116. do { \
  8117. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  8118. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  8119. } while (0)
  8120. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  8121. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  8122. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  8123. do { \
  8124. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  8125. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  8126. } while (0)
  8127. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  8128. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  8129. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  8130. do { \
  8131. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  8132. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  8133. } while (0)
  8134. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  8135. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  8136. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  8137. do { \
  8138. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  8139. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  8140. } while (0)
  8141. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  8142. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  8143. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  8144. do { \
  8145. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  8146. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  8147. } while (0)
  8148. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  8149. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  8150. /*
  8151. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  8152. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  8153. * addresses are stored in a XXX-bit field.
  8154. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  8155. * htt_tx_frag_desc64_bank_cfg_t structs.
  8156. */
  8157. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  8158. _paddr_bits_, \
  8159. _paddr__bank_base_address_) \
  8160. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  8161. /** word 0 \
  8162. * msg_type: 8, \
  8163. * pdev_id: 2, \
  8164. * swap: 1, \
  8165. * reserved0: 5, \
  8166. * num_banks: 8, \
  8167. * desc_size: 8; \
  8168. */ \
  8169. A_UINT32 word0; \
  8170. /* \
  8171. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  8172. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  8173. * the second A_UINT32). \
  8174. */ \
  8175. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  8176. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  8177. } POSTPACK
  8178. /* define htt_tx_frag_desc32_bank_cfg_t */
  8179. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  8180. /* define htt_tx_frag_desc64_bank_cfg_t */
  8181. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  8182. /*
  8183. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  8184. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  8185. */
  8186. #if HTT_PADDR64
  8187. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  8188. #else
  8189. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  8190. #endif
  8191. /**
  8192. * @brief target -> host HTT TX Credit total count update message definition
  8193. *
  8194. *|31 16|15|14 9| 8 |7 0 |
  8195. *|---------------------+--+----------+-------+----------|
  8196. *|cur htt credit delta | Q| reserved | sign | msg type |
  8197. *|------------------------------------------------------|
  8198. *
  8199. * Header fields:
  8200. * - MSG_TYPE
  8201. * Bits 7:0
  8202. * Purpose: identifies this as a htt tx credit delta update message
  8203. * Value: 0xe
  8204. * - SIGN
  8205. * Bits 8
  8206. * identifies whether credit delta is positive or negative
  8207. * Value:
  8208. * - 0x0: credit delta is positive, rebalance in some buffers
  8209. * - 0x1: credit delta is negative, rebalance out some buffers
  8210. * - reserved
  8211. * Bits 14:9
  8212. * Value: 0x0
  8213. * - TXQ_GRP
  8214. * Bit 15
  8215. * Purpose: indicates whether any tx queue group information elements
  8216. * are appended to the tx credit update message
  8217. * Value: 0 -> no tx queue group information element is present
  8218. * 1 -> a tx queue group information element immediately follows
  8219. * - DELTA_COUNT
  8220. * Bits 31:16
  8221. * Purpose: Specify current htt credit delta absolute count
  8222. */
  8223. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  8224. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  8225. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  8226. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  8227. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  8228. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  8229. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  8230. do { \
  8231. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  8232. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  8233. } while (0)
  8234. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  8235. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  8236. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  8237. do { \
  8238. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  8239. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  8240. } while (0)
  8241. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  8242. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  8243. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  8244. do { \
  8245. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  8246. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  8247. } while (0)
  8248. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  8249. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  8250. #define HTT_TX_CREDIT_MSG_BYTES 4
  8251. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  8252. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  8253. /**
  8254. * @brief HTT WDI_IPA Operation Response Message
  8255. *
  8256. * @details
  8257. * HTT WDI_IPA Operation Response message is sent by target
  8258. * to host confirming suspend or resume operation.
  8259. * |31 24|23 16|15 8|7 0|
  8260. * |----------------+----------------+----------------+----------------|
  8261. * | op_code | Rsvd | msg_type |
  8262. * |-------------------------------------------------------------------|
  8263. * | Rsvd | Response len |
  8264. * |-------------------------------------------------------------------|
  8265. * | |
  8266. * | Response-type specific info |
  8267. * | |
  8268. * | |
  8269. * |-------------------------------------------------------------------|
  8270. * Header fields:
  8271. * - MSG_TYPE
  8272. * Bits 7:0
  8273. * Purpose: Identifies this as WDI_IPA Operation Response message
  8274. * value: = 0x13
  8275. * - OP_CODE
  8276. * Bits 31:16
  8277. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  8278. * value: = enum htt_wdi_ipa_op_code
  8279. * - RSP_LEN
  8280. * Bits 16:0
  8281. * Purpose: length for the response-type specific info
  8282. * value: = length in bytes for response-type specific info
  8283. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  8284. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  8285. */
  8286. PREPACK struct htt_wdi_ipa_op_response_t
  8287. {
  8288. /* DWORD 0: flags and meta-data */
  8289. A_UINT32
  8290. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  8291. reserved1: 8,
  8292. op_code: 16;
  8293. A_UINT32
  8294. rsp_len: 16,
  8295. reserved2: 16;
  8296. } POSTPACK;
  8297. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  8298. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  8299. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  8300. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  8301. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  8302. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  8303. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  8304. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  8305. do { \
  8306. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  8307. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  8308. } while (0)
  8309. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  8310. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  8311. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  8312. do { \
  8313. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  8314. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  8315. } while (0)
  8316. enum htt_phy_mode {
  8317. htt_phy_mode_11a = 0,
  8318. htt_phy_mode_11g = 1,
  8319. htt_phy_mode_11b = 2,
  8320. htt_phy_mode_11g_only = 3,
  8321. htt_phy_mode_11na_ht20 = 4,
  8322. htt_phy_mode_11ng_ht20 = 5,
  8323. htt_phy_mode_11na_ht40 = 6,
  8324. htt_phy_mode_11ng_ht40 = 7,
  8325. htt_phy_mode_11ac_vht20 = 8,
  8326. htt_phy_mode_11ac_vht40 = 9,
  8327. htt_phy_mode_11ac_vht80 = 10,
  8328. htt_phy_mode_11ac_vht20_2g = 11,
  8329. htt_phy_mode_11ac_vht40_2g = 12,
  8330. htt_phy_mode_11ac_vht80_2g = 13,
  8331. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  8332. htt_phy_mode_11ac_vht160 = 15,
  8333. htt_phy_mode_max,
  8334. };
  8335. /**
  8336. * @brief target -> host HTT channel change indication
  8337. * @details
  8338. * Specify when a channel change occurs.
  8339. * This allows the host to precisely determine which rx frames arrived
  8340. * on the old channel and which rx frames arrived on the new channel.
  8341. *
  8342. *|31 |7 0 |
  8343. *|-------------------------------------------+----------|
  8344. *| reserved | msg type |
  8345. *|------------------------------------------------------|
  8346. *| primary_chan_center_freq_mhz |
  8347. *|------------------------------------------------------|
  8348. *| contiguous_chan1_center_freq_mhz |
  8349. *|------------------------------------------------------|
  8350. *| contiguous_chan2_center_freq_mhz |
  8351. *|------------------------------------------------------|
  8352. *| phy_mode |
  8353. *|------------------------------------------------------|
  8354. *
  8355. * Header fields:
  8356. * - MSG_TYPE
  8357. * Bits 7:0
  8358. * Purpose: identifies this as a htt channel change indication message
  8359. * Value: 0x15
  8360. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  8361. * Bits 31:0
  8362. * Purpose: identify the (center of the) new 20 MHz primary channel
  8363. * Value: center frequency of the 20 MHz primary channel, in MHz units
  8364. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  8365. * Bits 31:0
  8366. * Purpose: identify the (center of the) contiguous frequency range
  8367. * comprising the new channel.
  8368. * For example, if the new channel is a 80 MHz channel extending
  8369. * 60 MHz beyond the primary channel, this field would be 30 larger
  8370. * than the primary channel center frequency field.
  8371. * Value: center frequency of the contiguous frequency range comprising
  8372. * the full channel in MHz units
  8373. * (80+80 channels also use the CONTIG_CHAN2 field)
  8374. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  8375. * Bits 31:0
  8376. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  8377. * within a VHT 80+80 channel.
  8378. * This field is only relevant for VHT 80+80 channels.
  8379. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  8380. * channel (arbitrary value for cases besides VHT 80+80)
  8381. * - PHY_MODE
  8382. * Bits 31:0
  8383. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  8384. * and band
  8385. * Value: htt_phy_mode enum value
  8386. */
  8387. PREPACK struct htt_chan_change_t
  8388. {
  8389. /* DWORD 0: flags and meta-data */
  8390. A_UINT32
  8391. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  8392. reserved1: 24;
  8393. A_UINT32 primary_chan_center_freq_mhz;
  8394. A_UINT32 contig_chan1_center_freq_mhz;
  8395. A_UINT32 contig_chan2_center_freq_mhz;
  8396. A_UINT32 phy_mode;
  8397. } POSTPACK;
  8398. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  8399. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  8400. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  8401. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  8402. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  8403. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  8404. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  8405. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  8406. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  8407. do { \
  8408. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  8409. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  8410. } while (0)
  8411. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  8412. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  8413. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  8414. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  8415. do { \
  8416. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  8417. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  8418. } while (0)
  8419. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  8420. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  8421. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  8422. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  8423. do { \
  8424. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  8425. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  8426. } while (0)
  8427. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  8428. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  8429. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  8430. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  8431. do { \
  8432. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  8433. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  8434. } while (0)
  8435. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  8436. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  8437. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  8438. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  8439. /**
  8440. * @brief rx offload packet error message
  8441. *
  8442. * @details
  8443. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  8444. * of target payload like mic err.
  8445. *
  8446. * |31 24|23 16|15 8|7 0|
  8447. * |----------------+----------------+----------------+----------------|
  8448. * | tid | vdev_id | msg_sub_type | msg_type |
  8449. * |-------------------------------------------------------------------|
  8450. * : (sub-type dependent content) :
  8451. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  8452. * Header fields:
  8453. * - msg_type
  8454. * Bits 7:0
  8455. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  8456. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  8457. * - msg_sub_type
  8458. * Bits 15:8
  8459. * Purpose: Identifies which type of rx error is reported by this message
  8460. * value: htt_rx_ofld_pkt_err_type
  8461. * - vdev_id
  8462. * Bits 23:16
  8463. * Purpose: Identifies which vdev received the erroneous rx frame
  8464. * value:
  8465. * - tid
  8466. * Bits 31:24
  8467. * Purpose: Identifies the traffic type of the rx frame
  8468. * value:
  8469. *
  8470. * - The payload fields used if the sub-type == MIC error are shown below.
  8471. * Note - MIC err is per MSDU, while PN is per MPDU.
  8472. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  8473. * with MIC err in A-MSDU case, so FW will send only one HTT message
  8474. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  8475. * instead of sending separate HTT messages for each wrong MSDU within
  8476. * the MPDU.
  8477. *
  8478. * |31 24|23 16|15 8|7 0|
  8479. * |----------------+----------------+----------------+----------------|
  8480. * | Rsvd | key_id | peer_id |
  8481. * |-------------------------------------------------------------------|
  8482. * | receiver MAC addr 31:0 |
  8483. * |-------------------------------------------------------------------|
  8484. * | Rsvd | receiver MAC addr 47:32 |
  8485. * |-------------------------------------------------------------------|
  8486. * | transmitter MAC addr 31:0 |
  8487. * |-------------------------------------------------------------------|
  8488. * | Rsvd | transmitter MAC addr 47:32 |
  8489. * |-------------------------------------------------------------------|
  8490. * | PN 31:0 |
  8491. * |-------------------------------------------------------------------|
  8492. * | Rsvd | PN 47:32 |
  8493. * |-------------------------------------------------------------------|
  8494. * - peer_id
  8495. * Bits 15:0
  8496. * Purpose: identifies which peer is frame is from
  8497. * value:
  8498. * - key_id
  8499. * Bits 23:16
  8500. * Purpose: identifies key_id of rx frame
  8501. * value:
  8502. * - RA_31_0 (receiver MAC addr 31:0)
  8503. * Bits 31:0
  8504. * Purpose: identifies by MAC address which vdev received the frame
  8505. * value: MAC address lower 4 bytes
  8506. * - RA_47_32 (receiver MAC addr 47:32)
  8507. * Bits 15:0
  8508. * Purpose: identifies by MAC address which vdev received the frame
  8509. * value: MAC address upper 2 bytes
  8510. * - TA_31_0 (transmitter MAC addr 31:0)
  8511. * Bits 31:0
  8512. * Purpose: identifies by MAC address which peer transmitted the frame
  8513. * value: MAC address lower 4 bytes
  8514. * - TA_47_32 (transmitter MAC addr 47:32)
  8515. * Bits 15:0
  8516. * Purpose: identifies by MAC address which peer transmitted the frame
  8517. * value: MAC address upper 2 bytes
  8518. * - PN_31_0
  8519. * Bits 31:0
  8520. * Purpose: Identifies pn of rx frame
  8521. * value: PN lower 4 bytes
  8522. * - PN_47_32
  8523. * Bits 15:0
  8524. * Purpose: Identifies pn of rx frame
  8525. * value:
  8526. * TKIP or CCMP: PN upper 2 bytes
  8527. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  8528. */
  8529. enum htt_rx_ofld_pkt_err_type {
  8530. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  8531. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  8532. };
  8533. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  8534. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  8535. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  8536. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  8537. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  8538. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  8539. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  8540. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  8541. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  8542. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  8543. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  8544. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  8545. do { \
  8546. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  8547. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  8548. } while (0)
  8549. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  8550. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  8551. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  8552. do { \
  8553. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  8554. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  8555. } while (0)
  8556. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  8557. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  8558. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  8559. do { \
  8560. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  8561. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  8562. } while (0)
  8563. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  8564. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  8565. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  8566. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  8567. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  8568. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  8569. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  8570. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  8571. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  8572. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  8573. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  8574. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  8575. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  8576. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  8577. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  8578. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  8579. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  8580. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  8581. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  8582. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  8583. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  8584. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  8585. do { \
  8586. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  8587. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  8588. } while (0)
  8589. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  8590. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  8591. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  8592. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  8593. do { \
  8594. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  8595. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  8596. } while (0)
  8597. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  8598. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  8599. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  8600. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  8601. do { \
  8602. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  8603. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  8604. } while (0)
  8605. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  8606. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  8607. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  8608. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  8609. do { \
  8610. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  8611. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  8612. } while (0)
  8613. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  8614. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  8615. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  8616. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  8617. do { \
  8618. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  8619. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  8620. } while (0)
  8621. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  8622. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  8623. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  8624. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  8625. do { \
  8626. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  8627. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  8628. } while (0)
  8629. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  8630. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  8631. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  8632. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  8633. do { \
  8634. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  8635. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  8636. } while (0)
  8637. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  8638. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  8639. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  8640. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  8641. do { \
  8642. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  8643. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  8644. } while (0)
  8645. /**
  8646. * @brief peer rate report message
  8647. *
  8648. * @details
  8649. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  8650. * justified rate of all the peers.
  8651. *
  8652. * |31 24|23 16|15 8|7 0|
  8653. * |----------------+----------------+----------------+----------------|
  8654. * | peer_count | | msg_type |
  8655. * |-------------------------------------------------------------------|
  8656. * : Payload (variant number of peer rate report) :
  8657. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  8658. * Header fields:
  8659. * - msg_type
  8660. * Bits 7:0
  8661. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  8662. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  8663. * - reserved
  8664. * Bits 15:8
  8665. * Purpose:
  8666. * value:
  8667. * - peer_count
  8668. * Bits 31:16
  8669. * Purpose: Specify how many peer rate report elements are present in the payload.
  8670. * value:
  8671. *
  8672. * Payload:
  8673. * There are variant number of peer rate report follow the first 32 bits.
  8674. * The peer rate report is defined as follows.
  8675. *
  8676. * |31 20|19 16|15 0|
  8677. * |-----------------------+---------+---------------------------------|-
  8678. * | reserved | phy | peer_id | \
  8679. * |-------------------------------------------------------------------| -> report #0
  8680. * | rate | /
  8681. * |-----------------------+---------+---------------------------------|-
  8682. * | reserved | phy | peer_id | \
  8683. * |-------------------------------------------------------------------| -> report #1
  8684. * | rate | /
  8685. * |-----------------------+---------+---------------------------------|-
  8686. * | reserved | phy | peer_id | \
  8687. * |-------------------------------------------------------------------| -> report #2
  8688. * | rate | /
  8689. * |-------------------------------------------------------------------|-
  8690. * : :
  8691. * : :
  8692. * : :
  8693. * :-------------------------------------------------------------------:
  8694. *
  8695. * - peer_id
  8696. * Bits 15:0
  8697. * Purpose: identify the peer
  8698. * value:
  8699. * - phy
  8700. * Bits 19:16
  8701. * Purpose: identify which phy is in use
  8702. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  8703. * Please see enum htt_peer_report_phy_type for detail.
  8704. * - reserved
  8705. * Bits 31:20
  8706. * Purpose:
  8707. * value:
  8708. * - rate
  8709. * Bits 31:0
  8710. * Purpose: represent the justified rate of the peer specified by peer_id
  8711. * value:
  8712. */
  8713. enum htt_peer_rate_report_phy_type {
  8714. HTT_PEER_RATE_REPORT_11B = 0,
  8715. HTT_PEER_RATE_REPORT_11A_G,
  8716. HTT_PEER_RATE_REPORT_11N,
  8717. HTT_PEER_RATE_REPORT_11AC,
  8718. };
  8719. #define HTT_PEER_RATE_REPORT_SIZE 8
  8720. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  8721. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  8722. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  8723. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  8724. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  8725. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  8726. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  8727. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  8728. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  8729. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  8730. do { \
  8731. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  8732. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  8733. } while (0)
  8734. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  8735. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  8736. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  8737. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  8738. do { \
  8739. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  8740. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  8741. } while (0)
  8742. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  8743. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  8744. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  8745. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  8746. do { \
  8747. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  8748. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  8749. } while (0)
  8750. /**
  8751. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_MAP Message
  8752. *
  8753. * @details
  8754. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  8755. * a flow of descriptors.
  8756. *
  8757. * This message is in TLV format and indicates the parameters to be setup a
  8758. * flow in the host. Each entry indicates that a particular flow ID is ready to
  8759. * receive descriptors from a specified pool.
  8760. *
  8761. * The message would appear as follows:
  8762. *
  8763. * |31 24|23 16|15 8|7 0|
  8764. * |----------------+----------------+----------------+----------------|
  8765. * header | reserved | num_flows | msg_type |
  8766. * |-------------------------------------------------------------------|
  8767. * | |
  8768. * : payload :
  8769. * | |
  8770. * |-------------------------------------------------------------------|
  8771. *
  8772. * The header field is one DWORD long and is interpreted as follows:
  8773. * b'0:7 - msg_type: This will be set to HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  8774. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  8775. * this message
  8776. * b'16-31 - reserved: These bits are reserved for future use
  8777. *
  8778. * Payload:
  8779. * The payload would contain multiple objects of the following structure. Each
  8780. * object represents a flow.
  8781. *
  8782. * |31 24|23 16|15 8|7 0|
  8783. * |----------------+----------------+----------------+----------------|
  8784. * header | reserved | num_flows | msg_type |
  8785. * |-------------------------------------------------------------------|
  8786. * payload0| flow_type |
  8787. * |-------------------------------------------------------------------|
  8788. * | flow_id |
  8789. * |-------------------------------------------------------------------|
  8790. * | reserved0 | flow_pool_id |
  8791. * |-------------------------------------------------------------------|
  8792. * | reserved1 | flow_pool_size |
  8793. * |-------------------------------------------------------------------|
  8794. * | reserved2 |
  8795. * |-------------------------------------------------------------------|
  8796. * payload1| flow_type |
  8797. * |-------------------------------------------------------------------|
  8798. * | flow_id |
  8799. * |-------------------------------------------------------------------|
  8800. * | reserved0 | flow_pool_id |
  8801. * |-------------------------------------------------------------------|
  8802. * | reserved1 | flow_pool_size |
  8803. * |-------------------------------------------------------------------|
  8804. * | reserved2 |
  8805. * |-------------------------------------------------------------------|
  8806. * | . |
  8807. * | . |
  8808. * | . |
  8809. * |-------------------------------------------------------------------|
  8810. *
  8811. * Each payload is 5 DWORDS long and is interpreted as follows:
  8812. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  8813. * this flow is associated. It can be VDEV, peer,
  8814. * or tid (AC). Based on enum htt_flow_type.
  8815. *
  8816. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  8817. * object. For flow_type vdev it is set to the
  8818. * vdevid, for peer it is peerid and for tid, it is
  8819. * tid_num.
  8820. *
  8821. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  8822. * in the host for this flow
  8823. * b'16:31 - reserved0: This field in reserved for the future. In case
  8824. * we have a hierarchical implementation (HCM) of
  8825. * pools, it can be used to indicate the ID of the
  8826. * parent-pool.
  8827. *
  8828. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  8829. * Descriptors for this flow will be
  8830. * allocated from this pool in the host.
  8831. * b'16:31 - reserved1: This field in reserved for the future. In case
  8832. * we have a hierarchical implementation of pools,
  8833. * it can be used to indicate the max number of
  8834. * descriptors in the pool. The b'0:15 can be used
  8835. * to indicate min number of descriptors in the
  8836. * HCM scheme.
  8837. *
  8838. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  8839. * we have a hierarchical implementation of pools,
  8840. * b'0:15 can be used to indicate the
  8841. * priority-based borrowing (PBB) threshold of
  8842. * the flow's pool. The b'16:31 are still left
  8843. * reserved.
  8844. */
  8845. enum htt_flow_type {
  8846. FLOW_TYPE_VDEV = 0,
  8847. /* Insert new flow types above this line */
  8848. };
  8849. PREPACK struct htt_flow_pool_map_payload_t {
  8850. A_UINT32 flow_type;
  8851. A_UINT32 flow_id;
  8852. A_UINT32 flow_pool_id:16,
  8853. reserved0:16;
  8854. A_UINT32 flow_pool_size:16,
  8855. reserved1:16;
  8856. A_UINT32 reserved2;
  8857. } POSTPACK;
  8858. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  8859. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  8860. (sizeof(struct htt_flow_pool_map_payload_t))
  8861. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  8862. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  8863. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  8864. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  8865. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  8866. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  8867. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  8868. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  8869. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  8870. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  8871. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  8872. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  8873. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  8874. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  8875. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  8876. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  8877. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  8878. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  8879. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  8880. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  8881. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  8882. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  8883. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  8884. do { \
  8885. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  8886. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  8887. } while (0)
  8888. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  8889. do { \
  8890. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  8891. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  8892. } while (0)
  8893. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  8894. do { \
  8895. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  8896. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  8897. } while (0)
  8898. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  8899. do { \
  8900. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  8901. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  8902. } while (0)
  8903. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  8904. do { \
  8905. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  8906. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  8907. } while (0)
  8908. /**
  8909. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP Message
  8910. *
  8911. * @details
  8912. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  8913. * down a flow of descriptors.
  8914. * This message indicates that for the flow (whose ID is provided) is wanting
  8915. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  8916. * pool of descriptors from where descriptors are being allocated for this
  8917. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  8918. * be unmapped by the host.
  8919. *
  8920. * The message would appear as follows:
  8921. *
  8922. * |31 24|23 16|15 8|7 0|
  8923. * |----------------+----------------+----------------+----------------|
  8924. * | reserved0 | msg_type |
  8925. * |-------------------------------------------------------------------|
  8926. * | flow_type |
  8927. * |-------------------------------------------------------------------|
  8928. * | flow_id |
  8929. * |-------------------------------------------------------------------|
  8930. * | reserved1 | flow_pool_id |
  8931. * |-------------------------------------------------------------------|
  8932. *
  8933. * The message is interpreted as follows:
  8934. * dword0 - b'0:7 - msg_type: This will be set to
  8935. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  8936. * b'8:31 - reserved0: Reserved for future use
  8937. *
  8938. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  8939. * this flow is associated. It can be VDEV, peer,
  8940. * or tid (AC). Based on enum htt_flow_type.
  8941. *
  8942. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  8943. * object. For flow_type vdev it is set to the
  8944. * vdevid, for peer it is peerid and for tid, it is
  8945. * tid_num.
  8946. *
  8947. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  8948. * used in the host for this flow
  8949. * b'16:31 - reserved0: This field in reserved for the future.
  8950. *
  8951. */
  8952. PREPACK struct htt_flow_pool_unmap_t {
  8953. A_UINT32 msg_type:8,
  8954. reserved0:24;
  8955. A_UINT32 flow_type;
  8956. A_UINT32 flow_id;
  8957. A_UINT32 flow_pool_id:16,
  8958. reserved1:16;
  8959. } POSTPACK;
  8960. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  8961. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  8962. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  8963. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  8964. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  8965. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  8966. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  8967. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  8968. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  8969. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  8970. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  8971. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  8972. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  8973. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  8974. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  8975. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  8976. do { \
  8977. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  8978. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  8979. } while (0)
  8980. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  8981. do { \
  8982. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  8983. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  8984. } while (0)
  8985. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  8986. do { \
  8987. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  8988. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  8989. } while (0)
  8990. /**
  8991. * @brief HTT_T2H_MSG_TYPE_SRING_SETUP_DONE Message
  8992. *
  8993. * @details
  8994. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  8995. * SRNG ring setup is done
  8996. *
  8997. * This message indicates whether the last setup operation is successful.
  8998. * It will be sent to host when host set respose_required bit in
  8999. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  9000. * The message would appear as follows:
  9001. *
  9002. * |31 24|23 16|15 8|7 0|
  9003. * |--------------- +----------------+----------------+----------------|
  9004. * | setup_status | ring_id | pdev_id | msg_type |
  9005. * |-------------------------------------------------------------------|
  9006. *
  9007. * The message is interpreted as follows:
  9008. * dword0 - b'0:7 - msg_type: This will be set to
  9009. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  9010. * b'8:15 - pdev_id:
  9011. * 0 (for rings at SOC/UMAC level),
  9012. * 1/2/3 mac id (for rings at LMAC level)
  9013. * b'16:23 - ring_id: Identify the ring which is set up
  9014. * More details can be got from enum htt_srng_ring_id
  9015. * b'24:31 - setup_status: Indicate status of setup operation
  9016. * Refer to htt_ring_setup_status
  9017. */
  9018. PREPACK struct htt_sring_setup_done_t {
  9019. A_UINT32 msg_type: 8,
  9020. pdev_id: 8,
  9021. ring_id: 8,
  9022. setup_status: 8;
  9023. } POSTPACK;
  9024. enum htt_ring_setup_status {
  9025. htt_ring_setup_status_ok = 0,
  9026. htt_ring_setup_status_error,
  9027. };
  9028. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  9029. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  9030. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  9031. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  9032. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  9033. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  9034. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  9035. do { \
  9036. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  9037. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  9038. } while (0)
  9039. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  9040. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  9041. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  9042. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  9043. HTT_SRING_SETUP_DONE_RING_ID_S)
  9044. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  9045. do { \
  9046. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  9047. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  9048. } while (0)
  9049. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  9050. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  9051. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  9052. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  9053. HTT_SRING_SETUP_DONE_STATUS_S)
  9054. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  9055. do { \
  9056. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  9057. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  9058. } while (0)
  9059. /**
  9060. * @brief HTT_T2H_MSG_TYPE_MAP_FLOW_INFO Message
  9061. *
  9062. * @details
  9063. * HTT TX map flow entry with tqm flow pointer
  9064. * Sent from firmware to host to add tqm flow pointer in corresponding
  9065. * flow search entry. Flow metadata is replayed back to host as part of this
  9066. * struct to enable host to find the specific flow search entry
  9067. *
  9068. * The message would appear as follows:
  9069. *
  9070. * |31 28|27 18|17 14|13 8|7 0|
  9071. * |-------+------------------------------------------+----------------|
  9072. * | rsvd0 | fse_hsh_idx | msg_type |
  9073. * |-------------------------------------------------------------------|
  9074. * | rsvd1 | tid | peer_id |
  9075. * |-------------------------------------------------------------------|
  9076. * | tqm_flow_pntr_lo |
  9077. * |-------------------------------------------------------------------|
  9078. * | tqm_flow_pntr_hi |
  9079. * |-------------------------------------------------------------------|
  9080. * | fse_meta_data |
  9081. * |-------------------------------------------------------------------|
  9082. *
  9083. * The message is interpreted as follows:
  9084. *
  9085. * dword0 - b'0:7 - msg_type: This will be set to
  9086. * HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  9087. *
  9088. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  9089. * for this flow entry
  9090. *
  9091. * dword0 - b'28:31 - rsvd0: Reserved for future use
  9092. *
  9093. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  9094. *
  9095. * dword1 - b'14:17 - tid
  9096. *
  9097. * dword1 - b'18:31 - rsvd1: Reserved for future use
  9098. *
  9099. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  9100. *
  9101. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  9102. *
  9103. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  9104. * given by host
  9105. */
  9106. PREPACK struct htt_tx_map_flow_info {
  9107. A_UINT32
  9108. msg_type: 8,
  9109. fse_hsh_idx: 20,
  9110. rsvd0: 4;
  9111. A_UINT32
  9112. peer_id: 14,
  9113. tid: 4,
  9114. rsvd1: 14;
  9115. A_UINT32 tqm_flow_pntr_lo;
  9116. A_UINT32 tqm_flow_pntr_hi;
  9117. struct htt_tx_flow_metadata fse_meta_data;
  9118. } POSTPACK;
  9119. /* DWORD 0 */
  9120. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  9121. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  9122. /* DWORD 1 */
  9123. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  9124. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  9125. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  9126. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  9127. /* DWORD 0 */
  9128. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  9129. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  9130. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  9131. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  9132. do { \
  9133. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  9134. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  9135. } while (0)
  9136. /* DWORD 1 */
  9137. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  9138. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  9139. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  9140. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  9141. do { \
  9142. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  9143. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  9144. } while (0)
  9145. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  9146. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  9147. HTT_TX_MAP_FLOW_INFO_TID_S)
  9148. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  9149. do { \
  9150. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  9151. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  9152. } while (0)
  9153. /*
  9154. * htt_dbg_ext_stats_status -
  9155. * present - The requested stats have been delivered in full.
  9156. * This indicates that either the stats information was contained
  9157. * in its entirety within this message, or else this message
  9158. * completes the delivery of the requested stats info that was
  9159. * partially delivered through earlier STATS_CONF messages.
  9160. * partial - The requested stats have been delivered in part.
  9161. * One or more subsequent STATS_CONF messages with the same
  9162. * cookie value will be sent to deliver the remainder of the
  9163. * information.
  9164. * error - The requested stats could not be delivered, for example due
  9165. * to a shortage of memory to construct a message holding the
  9166. * requested stats.
  9167. * invalid - The requested stat type is either not recognized, or the
  9168. * target is configured to not gather the stats type in question.
  9169. */
  9170. enum htt_dbg_ext_stats_status {
  9171. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  9172. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  9173. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  9174. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  9175. };
  9176. /**
  9177. * @brief target -> host ppdu stats upload
  9178. *
  9179. * @details
  9180. * The following field definitions describe the format of the HTT target
  9181. * to host ppdu stats indication message.
  9182. *
  9183. *
  9184. * |31 16|15 12|11 10|9 8|7 0 |
  9185. * |----------------------------------------------------------------------|
  9186. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  9187. * |----------------------------------------------------------------------|
  9188. * | ppdu_id |
  9189. * |----------------------------------------------------------------------|
  9190. * | Timestamp in us |
  9191. * |----------------------------------------------------------------------|
  9192. * | reserved |
  9193. * |----------------------------------------------------------------------|
  9194. * | type-specific stats info |
  9195. * | (see htt_ppdu_stats.h) |
  9196. * |----------------------------------------------------------------------|
  9197. * Header fields:
  9198. * - MSG_TYPE
  9199. * Bits 7:0
  9200. * Purpose: Identifies this is a PPDU STATS indication
  9201. * message.
  9202. * Value: 0x1d
  9203. * - mac_id
  9204. * Bits 9:8
  9205. * Purpose: mac_id of this ppdu_id
  9206. * Value: 0-3
  9207. * - pdev_id
  9208. * Bits 11:10
  9209. * Purpose: pdev_id of this ppdu_id
  9210. * Value: 0-3
  9211. * 0 (for rings at SOC level),
  9212. * 1/2/3 PDEV -> 0/1/2
  9213. * - payload_size
  9214. * Bits 31:16
  9215. * Purpose: total tlv size
  9216. * Value: payload_size in bytes
  9217. */
  9218. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  9219. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  9220. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  9221. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  9222. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  9223. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  9224. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  9225. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  9226. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  9227. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  9228. do { \
  9229. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  9230. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  9231. } while (0)
  9232. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  9233. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  9234. HTT_T2H_PPDU_STATS_MAC_ID_S)
  9235. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  9236. do { \
  9237. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  9238. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  9239. } while (0)
  9240. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  9241. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  9242. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  9243. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  9244. do { \
  9245. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  9246. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  9247. } while (0)
  9248. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  9249. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  9250. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  9251. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  9252. do { \
  9253. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  9254. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  9255. } while (0)
  9256. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  9257. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  9258. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  9259. /**
  9260. * @brief target -> host extended statistics upload
  9261. *
  9262. * @details
  9263. * The following field definitions describe the format of the HTT target
  9264. * to host stats upload confirmation message.
  9265. * The message contains a cookie echoed from the HTT host->target stats
  9266. * upload request, which identifies which request the confirmation is
  9267. * for, and a single stats can span over multiple HTT stats indication
  9268. * due to the HTT message size limitation so every HTT ext stats indication
  9269. * will have tag-length-value stats information elements.
  9270. * The tag-length header for each HTT stats IND message also includes a
  9271. * status field, to indicate whether the request for the stat type in
  9272. * question was fully met, partially met, unable to be met, or invalid
  9273. * (if the stat type in question is disabled in the target).
  9274. * A Done bit 1's indicate the end of the of stats info elements.
  9275. *
  9276. *
  9277. * |31 16|15 12|11|10 8|7 5|4 0|
  9278. * |--------------------------------------------------------------|
  9279. * | reserved | msg type |
  9280. * |--------------------------------------------------------------|
  9281. * | cookie LSBs |
  9282. * |--------------------------------------------------------------|
  9283. * | cookie MSBs |
  9284. * |--------------------------------------------------------------|
  9285. * | stats entry length | rsvd | D| S | stat type |
  9286. * |--------------------------------------------------------------|
  9287. * | type-specific stats info |
  9288. * | (see htt_stats.h) |
  9289. * |--------------------------------------------------------------|
  9290. * Header fields:
  9291. * - MSG_TYPE
  9292. * Bits 7:0
  9293. * Purpose: Identifies this is a extended statistics upload confirmation
  9294. * message.
  9295. * Value: 0x1c
  9296. * - COOKIE_LSBS
  9297. * Bits 31:0
  9298. * Purpose: Provide a mechanism to match a target->host stats confirmation
  9299. * message with its preceding host->target stats request message.
  9300. * Value: LSBs of the opaque cookie specified by the host-side requestor
  9301. * - COOKIE_MSBS
  9302. * Bits 31:0
  9303. * Purpose: Provide a mechanism to match a target->host stats confirmation
  9304. * message with its preceding host->target stats request message.
  9305. * Value: MSBs of the opaque cookie specified by the host-side requestor
  9306. *
  9307. * Stats Information Element tag-length header fields:
  9308. * - STAT_TYPE
  9309. * Bits 7:0
  9310. * Purpose: identifies the type of statistics info held in the
  9311. * following information element
  9312. * Value: htt_dbg_ext_stats_type
  9313. * - STATUS
  9314. * Bits 10:8
  9315. * Purpose: indicate whether the requested stats are present
  9316. * Value: htt_dbg_ext_stats_status
  9317. * - DONE
  9318. * Bits 11
  9319. * Purpose:
  9320. * Indicates the completion of the stats entry, this will be the last
  9321. * stats conf HTT segment for the requested stats type.
  9322. * Value:
  9323. * 0 -> the stats retrieval is ongoing
  9324. * 1 -> the stats retrieval is complete
  9325. * - LENGTH
  9326. * Bits 31:16
  9327. * Purpose: indicate the stats information size
  9328. * Value: This field specifies the number of bytes of stats information
  9329. * that follows the element tag-length header.
  9330. * It is expected but not required that this length is a multiple of
  9331. * 4 bytes.
  9332. */
  9333. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  9334. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  9335. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  9336. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  9337. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  9338. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  9339. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  9340. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  9341. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  9342. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  9343. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  9344. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  9345. do { \
  9346. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  9347. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  9348. } while (0)
  9349. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  9350. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  9351. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  9352. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  9353. do { \
  9354. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  9355. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  9356. } while (0)
  9357. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  9358. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  9359. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  9360. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  9361. do { \
  9362. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  9363. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  9364. } while (0)
  9365. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  9366. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  9367. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  9368. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  9369. do { \
  9370. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  9371. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  9372. } while (0)
  9373. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  9374. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  9375. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  9376. typedef enum {
  9377. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  9378. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  9379. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  9380. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  9381. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  9382. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  9383. /* Reserved from 128 - 255 for target internal use.*/
  9384. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  9385. } HTT_PEER_TYPE;
  9386. /** 2 word representation of MAC addr */
  9387. typedef struct {
  9388. /** upper 4 bytes of MAC address */
  9389. A_UINT32 mac_addr31to0;
  9390. /** lower 2 bytes of MAC address */
  9391. A_UINT32 mac_addr47to32;
  9392. } htt_mac_addr;
  9393. /** macro to convert MAC address from char array to HTT word format */
  9394. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  9395. (phtt_mac_addr)->mac_addr31to0 = \
  9396. (((c_macaddr)[0] << 0) | \
  9397. ((c_macaddr)[1] << 8) | \
  9398. ((c_macaddr)[2] << 16) | \
  9399. ((c_macaddr)[3] << 24)); \
  9400. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  9401. } while (0)
  9402. /**
  9403. * @brief target -> host monitor mac header indication message
  9404. *
  9405. * @details
  9406. * The following diagram shows the format of the monitor mac header message
  9407. * sent from the target to the host.
  9408. * This message is primarily sent when promiscuous rx mode is enabled.
  9409. * One message is sent per rx PPDU.
  9410. *
  9411. * |31 24|23 16|15 8|7 0|
  9412. * |-------------------------------------------------------------|
  9413. * | peer_id | reserved0 | msg_type |
  9414. * |-------------------------------------------------------------|
  9415. * | reserved1 | num_mpdu |
  9416. * |-------------------------------------------------------------|
  9417. * | struct hw_rx_desc |
  9418. * | (see wal_rx_desc.h) |
  9419. * |-------------------------------------------------------------|
  9420. * | struct ieee80211_frame_addr4 |
  9421. * | (see ieee80211_defs.h) |
  9422. * |-------------------------------------------------------------|
  9423. * | struct ieee80211_frame_addr4 |
  9424. * | (see ieee80211_defs.h) |
  9425. * |-------------------------------------------------------------|
  9426. * | ...... |
  9427. * |-------------------------------------------------------------|
  9428. *
  9429. * Header fields:
  9430. * - msg_type
  9431. * Bits 7:0
  9432. * Purpose: Identifies this is a monitor mac header indication message.
  9433. * Value: 0x20
  9434. * - peer_id
  9435. * Bits 31:16
  9436. * Purpose: Software peer id given by host during association,
  9437. * During promiscuous mode, the peer ID will be invalid (0xFF)
  9438. * for rx PPDUs received from unassociated peers.
  9439. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  9440. * - num_mpdu
  9441. * Bits 15:0
  9442. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  9443. * delivered within the message.
  9444. * Value: 1 to 32
  9445. * num_mpdu is limited to a maximum value of 32, due to buffer
  9446. * size limits. For PPDUs with more than 32 MPDUs, only the
  9447. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  9448. * the PPDU will be provided.
  9449. */
  9450. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  9451. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  9452. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  9453. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  9454. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  9455. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  9456. do { \
  9457. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  9458. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  9459. } while (0)
  9460. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  9461. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  9462. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  9463. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  9464. do { \
  9465. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  9466. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  9467. } while (0)
  9468. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  9469. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  9470. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  9471. /**
  9472. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE Message
  9473. *
  9474. * @details
  9475. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  9476. * the flow pool associated with the specified ID is resized
  9477. *
  9478. * The message would appear as follows:
  9479. *
  9480. * |31 24|23 16|15 8|7 0|
  9481. * |----------------+----------------+----------------+----------------|
  9482. * | flow Pool ID | reserved0 | Msg type |
  9483. * |-------------------------------------------------------------------|
  9484. * | reserved1 | flow pool new size |
  9485. * |-------------------------------------------------------------------|
  9486. *
  9487. * The message is interpreted as follows:
  9488. * b'0:7 - msg_type: This will be set to
  9489. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  9490. *
  9491. * b'8:15 - flow pool ID: Existing flow pool ID
  9492. *
  9493. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  9494. *
  9495. */
  9496. PREPACK struct htt_flow_pool_resize_t {
  9497. A_UINT32 msg_type:8,
  9498. reserved0:8,
  9499. flow_pool_id:16;
  9500. A_UINT32 flow_pool_new_size:16,
  9501. reserved1:16;
  9502. } POSTPACK;
  9503. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  9504. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0xffff0000
  9505. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 16
  9506. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0x0000ffff
  9507. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 0
  9508. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  9509. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  9510. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  9511. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  9512. do { \
  9513. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  9514. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  9515. } while (0)
  9516. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  9517. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  9518. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  9519. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  9520. do { \
  9521. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  9522. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  9523. } while (0)
  9524. #endif