htt.h 471 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411
  1. /*
  2. * Copyright (c) 2011-2017 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. */
  161. #define HTT_CURRENT_VERSION_MAJOR 3
  162. #define HTT_CURRENT_VERSION_MINOR 49
  163. #define HTT_NUM_TX_FRAG_DESC 1024
  164. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  165. #define HTT_CHECK_SET_VAL(field, val) \
  166. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  167. /* macros to assist in sign-extending fields from HTT messages */
  168. #define HTT_SIGN_BIT_MASK(field) \
  169. ((field ## _M + (1 << field ## _S)) >> 1)
  170. #define HTT_SIGN_BIT(_val, field) \
  171. (_val & HTT_SIGN_BIT_MASK(field))
  172. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  173. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  174. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  175. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  176. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  177. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  178. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  179. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  180. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  181. /*
  182. * TEMPORARY:
  183. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  184. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  185. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  186. * updated.
  187. */
  188. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  189. /*
  190. * TEMPORARY:
  191. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  192. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  193. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  194. * updated.
  195. */
  196. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  197. /* HTT Access Category values */
  198. enum HTT_AC_WMM {
  199. /* WMM Access Categories */
  200. HTT_AC_WMM_BE = 0x0,
  201. HTT_AC_WMM_BK = 0x1,
  202. HTT_AC_WMM_VI = 0x2,
  203. HTT_AC_WMM_VO = 0x3,
  204. /* extension Access Categories */
  205. HTT_AC_EXT_NON_QOS = 0x4,
  206. HTT_AC_EXT_UCAST_MGMT = 0x5,
  207. HTT_AC_EXT_MCAST_DATA = 0x6,
  208. HTT_AC_EXT_MCAST_MGMT = 0x7,
  209. };
  210. enum HTT_AC_WMM_MASK {
  211. /* WMM Access Categories */
  212. HTT_AC_WMM_BE_MASK = (1 << HTT_AC_WMM_BE),
  213. HTT_AC_WMM_BK_MASK = (1 << HTT_AC_WMM_BK),
  214. HTT_AC_WMM_VI_MASK = (1 << HTT_AC_WMM_VI),
  215. HTT_AC_WMM_VO_MASK = (1 << HTT_AC_WMM_VO),
  216. /* extension Access Categories */
  217. HTT_AC_EXT_NON_QOS_MASK = (1 << HTT_AC_EXT_NON_QOS),
  218. HTT_AC_EXT_UCAST_MGMT_MASK = (1 << HTT_AC_EXT_UCAST_MGMT),
  219. HTT_AC_EXT_MCAST_DATA_MASK = (1 << HTT_AC_EXT_MCAST_DATA),
  220. HTT_AC_EXT_MCAST_MGMT_MASK = (1 << HTT_AC_EXT_MCAST_MGMT),
  221. };
  222. #define HTT_AC_MASK_WMM \
  223. (HTT_AC_WMM_BE_MASK | HTT_AC_WMM_BK_MASK | \
  224. HTT_AC_WMM_VI_MASK | HTT_AC_WMM_VO_MASK)
  225. #define HTT_AC_MASK_EXT \
  226. (HTT_AC_EXT_NON_QOS_MASK | HTT_AC_EXT_UCAST_MGMT_MASK | \
  227. HTT_AC_EXT_MCAST_DATA_MASK | HTT_AC_EXT_MCAST_MGMT_MASK)
  228. #define HTT_AC_MASK_ALL (HTT_AC_MASK_WMM | HTT_AC_MASK_EXT)
  229. /*
  230. * htt_dbg_stats_type -
  231. * bit positions for each stats type within a stats type bitmask
  232. * The bitmask contains 24 bits.
  233. */
  234. enum htt_dbg_stats_type {
  235. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  236. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  237. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  238. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  239. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  240. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  241. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  242. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  243. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  244. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  245. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  246. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  247. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  248. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  249. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  250. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  251. /* bits 16-23 currently reserved */
  252. /* keep this last */
  253. HTT_DBG_NUM_STATS
  254. };
  255. /*=== HTT option selection TLVs ===
  256. * Certain HTT messages have alternatives or options.
  257. * For such cases, the host and target need to agree on which option to use.
  258. * Option specification TLVs can be appended to the VERSION_REQ and
  259. * VERSION_CONF messages to select options other than the default.
  260. * These TLVs are entirely optional - if they are not provided, there is a
  261. * well-defined default for each option. If they are provided, they can be
  262. * provided in any order. Each TLV can be present or absent independent of
  263. * the presence / absence of other TLVs.
  264. *
  265. * The HTT option selection TLVs use the following format:
  266. * |31 16|15 8|7 0|
  267. * |---------------------------------+----------------+----------------|
  268. * | value (payload) | length | tag |
  269. * |-------------------------------------------------------------------|
  270. * The value portion need not be only 2 bytes; it can be extended by any
  271. * integer number of 4-byte units. The total length of the TLV, including
  272. * the tag and length fields, must be a multiple of 4 bytes. The length
  273. * field specifies the total TLV size in 4-byte units. Thus, the typical
  274. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  275. * field, would store 0x1 in its length field, to show that the TLV occupies
  276. * a single 4-byte unit.
  277. */
  278. /*--- TLV header format - applies to all HTT option TLVs ---*/
  279. enum HTT_OPTION_TLV_TAGS {
  280. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  281. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  282. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  283. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  284. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  285. };
  286. PREPACK struct htt_option_tlv_header_t {
  287. A_UINT8 tag;
  288. A_UINT8 length;
  289. } POSTPACK;
  290. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  291. #define HTT_OPTION_TLV_TAG_S 0
  292. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  293. #define HTT_OPTION_TLV_LENGTH_S 8
  294. /*
  295. * value0 - 16 bit value field stored in word0
  296. * The TLV's value field may be longer than 2 bytes, in which case
  297. * the remainder of the value is stored in word1, word2, etc.
  298. */
  299. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  300. #define HTT_OPTION_TLV_VALUE0_S 16
  301. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  302. do { \
  303. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  304. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  305. } while (0)
  306. #define HTT_OPTION_TLV_TAG_GET(word) \
  307. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  308. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  309. do { \
  310. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  311. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  312. } while (0)
  313. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  314. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  315. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  316. do { \
  317. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  318. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  319. } while (0)
  320. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  321. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  322. /*--- format of specific HTT option TLVs ---*/
  323. /*
  324. * HTT option TLV for specifying LL bus address size
  325. * Some chips require bus addresses used by the target to access buffers
  326. * within the host's memory to be 32 bits; others require bus addresses
  327. * used by the target to access buffers within the host's memory to be
  328. * 64 bits.
  329. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  330. * a suffix to the VERSION_CONF message to specify which bus address format
  331. * the target requires.
  332. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  333. * default to providing bus addresses to the target in 32-bit format.
  334. */
  335. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  336. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  337. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  338. };
  339. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  340. struct htt_option_tlv_header_t hdr;
  341. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  342. } POSTPACK;
  343. /*
  344. * HTT option TLV for specifying whether HL systems should indicate
  345. * over-the-air tx completion for individual frames, or should instead
  346. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  347. * requests an OTA tx completion for a particular tx frame.
  348. * This option does not apply to LL systems, where the TX_COMPL_IND
  349. * is mandatory.
  350. * This option is primarily intended for HL systems in which the tx frame
  351. * downloads over the host --> target bus are as slow as or slower than
  352. * the transmissions over the WLAN PHY. For cases where the bus is faster
  353. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  354. * and consquently will send one TX_COMPL_IND message that covers several
  355. * tx frames. For cases where the WLAN PHY is faster than the bus,
  356. * the target will end up transmitting very short A-MPDUs, and consequently
  357. * sending many TX_COMPL_IND messages, which each cover a very small number
  358. * of tx frames.
  359. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  360. * a suffix to the VERSION_REQ message to request whether the host desires to
  361. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  362. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  363. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  364. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  365. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  366. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  367. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  368. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  369. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  370. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  371. * TLV.
  372. */
  373. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  374. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  375. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  376. };
  377. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  378. struct htt_option_tlv_header_t hdr;
  379. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  380. } POSTPACK;
  381. /*
  382. * HTT option TLV for specifying how many tx queue groups the target
  383. * may establish.
  384. * This TLV specifies the maximum value the target may send in the
  385. * txq_group_id field of any TXQ_GROUP information elements sent by
  386. * the target to the host. This allows the host to pre-allocate an
  387. * appropriate number of tx queue group structs.
  388. *
  389. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  390. * a suffix to the VERSION_REQ message to specify whether the host supports
  391. * tx queue groups at all, and if so if there is any limit on the number of
  392. * tx queue groups that the host supports.
  393. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  394. * a suffix to the VERSION_CONF message. If the host has specified in the
  395. * VER_REQ message a limit on the number of tx queue groups the host can
  396. * supprt, the target shall limit its specification of the maximum tx groups
  397. * to be no larger than this host-specified limit.
  398. *
  399. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  400. * shall preallocate 4 tx queue group structs, and the target shall not
  401. * specify a txq_group_id larger than 3.
  402. */
  403. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  404. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  405. /*
  406. * values 1 through N specify the max number of tx queue groups
  407. * the sender supports
  408. */
  409. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  410. };
  411. /* TEMPORARY backwards-compatibility alias for a typo fix -
  412. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  413. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  414. * to support the old name (with the typo) until all references to the
  415. * old name are replaced with the new name.
  416. */
  417. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  418. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  419. struct htt_option_tlv_header_t hdr;
  420. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  421. } POSTPACK;
  422. /*
  423. * HTT option TLV for specifying whether the target supports an extended
  424. * version of the HTT tx descriptor. If the target provides this TLV
  425. * and specifies in the TLV that the target supports an extended version
  426. * of the HTT tx descriptor, the target must check the "extension" bit in
  427. * the HTT tx descriptor, and if the extension bit is set, to expect a
  428. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  429. * descriptor. Furthermore, the target must provide room for the HTT
  430. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  431. * This option is intended for systems where the host needs to explicitly
  432. * control the transmission parameters such as tx power for individual
  433. * tx frames.
  434. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  435. * as a suffix to the VERSION_CONF message to explicitly specify whether
  436. * the target supports the HTT tx MSDU extension descriptor.
  437. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  438. * by the host as lack of target support for the HTT tx MSDU extension
  439. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  440. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  441. * the HTT tx MSDU extension descriptor.
  442. * The host is not required to provide the HTT tx MSDU extension descriptor
  443. * just because the target supports it; the target must check the
  444. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  445. * extension descriptor is present.
  446. */
  447. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  448. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  449. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  450. };
  451. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  452. struct htt_option_tlv_header_t hdr;
  453. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  454. } POSTPACK;
  455. /*=== host -> target messages ===============================================*/
  456. enum htt_h2t_msg_type {
  457. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  458. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  459. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  460. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  461. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  462. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  463. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  464. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  465. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  466. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  467. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  468. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  469. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  470. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  471. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  472. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  473. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  474. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  475. /* keep this last */
  476. HTT_H2T_NUM_MSGS
  477. };
  478. /*
  479. * HTT host to target message type -
  480. * stored in bits 7:0 of the first word of the message
  481. */
  482. #define HTT_H2T_MSG_TYPE_M 0xff
  483. #define HTT_H2T_MSG_TYPE_S 0
  484. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  485. do { \
  486. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  487. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  488. } while (0)
  489. #define HTT_H2T_MSG_TYPE_GET(word) \
  490. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  491. /**
  492. * @brief host -> target version number request message definition
  493. *
  494. * |31 24|23 16|15 8|7 0|
  495. * |----------------+----------------+----------------+----------------|
  496. * | reserved | msg type |
  497. * |-------------------------------------------------------------------|
  498. * : option request TLV (optional) |
  499. * :...................................................................:
  500. *
  501. * The VER_REQ message may consist of a single 4-byte word, or may be
  502. * extended with TLVs that specify which HTT options the host is requesting
  503. * from the target.
  504. * The following option TLVs may be appended to the VER_REQ message:
  505. * - HL_SUPPRESS_TX_COMPL_IND
  506. * - HL_MAX_TX_QUEUE_GROUPS
  507. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  508. * may be appended to the VER_REQ message (but only one TLV of each type).
  509. *
  510. * Header fields:
  511. * - MSG_TYPE
  512. * Bits 7:0
  513. * Purpose: identifies this as a version number request message
  514. * Value: 0x0
  515. */
  516. #define HTT_VER_REQ_BYTES 4
  517. /* TBDXXX: figure out a reasonable number */
  518. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  519. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  520. /**
  521. * @brief HTT tx MSDU descriptor
  522. *
  523. * @details
  524. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  525. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  526. * the target firmware needs for the FW's tx processing, particularly
  527. * for creating the HW msdu descriptor.
  528. * The same HTT tx descriptor is used for HL and LL systems, though
  529. * a few fields within the tx descriptor are used only by LL or
  530. * only by HL.
  531. * The HTT tx descriptor is defined in two manners: by a struct with
  532. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  533. * definitions.
  534. * The target should use the struct def, for simplicitly and clarity,
  535. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  536. * neutral. Specifically, the host shall use the get/set macros built
  537. * around the mask + shift defs.
  538. */
  539. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  540. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  541. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  542. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  543. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  544. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  545. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  546. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  547. #define HTT_TX_VDEV_ID_WORD 0
  548. #define HTT_TX_VDEV_ID_MASK 0x3f
  549. #define HTT_TX_VDEV_ID_SHIFT 16
  550. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  551. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  552. #define HTT_TX_MSDU_LEN_DWORD 1
  553. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  554. /*
  555. * HTT_VAR_PADDR macros
  556. * Allow physical / bus addresses to be either a single 32-bit value,
  557. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  558. */
  559. #define HTT_VAR_PADDR32(var_name) \
  560. A_UINT32 var_name
  561. #define HTT_VAR_PADDR64_LE(var_name) \
  562. struct { \
  563. /* little-endian: lo precedes hi */ \
  564. A_UINT32 lo; \
  565. A_UINT32 hi; \
  566. } var_name
  567. /*
  568. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  569. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  570. * addresses are stored in a XXX-bit field.
  571. * This macro is used to define both htt_tx_msdu_desc32_t and
  572. * htt_tx_msdu_desc64_t structs.
  573. */
  574. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  575. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  576. { \
  577. /* DWORD 0: flags and meta-data */ \
  578. A_UINT32 \
  579. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  580. \
  581. /* pkt_subtype - \
  582. * Detailed specification of the tx frame contents, extending the \
  583. * general specification provided by pkt_type. \
  584. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  585. * pkt_type | pkt_subtype \
  586. * ============================================================== \
  587. * 802.3 | bit 0:3 - Reserved \
  588. * | bit 4: 0x0 - Copy-Engine Classification Results \
  589. * | not appended to the HTT message \
  590. * | 0x1 - Copy-Engine Classification Results \
  591. * | appended to the HTT message in the \
  592. * | format: \
  593. * | [HTT tx desc, frame header, \
  594. * | CE classification results] \
  595. * | The CE classification results begin \
  596. * | at the next 4-byte boundary after \
  597. * | the frame header. \
  598. * ------------+------------------------------------------------- \
  599. * Eth2 | bit 0:3 - Reserved \
  600. * | bit 4: 0x0 - Copy-Engine Classification Results \
  601. * | not appended to the HTT message \
  602. * | 0x1 - Copy-Engine Classification Results \
  603. * | appended to the HTT message. \
  604. * | See the above specification of the \
  605. * | CE classification results location. \
  606. * ------------+------------------------------------------------- \
  607. * native WiFi | bit 0:3 - Reserved \
  608. * | bit 4: 0x0 - Copy-Engine Classification Results \
  609. * | not appended to the HTT message \
  610. * | 0x1 - Copy-Engine Classification Results \
  611. * | appended to the HTT message. \
  612. * | See the above specification of the \
  613. * | CE classification results location. \
  614. * ------------+------------------------------------------------- \
  615. * mgmt | 0x0 - 802.11 MAC header absent \
  616. * | 0x1 - 802.11 MAC header present \
  617. * ------------+------------------------------------------------- \
  618. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  619. * | 0x1 - 802.11 MAC header present \
  620. * | bit 1: 0x0 - allow aggregation \
  621. * | 0x1 - don't allow aggregation \
  622. * | bit 2: 0x0 - perform encryption \
  623. * | 0x1 - don't perform encryption \
  624. * | bit 3: 0x0 - perform tx classification / queuing \
  625. * | 0x1 - don't perform tx classification; \
  626. * | insert the frame into the "misc" \
  627. * | tx queue \
  628. * | bit 4: 0x0 - Copy-Engine Classification Results \
  629. * | not appended to the HTT message \
  630. * | 0x1 - Copy-Engine Classification Results \
  631. * | appended to the HTT message. \
  632. * | See the above specification of the \
  633. * | CE classification results location. \
  634. */ \
  635. pkt_subtype: 5, \
  636. \
  637. /* pkt_type - \
  638. * General specification of the tx frame contents. \
  639. * The htt_pkt_type enum should be used to specify and check the \
  640. * value of this field. \
  641. */ \
  642. pkt_type: 3, \
  643. \
  644. /* vdev_id - \
  645. * ID for the vdev that is sending this tx frame. \
  646. * For certain non-standard packet types, e.g. pkt_type == raw \
  647. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  648. * This field is used primarily for determining where to queue \
  649. * broadcast and multicast frames. \
  650. */ \
  651. vdev_id: 6, \
  652. /* ext_tid - \
  653. * The extended traffic ID. \
  654. * If the TID is unknown, the extended TID is set to \
  655. * HTT_TX_EXT_TID_INVALID. \
  656. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  657. * value of the QoS TID. \
  658. * If the tx frame is non-QoS data, then the extended TID is set to \
  659. * HTT_TX_EXT_TID_NON_QOS. \
  660. * If the tx frame is multicast or broadcast, then the extended TID \
  661. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  662. */ \
  663. ext_tid: 5, \
  664. \
  665. /* postponed - \
  666. * This flag indicates whether the tx frame has been downloaded to \
  667. * the target before but discarded by the target, and now is being \
  668. * downloaded again; or if this is a new frame that is being \
  669. * downloaded for the first time. \
  670. * This flag allows the target to determine the correct order for \
  671. * transmitting new vs. old frames. \
  672. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  673. * This flag only applies to HL systems, since in LL systems, \
  674. * the tx flow control is handled entirely within the target. \
  675. */ \
  676. postponed: 1, \
  677. \
  678. /* extension - \
  679. * This flag indicates whether a HTT tx MSDU extension descriptor \
  680. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  681. * \
  682. * 0x0 - no extension MSDU descriptor is present \
  683. * 0x1 - an extension MSDU descriptor immediately follows the \
  684. * regular MSDU descriptor \
  685. */ \
  686. extension: 1, \
  687. \
  688. /* cksum_offload - \
  689. * This flag indicates whether checksum offload is enabled or not \
  690. * for this frame. Target FW use this flag to turn on HW checksumming \
  691. * 0x0 - No checksum offload \
  692. * 0x1 - L3 header checksum only \
  693. * 0x2 - L4 checksum only \
  694. * 0x3 - L3 header checksum + L4 checksum \
  695. */ \
  696. cksum_offload: 2, \
  697. \
  698. /* tx_comp_req - \
  699. * This flag indicates whether Tx Completion \
  700. * from fw is required or not. \
  701. * This flag is only relevant if tx completion is not \
  702. * universally enabled. \
  703. * For all LL systems, tx completion is mandatory, \
  704. * so this flag will be irrelevant. \
  705. * For HL systems tx completion is optional, but HL systems in which \
  706. * the bus throughput exceeds the WLAN throughput will \
  707. * probably want to always use tx completion, and thus \
  708. * would not check this flag. \
  709. * This flag is required when tx completions are not used universally, \
  710. * but are still required for certain tx frames for which \
  711. * an OTA delivery acknowledgment is needed by the host. \
  712. * In practice, this would be for HL systems in which the \
  713. * bus throughput is less than the WLAN throughput. \
  714. * \
  715. * 0x0 - Tx Completion Indication from Fw not required \
  716. * 0x1 - Tx Completion Indication from Fw is required \
  717. */ \
  718. tx_compl_req: 1; \
  719. \
  720. \
  721. /* DWORD 1: MSDU length and ID */ \
  722. A_UINT32 \
  723. len: 16, /* MSDU length, in bytes */ \
  724. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  725. * and this id is used to calculate fragmentation \
  726. * descriptor pointer inside the target based on \
  727. * the base address, configured inside the target. \
  728. */ \
  729. \
  730. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  731. /* frags_desc_ptr - \
  732. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  733. * where the tx frame's fragments reside in memory. \
  734. * This field only applies to LL systems, since in HL systems the \
  735. * (degenerate single-fragment) fragmentation descriptor is created \
  736. * within the target. \
  737. */ \
  738. _paddr__frags_desc_ptr_; \
  739. \
  740. /* DWORD 3 (or 4): peerid, chanfreq */ \
  741. /* \
  742. * Peer ID : Target can use this value to know which peer-id packet \
  743. * destined to. \
  744. * It's intended to be specified by host in case of NAWDS. \
  745. */ \
  746. A_UINT16 peerid; \
  747. \
  748. /* \
  749. * Channel frequency: This identifies the desired channel \
  750. * frequency (in mhz) for tx frames. This is used by FW to help \
  751. * determine when it is safe to transmit or drop frames for \
  752. * off-channel operation. \
  753. * The default value of zero indicates to FW that the corresponding \
  754. * VDEV's home channel (if there is one) is the desired channel \
  755. * frequency. \
  756. */ \
  757. A_UINT16 chanfreq; \
  758. \
  759. /* Reason reserved is commented is increasing the htt structure size \
  760. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  761. * A_UINT32 reserved_dword3_bits0_31; \
  762. */ \
  763. } POSTPACK
  764. /* define a htt_tx_msdu_desc32_t type */
  765. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  766. /* define a htt_tx_msdu_desc64_t type */
  767. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  768. /*
  769. * Make htt_tx_msdu_desc_t be an alias for either
  770. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  771. */
  772. #if HTT_PADDR64
  773. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  774. #else
  775. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  776. #endif
  777. /* decriptor information for Management frame*/
  778. /*
  779. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  780. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  781. */
  782. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  783. extern A_UINT32 mgmt_hdr_len;
  784. PREPACK struct htt_mgmt_tx_desc_t {
  785. A_UINT32 msg_type;
  786. #if HTT_PADDR64
  787. A_UINT64 frag_paddr; /* DMAble address of the data */
  788. #else
  789. A_UINT32 frag_paddr; /* DMAble address of the data */
  790. #endif
  791. A_UINT32 desc_id; /* returned to host during completion
  792. * to free the meory*/
  793. A_UINT32 len; /* Fragment length */
  794. A_UINT32 vdev_id; /* virtual device ID*/
  795. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  796. } POSTPACK;
  797. PREPACK struct htt_mgmt_tx_compl_ind {
  798. A_UINT32 desc_id;
  799. A_UINT32 status;
  800. } POSTPACK;
  801. /*
  802. * This SDU header size comes from the summation of the following:
  803. * 1. Max of:
  804. * a. Native WiFi header, for native WiFi frames: 24 bytes
  805. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  806. * b. 802.11 header, for raw frames: 36 bytes
  807. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  808. * QoS header, HT header)
  809. * c. 802.3 header, for ethernet frames: 14 bytes
  810. * (destination address, source address, ethertype / length)
  811. * 2. Max of:
  812. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  813. * b. IPv6 header, up through the Traffic Class: 2 bytes
  814. * 3. 802.1Q VLAN header: 4 bytes
  815. * 4. LLC/SNAP header: 8 bytes
  816. */
  817. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  818. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  819. #define HTT_TX_HDR_SIZE_ETHERNET 14
  820. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  821. A_COMPILE_TIME_ASSERT(
  822. htt_encap_hdr_size_max_check_nwifi,
  823. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  824. A_COMPILE_TIME_ASSERT(
  825. htt_encap_hdr_size_max_check_enet,
  826. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  827. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  828. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  829. #define HTT_TX_HDR_SIZE_802_1Q 4
  830. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  831. #define HTT_COMMON_TX_FRM_HDR_LEN \
  832. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  833. HTT_TX_HDR_SIZE_802_1Q + \
  834. HTT_TX_HDR_SIZE_LLC_SNAP)
  835. #define HTT_HL_TX_FRM_HDR_LEN \
  836. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  837. #define HTT_LL_TX_FRM_HDR_LEN \
  838. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  839. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  840. /* dword 0 */
  841. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  842. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  843. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  844. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  845. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  846. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  847. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  848. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  849. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  850. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  851. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  852. #define HTT_TX_DESC_PKT_TYPE_S 13
  853. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  854. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  855. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  856. #define HTT_TX_DESC_VDEV_ID_S 16
  857. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  858. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  859. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  860. #define HTT_TX_DESC_EXT_TID_S 22
  861. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  862. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  863. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  864. #define HTT_TX_DESC_POSTPONED_S 27
  865. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  866. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  867. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  868. #define HTT_TX_DESC_EXTENSION_S 28
  869. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  870. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  871. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  872. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  873. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  874. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  875. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  876. #define HTT_TX_DESC_TX_COMP_S 31
  877. /* dword 1 */
  878. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  879. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  880. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  881. #define HTT_TX_DESC_FRM_LEN_S 0
  882. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  883. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  884. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  885. #define HTT_TX_DESC_FRM_ID_S 16
  886. /* dword 2 */
  887. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  888. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  889. /* for systems using 64-bit format for bus addresses */
  890. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  891. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  892. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  893. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  894. /* for systems using 32-bit format for bus addresses */
  895. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  896. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  897. /* dword 3 */
  898. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  899. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  900. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  901. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  902. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  903. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  904. #if HTT_PADDR64
  905. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  906. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  907. #else
  908. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  909. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  910. #endif
  911. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  912. #define HTT_TX_DESC_PEER_ID_S 0
  913. /*
  914. * TEMPORARY:
  915. * The original definitions for the PEER_ID fields contained typos
  916. * (with _DESC_PADDR appended to this PEER_ID field name).
  917. * Retain deprecated original names for PEER_ID fields until all code that
  918. * refers to them has been updated.
  919. */
  920. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  921. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  922. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  923. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  924. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  925. HTT_TX_DESC_PEER_ID_M
  926. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  927. HTT_TX_DESC_PEER_ID_S
  928. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  929. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  930. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  931. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  932. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  933. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  934. #if HTT_PADDR64
  935. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  936. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  937. #else
  938. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  939. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  940. #endif
  941. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  942. #define HTT_TX_DESC_CHAN_FREQ_S 16
  943. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  944. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  945. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  946. do { \
  947. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  948. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  949. } while (0)
  950. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  951. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  952. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  953. do { \
  954. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  955. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  956. } while (0)
  957. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  958. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  959. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  960. do { \
  961. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  962. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  963. } while (0)
  964. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  965. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  966. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  967. do { \
  968. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  969. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  970. } while (0)
  971. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  972. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  973. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  974. do { \
  975. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  976. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  977. } while (0)
  978. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  979. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  980. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  981. do { \
  982. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  983. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  984. } while (0)
  985. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  986. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  987. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  988. do { \
  989. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  990. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  991. } while (0)
  992. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  993. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  994. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  995. do { \
  996. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  997. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  998. } while (0)
  999. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1000. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1001. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1002. do { \
  1003. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1004. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1005. } while (0)
  1006. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1007. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1008. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1009. do { \
  1010. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1011. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1012. } while (0)
  1013. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1014. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1015. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1016. do { \
  1017. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1018. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1019. } while (0)
  1020. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1021. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1022. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1023. do { \
  1024. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1025. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1026. } while (0)
  1027. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1028. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1029. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1030. do { \
  1031. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1032. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1033. } while (0)
  1034. /* enums used in the HTT tx MSDU extension descriptor */
  1035. enum {
  1036. htt_tx_guard_interval_regular = 0,
  1037. htt_tx_guard_interval_short = 1,
  1038. };
  1039. enum {
  1040. htt_tx_preamble_type_ofdm = 0,
  1041. htt_tx_preamble_type_cck = 1,
  1042. htt_tx_preamble_type_ht = 2,
  1043. htt_tx_preamble_type_vht = 3,
  1044. };
  1045. enum {
  1046. htt_tx_bandwidth_5MHz = 0,
  1047. htt_tx_bandwidth_10MHz = 1,
  1048. htt_tx_bandwidth_20MHz = 2,
  1049. htt_tx_bandwidth_40MHz = 3,
  1050. htt_tx_bandwidth_80MHz = 4,
  1051. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1052. };
  1053. /**
  1054. * @brief HTT tx MSDU extension descriptor
  1055. * @details
  1056. * If the target supports HTT tx MSDU extension descriptors, the host has
  1057. * the option of appending the following struct following the regular
  1058. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1059. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1060. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1061. * tx specs for each frame.
  1062. */
  1063. PREPACK struct htt_tx_msdu_desc_ext_t {
  1064. /* DWORD 0: flags */
  1065. A_UINT32
  1066. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1067. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1068. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1069. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1070. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1071. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1072. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1073. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1074. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1075. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1076. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1077. /* DWORD 1: tx power, tx rate, tx BW */
  1078. A_UINT32
  1079. /* pwr -
  1080. * Specify what power the tx frame needs to be transmitted at.
  1081. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1082. * The value needs to be appropriately sign-extended when extracting
  1083. * the value from the message and storing it in a variable that is
  1084. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1085. * automatically handles this sign-extension.)
  1086. * If the transmission uses multiple tx chains, this power spec is
  1087. * the total transmit power, assuming incoherent combination of
  1088. * per-chain power to produce the total power.
  1089. */
  1090. pwr: 8,
  1091. /* mcs_mask -
  1092. * Specify the allowable values for MCS index (modulation and coding)
  1093. * to use for transmitting the frame.
  1094. *
  1095. * For HT / VHT preamble types, this mask directly corresponds to
  1096. * the HT or VHT MCS indices that are allowed. For each bit N set
  1097. * within the mask, MCS index N is allowed for transmitting the frame.
  1098. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1099. * rates versus OFDM rates, so the host has the option of specifying
  1100. * that the target must transmit the frame with CCK or OFDM rates
  1101. * (not HT or VHT), but leaving the decision to the target whether
  1102. * to use CCK or OFDM.
  1103. *
  1104. * For CCK and OFDM, the bits within this mask are interpreted as
  1105. * follows:
  1106. * bit 0 -> CCK 1 Mbps rate is allowed
  1107. * bit 1 -> CCK 2 Mbps rate is allowed
  1108. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1109. * bit 3 -> CCK 11 Mbps rate is allowed
  1110. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1111. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1112. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1113. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1114. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1115. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1116. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1117. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1118. *
  1119. * The MCS index specification needs to be compatible with the
  1120. * bandwidth mask specification. For example, a MCS index == 9
  1121. * specification is inconsistent with a preamble type == VHT,
  1122. * Nss == 1, and channel bandwidth == 20 MHz.
  1123. *
  1124. * Furthermore, the host has only a limited ability to specify to
  1125. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1126. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1127. */
  1128. mcs_mask: 12,
  1129. /* nss_mask -
  1130. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1131. * Each bit in this mask corresponds to a Nss value:
  1132. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1133. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1134. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1135. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1136. * The values in the Nss mask must be suitable for the recipient, e.g.
  1137. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1138. * recipient which only supports 2x2 MIMO.
  1139. */
  1140. nss_mask: 4,
  1141. /* guard_interval -
  1142. * Specify a htt_tx_guard_interval enum value to indicate whether
  1143. * the transmission should use a regular guard interval or a
  1144. * short guard interval.
  1145. */
  1146. guard_interval: 1,
  1147. /* preamble_type_mask -
  1148. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1149. * may choose from for transmitting this frame.
  1150. * The bits in this mask correspond to the values in the
  1151. * htt_tx_preamble_type enum. For example, to allow the target
  1152. * to transmit the frame as either CCK or OFDM, this field would
  1153. * be set to
  1154. * (1 << htt_tx_preamble_type_ofdm) |
  1155. * (1 << htt_tx_preamble_type_cck)
  1156. */
  1157. preamble_type_mask: 4,
  1158. reserved1_31_29: 3; /* unused, set to 0x0 */
  1159. /* DWORD 2: tx chain mask, tx retries */
  1160. A_UINT32
  1161. /* chain_mask - specify which chains to transmit from */
  1162. chain_mask: 4,
  1163. /* retry_limit -
  1164. * Specify the maximum number of transmissions, including the
  1165. * initial transmission, to attempt before giving up if no ack
  1166. * is received.
  1167. * If the tx rate is specified, then all retries shall use the
  1168. * same rate as the initial transmission.
  1169. * If no tx rate is specified, the target can choose whether to
  1170. * retain the original rate during the retransmissions, or to
  1171. * fall back to a more robust rate.
  1172. */
  1173. retry_limit: 4,
  1174. /* bandwidth_mask -
  1175. * Specify what channel widths may be used for the transmission.
  1176. * A value of zero indicates "don't care" - the target may choose
  1177. * the transmission bandwidth.
  1178. * The bits within this mask correspond to the htt_tx_bandwidth
  1179. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1180. * The bandwidth_mask must be consistent with the preamble_type_mask
  1181. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1182. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1183. */
  1184. bandwidth_mask: 6,
  1185. reserved2_31_14: 18; /* unused, set to 0x0 */
  1186. /* DWORD 3: tx expiry time (TSF) LSBs */
  1187. A_UINT32 expire_tsf_lo;
  1188. /* DWORD 4: tx expiry time (TSF) MSBs */
  1189. A_UINT32 expire_tsf_hi;
  1190. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1191. } POSTPACK;
  1192. /* DWORD 0 */
  1193. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1194. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1195. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1196. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1197. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1198. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1199. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1200. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1201. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1202. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1203. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1204. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1205. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1206. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1207. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1208. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1209. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1210. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1211. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1212. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1213. /* DWORD 1 */
  1214. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1215. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1216. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1217. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1218. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1219. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1220. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1221. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1222. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1223. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1224. /* DWORD 2 */
  1225. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1226. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1227. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1228. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1229. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1230. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1231. /* DWORD 0 */
  1232. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1233. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1234. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1235. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1236. do { \
  1237. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1238. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1239. } while (0)
  1240. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1241. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1242. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1243. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1244. do { \
  1245. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1246. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1247. } while (0)
  1248. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1249. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1250. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1251. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1252. do { \
  1253. HTT_CHECK_SET_VAL( \
  1254. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1255. ((_var) |= ((_val) \
  1256. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1257. } while (0)
  1258. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1259. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1260. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1261. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1262. do { \
  1263. HTT_CHECK_SET_VAL( \
  1264. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1265. ((_var) |= ((_val) \
  1266. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1267. } while (0)
  1268. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1269. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1270. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1271. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1272. do { \
  1273. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1274. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1275. } while (0)
  1276. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1277. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1278. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1279. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1280. do { \
  1281. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1282. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1283. } while (0)
  1284. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1285. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1286. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1287. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1288. do { \
  1289. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1290. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1291. } while (0)
  1292. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1293. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1294. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1295. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1296. do { \
  1297. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1298. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1299. } while (0)
  1300. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1301. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1302. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1303. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1304. do { \
  1305. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1306. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1307. } while (0)
  1308. /* DWORD 1 */
  1309. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1310. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1311. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1312. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1313. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1314. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1315. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1316. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1317. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1318. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1319. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1320. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1321. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1322. do { \
  1323. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1324. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1325. } while (0)
  1326. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1327. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1328. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1329. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1330. do { \
  1331. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1332. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1333. } while (0)
  1334. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1335. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1336. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1337. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1338. do { \
  1339. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1340. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1341. } while (0)
  1342. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1343. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1344. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1345. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1346. do { \
  1347. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1348. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1349. } while (0)
  1350. /* DWORD 2 */
  1351. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1352. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1353. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1354. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1355. do { \
  1356. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1357. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1358. } while (0)
  1359. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1360. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1361. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1362. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1363. do { \
  1364. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1365. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1366. } while (0)
  1367. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1368. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1369. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1370. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1371. do { \
  1372. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1373. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1374. } while (0)
  1375. typedef enum {
  1376. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1377. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1378. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1379. } htt_11ax_ltf_subtype_t;
  1380. typedef enum {
  1381. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1382. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1383. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1384. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1385. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1386. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1387. } htt_tx_ext2_preamble_type_t;
  1388. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1389. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1390. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1391. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1392. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1393. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1394. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1395. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1396. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1397. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1398. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1399. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1400. /**
  1401. * @brief HTT tx MSDU extension descriptor v2
  1402. * @details
  1403. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1404. * is received as tcl_exit_base->host_meta_info in firmware.
  1405. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1406. * are already part of tcl_exit_base.
  1407. */
  1408. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1409. /* DWORD 0: flags */
  1410. A_UINT32
  1411. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1412. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1413. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1414. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1415. valid_retries : 1, /* if set, tx retries spec is valid */
  1416. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1417. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1418. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1419. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1420. valid_key_flags : 1, /* if set, key flags is valid */
  1421. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1422. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1423. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1424. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1425. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1426. 1 = ENCRYPT,
  1427. 2 ~ 3 - Reserved */
  1428. /* retry_limit -
  1429. * Specify the maximum number of transmissions, including the
  1430. * initial transmission, to attempt before giving up if no ack
  1431. * is received.
  1432. * If the tx rate is specified, then all retries shall use the
  1433. * same rate as the initial transmission.
  1434. * If no tx rate is specified, the target can choose whether to
  1435. * retain the original rate during the retransmissions, or to
  1436. * fall back to a more robust rate.
  1437. */
  1438. retry_limit : 4,
  1439. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1440. * Valid only for 11ax preamble types HE_SU
  1441. * and HE_EXT_SU
  1442. */
  1443. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1444. * Valid only for 11ax preamble types HE_SU
  1445. * and HE_EXT_SU
  1446. */
  1447. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1448. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1449. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1450. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1451. */
  1452. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1453. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1454. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1455. * Use cases:
  1456. * Any time firmware uses TQM-BYPASS for Data
  1457. * TID, firmware expect host to set this bit.
  1458. */
  1459. /* DWORD 1: tx power, tx rate */
  1460. A_UINT32
  1461. power : 8, /* unit of the power field is 0.5 dbm
  1462. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1463. * signed value ranging from -64dbm to 63.5 dbm
  1464. */
  1465. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1466. * Setting more than one MCS isn't currently
  1467. * supported by the target (but is supported
  1468. * in the interface in case in the future
  1469. * the target supports specifications of
  1470. * a limited set of MCS values.
  1471. */
  1472. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1473. * Setting more than one Nss isn't currently
  1474. * supported by the target (but is supported
  1475. * in the interface in case in the future
  1476. * the target supports specifications of
  1477. * a limited set of Nss values.
  1478. */
  1479. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1480. update_peer_cache : 1; /* When set these custom values will be
  1481. * used for all packets, until the next
  1482. * update via this ext header.
  1483. * This is to make sure not all packets
  1484. * need to include this header.
  1485. */
  1486. /* DWORD 2: tx chain mask, tx retries */
  1487. A_UINT32
  1488. /* chain_mask - specify which chains to transmit from */
  1489. chain_mask : 8,
  1490. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1491. * TODO: Update Enum values for key_flags
  1492. */
  1493. /*
  1494. * Channel frequency: This identifies the desired channel
  1495. * frequency (in MHz) for tx frames. This is used by FW to help
  1496. * determine when it is safe to transmit or drop frames for
  1497. * off-channel operation.
  1498. * The default value of zero indicates to FW that the corresponding
  1499. * VDEV's home channel (if there is one) is the desired channel
  1500. * frequency.
  1501. */
  1502. chanfreq : 16;
  1503. /* DWORD 3: tx expiry time (TSF) LSBs */
  1504. A_UINT32 expire_tsf_lo;
  1505. /* DWORD 4: tx expiry time (TSF) MSBs */
  1506. A_UINT32 expire_tsf_hi;
  1507. /* DWORD 5: reserved
  1508. * This structure can be expanded further up to 60 bytes
  1509. * by adding further DWORDs as needed.
  1510. */
  1511. A_UINT32 rsvd0;
  1512. } POSTPACK;
  1513. /* DWORD 0 */
  1514. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1515. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1516. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1517. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1518. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1519. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1520. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1521. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1522. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1523. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1524. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1525. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1526. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1527. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1528. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1529. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1530. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1531. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1532. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1533. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1534. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1535. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1536. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1537. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1538. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1539. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1540. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1541. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1542. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1543. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1544. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1545. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1546. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1547. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1548. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1549. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1550. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1551. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1552. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1553. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1554. /* DWORD 1 */
  1555. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1556. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1557. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1558. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1559. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1560. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1561. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1562. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1563. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1564. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1565. /* DWORD 2 */
  1566. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1567. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1568. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1569. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1570. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1571. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1572. /* DWORD 0 */
  1573. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1574. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1575. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1576. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1577. do { \
  1578. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1579. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1580. } while (0)
  1581. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1582. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1583. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1584. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1585. do { \
  1586. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1587. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1588. } while (0)
  1589. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1590. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1591. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1592. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1593. do { \
  1594. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1595. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1596. } while (0)
  1597. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1598. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1599. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1600. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1601. do { \
  1602. HTT_CHECK_SET_VAL( \
  1603. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1604. ((_var) |= ((_val) \
  1605. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1606. } while (0)
  1607. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1608. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1609. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1610. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1611. do { \
  1612. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1613. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1614. } while (0)
  1615. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1616. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1617. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1618. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1619. do { \
  1620. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1621. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1622. } while (0)
  1623. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1624. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1625. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1626. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1627. do { \
  1628. HTT_CHECK_SET_VAL( \
  1629. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1630. ((_var) |= ((_val) \
  1631. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1632. } while (0)
  1633. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1634. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1635. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1636. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1637. do { \
  1638. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1639. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1640. } while (0)
  1641. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1642. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1643. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1644. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1645. do { \
  1646. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1647. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1648. } while (0)
  1649. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1650. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1651. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1652. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1653. do { \
  1654. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1655. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1656. } while (0)
  1657. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1658. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1659. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1660. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1661. do { \
  1662. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1663. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1664. } while (0)
  1665. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1666. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1667. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1668. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1669. do { \
  1670. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1671. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1672. } while (0)
  1673. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1674. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1675. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1676. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1677. do { \
  1678. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1679. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1680. } while (0)
  1681. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1682. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1683. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1684. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1685. do { \
  1686. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1687. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1688. } while (0)
  1689. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1690. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1691. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1692. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1693. do { \
  1694. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1695. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1696. } while (0)
  1697. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1698. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1699. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1700. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1701. do { \
  1702. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  1703. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  1704. } while (0)
  1705. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1706. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1707. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1708. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1709. do { \
  1710. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  1711. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  1712. } while (0)
  1713. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1714. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1715. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1716. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1717. do { \
  1718. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  1719. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1720. } while (0)
  1721. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1722. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1723. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1724. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1725. do { \
  1726. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1727. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  1728. } while (0)
  1729. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1730. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1731. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1732. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1733. do { \
  1734. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  1735. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1736. } while (0)
  1737. /* DWORD 1 */
  1738. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1739. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1740. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1741. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1742. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1743. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1744. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1745. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1746. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  1747. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  1748. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  1749. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  1750. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  1751. do { \
  1752. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  1753. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  1754. } while (0)
  1755. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  1756. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  1757. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  1758. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  1759. do { \
  1760. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  1761. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  1762. } while (0)
  1763. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  1764. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  1765. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  1766. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  1767. do { \
  1768. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  1769. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  1770. } while (0)
  1771. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  1772. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  1773. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  1774. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  1775. do { \
  1776. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  1777. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  1778. } while (0)
  1779. /* DWORD 2 */
  1780. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  1781. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  1782. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  1783. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  1784. do { \
  1785. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  1786. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  1787. } while (0)
  1788. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  1789. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  1790. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  1791. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  1792. do { \
  1793. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  1794. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  1795. } while (0)
  1796. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  1797. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  1798. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  1799. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  1800. do { \
  1801. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  1802. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  1803. } while (0)
  1804. typedef enum {
  1805. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  1806. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  1807. } htt_tcl_metadata_type;
  1808. /**
  1809. * @brief HTT TCL command number format
  1810. * @details
  1811. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  1812. * available to firmware as tcl_exit_base->tcl_status_number.
  1813. * For regular / multicast packets host will send vdev and mac id and for
  1814. * NAWDS packets, host will send peer id.
  1815. * A_UINT32 is used to avoid endianness conversion problems.
  1816. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  1817. */
  1818. typedef struct {
  1819. A_UINT32
  1820. type: 1, /* vdev_id based or peer_id based */
  1821. rsvd: 31;
  1822. } htt_tx_tcl_vdev_or_peer_t;
  1823. typedef struct {
  1824. A_UINT32
  1825. type: 1, /* vdev_id based or peer_id based */
  1826. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1827. vdev_id: 8,
  1828. pdev_id: 2,
  1829. host_inspected:1,
  1830. rsvd: 19;
  1831. } htt_tx_tcl_vdev_metadata;
  1832. typedef struct {
  1833. A_UINT32
  1834. type: 1, /* vdev_id based or peer_id based */
  1835. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1836. peer_id: 14,
  1837. rsvd: 16;
  1838. } htt_tx_tcl_peer_metadata;
  1839. PREPACK struct htt_tx_tcl_metadata {
  1840. union {
  1841. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  1842. htt_tx_tcl_vdev_metadata vdev_meta;
  1843. htt_tx_tcl_peer_metadata peer_meta;
  1844. };
  1845. } POSTPACK;
  1846. /* DWORD 0 */
  1847. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  1848. #define HTT_TX_TCL_METADATA_TYPE_S 0
  1849. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  1850. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  1851. /* VDEV metadata */
  1852. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  1853. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  1854. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  1855. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  1856. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  1857. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  1858. /* PEER metadata */
  1859. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  1860. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  1861. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  1862. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  1863. HTT_TX_TCL_METADATA_TYPE_S)
  1864. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  1865. do { \
  1866. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  1867. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  1868. } while (0)
  1869. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  1870. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  1871. HTT_TX_TCL_METADATA_VALID_HTT_S)
  1872. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  1873. do { \
  1874. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  1875. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  1876. } while (0)
  1877. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  1878. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  1879. HTT_TX_TCL_METADATA_VDEV_ID_S)
  1880. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  1881. do { \
  1882. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  1883. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  1884. } while (0)
  1885. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  1886. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  1887. HTT_TX_TCL_METADATA_PDEV_ID_S)
  1888. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  1889. do { \
  1890. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  1891. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  1892. } while (0)
  1893. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  1894. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  1895. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  1896. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  1897. do { \
  1898. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  1899. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  1900. } while (0)
  1901. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  1902. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  1903. HTT_TX_TCL_METADATA_PEER_ID_S)
  1904. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  1905. do { \
  1906. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  1907. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  1908. } while (0)
  1909. typedef enum {
  1910. HTT_TX_FW2WBM_TX_STATUS_OK,
  1911. HTT_TX_FW2WBM_TX_STATUS_DROP,
  1912. HTT_TX_FW2WBM_TX_STATUS_TTL,
  1913. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  1914. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  1915. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  1916. HTT_TX_FW2WBM_TX_STATUS_MAX
  1917. } htt_tx_fw2wbm_tx_status_t;
  1918. typedef enum {
  1919. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  1920. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  1921. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  1922. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  1923. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  1924. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  1925. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  1926. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  1927. } htt_tx_fw2wbm_reinject_reason_t;
  1928. /**
  1929. * @brief HTT TX WBM Completion from firmware to host
  1930. * @details
  1931. * This structure is passed from firmware to host overlayed on wbm_release_ring
  1932. * DWORD 3 and 4 for software based completions (Exception frames and
  1933. * TQM bypass frames)
  1934. * For software based completions, wbm_release_ring->release_source_module will
  1935. * be set to release_source_fw
  1936. */
  1937. PREPACK struct htt_tx_wbm_completion {
  1938. A_UINT32
  1939. sch_cmd_id: 24,
  1940. exception_frame: 1, /* If set, this packet was queued via exception path */
  1941. rsvd0_31_25: 7;
  1942. A_UINT32
  1943. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  1944. * reception of an ACK or BA, this field indicates
  1945. * the RSSI of the received ACK or BA frame.
  1946. * When the frame is removed as result of a direct
  1947. * remove command from the SW, this field is set
  1948. * to 0x0 (which is never a valid value when real
  1949. * RSSI is available).
  1950. * Units: dB w.r.t noise floor
  1951. */
  1952. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  1953. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  1954. rsvd1_31_16: 16;
  1955. } POSTPACK;
  1956. /* DWORD 0 */
  1957. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  1958. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  1959. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  1960. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  1961. /* DWORD 1 */
  1962. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  1963. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  1964. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  1965. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  1966. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  1967. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  1968. /* DWORD 0 */
  1969. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  1970. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  1971. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  1972. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  1973. do { \
  1974. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  1975. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  1976. } while (0)
  1977. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  1978. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  1979. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  1980. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  1981. do { \
  1982. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  1983. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  1984. } while (0)
  1985. /* DWORD 1 */
  1986. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  1987. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  1988. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  1989. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  1990. do { \
  1991. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  1992. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  1993. } while (0)
  1994. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  1995. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  1996. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  1997. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  1998. do { \
  1999. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2000. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2001. } while (0)
  2002. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2003. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2004. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2005. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2006. do { \
  2007. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2008. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2009. } while (0)
  2010. /**
  2011. * @brief HTT TX WBM Completion from firmware to host
  2012. * @details
  2013. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2014. * (WBM) offload HW.
  2015. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2016. * For software based completions, release_source_module will
  2017. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2018. * struct wbm_release_ring and then switch to this after looking at
  2019. * release_source_module.
  2020. */
  2021. PREPACK struct htt_tx_wbm_completion_v2 {
  2022. A_UINT32
  2023. used_by_hw0; /* Refer to struct wbm_release_ring */
  2024. A_UINT32
  2025. used_by_hw1; /* Refer to struct wbm_release_ring */
  2026. A_UINT32
  2027. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2028. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2029. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2030. exception_frame: 1,
  2031. rsvd0: 12, /* For future use */
  2032. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2033. rsvd1: 1; /* For future use */
  2034. A_UINT32
  2035. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2036. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2037. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2038. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2039. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2040. */
  2041. A_UINT32
  2042. data1: 32;
  2043. A_UINT32
  2044. data2: 32;
  2045. A_UINT32
  2046. used_by_hw3; /* Refer to struct wbm_release_ring */
  2047. } POSTPACK;
  2048. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2049. /* DWORD 3 */
  2050. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2051. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2052. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2053. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2054. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2055. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2056. /* DWORD 3 */
  2057. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2058. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2059. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2060. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2061. do { \
  2062. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2063. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2064. } while (0)
  2065. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2066. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2067. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2068. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2069. do { \
  2070. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2071. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2072. } while (0)
  2073. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2074. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2075. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2076. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2077. do { \
  2078. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2079. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2080. } while (0)
  2081. /**
  2082. * @brief HTT TX WBM transmit status from firmware to host
  2083. * @details
  2084. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2085. * (WBM) offload HW.
  2086. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2087. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2088. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2089. */
  2090. PREPACK struct htt_tx_wbm_transmit_status {
  2091. A_UINT32
  2092. sch_cmd_id: 24,
  2093. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2094. * reception of an ACK or BA, this field indicates
  2095. * the RSSI of the received ACK or BA frame.
  2096. * When the frame is removed as result of a direct
  2097. * remove command from the SW, this field is set
  2098. * to 0x0 (which is never a valid value when real
  2099. * RSSI is available).
  2100. * Units: dB w.r.t noise floor
  2101. */
  2102. A_UINT32
  2103. reserved0: 32;
  2104. A_UINT32
  2105. reserved1: 32;
  2106. } POSTPACK;
  2107. /* DWORD 4 */
  2108. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2109. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2110. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2111. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2112. /* DWORD 4 */
  2113. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2114. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2115. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2116. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2117. do { \
  2118. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2119. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2120. } while (0)
  2121. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2122. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2123. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2124. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2125. do { \
  2126. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2127. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2128. } while (0)
  2129. /**
  2130. * @brief HTT TX WBM reinject status from firmware to host
  2131. * @details
  2132. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2133. * (WBM) offload HW.
  2134. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2135. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2136. */
  2137. PREPACK struct htt_tx_wbm_reinject_status {
  2138. A_UINT32
  2139. reserved0: 32;
  2140. A_UINT32
  2141. reserved1: 32;
  2142. A_UINT32
  2143. reserved2: 32;
  2144. } POSTPACK;
  2145. /**
  2146. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2147. * @details
  2148. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2149. * (WBM) offload HW.
  2150. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2151. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2152. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2153. * STA side.
  2154. */
  2155. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2156. A_UINT32
  2157. mec_sa_addr_31_0;
  2158. A_UINT32
  2159. mec_sa_addr_47_32: 16,
  2160. sa_ast_index: 16;
  2161. A_UINT32
  2162. vdev_id: 8,
  2163. reserved0: 24;
  2164. } POSTPACK;
  2165. /* DWORD 4 - mec_sa_addr_31_0 */
  2166. /* DWORD 5 */
  2167. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2168. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2169. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2170. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2171. /* DWORD 6 */
  2172. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2173. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2174. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2175. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2176. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2177. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2178. do { \
  2179. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2180. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2181. } while (0)
  2182. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2183. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2184. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2185. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2186. do { \
  2187. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2188. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2189. } while (0)
  2190. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2191. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2192. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2193. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2194. do { \
  2195. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2196. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2197. } while (0)
  2198. typedef enum {
  2199. TX_FLOW_PRIORITY_BE,
  2200. TX_FLOW_PRIORITY_HIGH,
  2201. TX_FLOW_PRIORITY_LOW,
  2202. } htt_tx_flow_priority_t;
  2203. typedef enum {
  2204. TX_FLOW_LATENCY_SENSITIVE,
  2205. TX_FLOW_LATENCY_INSENSITIVE,
  2206. } htt_tx_flow_latency_t;
  2207. typedef enum {
  2208. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2209. TX_FLOW_INTERACTIVE_TRAFFIC,
  2210. TX_FLOW_PERIODIC_TRAFFIC,
  2211. TX_FLOW_BURSTY_TRAFFIC,
  2212. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2213. } htt_tx_flow_traffic_pattern_t;
  2214. /**
  2215. * @brief HTT TX Flow search metadata format
  2216. * @details
  2217. * Host will set this metadata in flow table's flow search entry along with
  2218. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2219. * firmware and TQM ring if the flow search entry wins.
  2220. * This metadata is available to firmware in that first MSDU's
  2221. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2222. * to one of the available flows for specific tid and returns the tqm flow
  2223. * pointer as part of htt_tx_map_flow_info message.
  2224. */
  2225. PREPACK struct htt_tx_flow_metadata {
  2226. A_UINT32
  2227. rsvd0_1_0: 2,
  2228. tid: 4,
  2229. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2230. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2231. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2232. * Else choose final tid based on latency, priority.
  2233. */
  2234. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2235. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2236. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2237. } POSTPACK;
  2238. /* DWORD 0 */
  2239. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2240. #define HTT_TX_FLOW_METADATA_TID_S 2
  2241. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2242. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2243. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2244. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2245. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2246. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2247. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2248. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2249. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2250. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2251. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2252. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2253. /* DWORD 0 */
  2254. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2255. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2256. HTT_TX_FLOW_METADATA_TID_S)
  2257. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2258. do { \
  2259. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2260. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2261. } while (0)
  2262. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2263. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2264. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2265. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2266. do { \
  2267. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2268. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2269. } while (0)
  2270. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2271. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2272. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2273. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2274. do { \
  2275. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2276. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2277. } while (0)
  2278. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2279. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2280. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2281. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2282. do { \
  2283. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2284. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2285. } while (0)
  2286. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2287. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2288. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2289. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2290. do { \
  2291. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2292. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2293. } while (0)
  2294. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2295. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2296. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2297. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2298. do { \
  2299. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2300. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2301. } while (0)
  2302. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2303. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2304. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2305. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2306. do { \
  2307. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2308. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2309. } while (0)
  2310. /**
  2311. * @brief Used in HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY and HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY messages
  2312. *
  2313. * @details
  2314. * HTT wds entry from source port learning
  2315. * Host will learn wds entries from rx and send this message to firmware
  2316. * to enable firmware to configure/delete AST entries for wds clients.
  2317. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2318. * and when SA's entry is deleted, firmware removes this AST entry
  2319. *
  2320. * The message would appear as follows:
  2321. *
  2322. * |31 30|29 |17 16|15 8|7 0|
  2323. * |----------------+----------------+----------------+----------------|
  2324. * | rsvd0 |PDVID| vdev_id | msg_type |
  2325. * |-------------------------------------------------------------------|
  2326. * | sa_addr_31_0 |
  2327. * |-------------------------------------------------------------------|
  2328. * | | ta_peer_id | sa_addr_47_32 |
  2329. * |-------------------------------------------------------------------|
  2330. * Where PDVID = pdev_id
  2331. *
  2332. * The message is interpreted as follows:
  2333. *
  2334. * dword0 - b'0:7 - msg_type: This will be set to
  2335. * HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY or
  2336. * HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2337. *
  2338. * dword0 - b'8:15 - vdev_id
  2339. *
  2340. * dword0 - b'16:17 - pdev_id
  2341. *
  2342. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2343. *
  2344. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2345. *
  2346. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2347. *
  2348. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2349. */
  2350. PREPACK struct htt_wds_entry {
  2351. A_UINT32
  2352. msg_type: 8,
  2353. vdev_id: 8,
  2354. pdev_id: 2,
  2355. rsvd0: 14;
  2356. A_UINT32 sa_addr_31_0;
  2357. A_UINT32
  2358. sa_addr_47_32: 16,
  2359. ta_peer_id: 14,
  2360. rsvd2: 2;
  2361. } POSTPACK;
  2362. /* DWORD 0 */
  2363. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2364. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2365. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2366. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2367. /* DWORD 2 */
  2368. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2369. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2370. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2371. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2372. /* DWORD 0 */
  2373. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2374. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2375. HTT_WDS_ENTRY_VDEV_ID_S)
  2376. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2377. do { \
  2378. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2379. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2380. } while (0)
  2381. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2382. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2383. HTT_WDS_ENTRY_PDEV_ID_S)
  2384. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2385. do { \
  2386. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2387. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2388. } while (0)
  2389. /* DWORD 2 */
  2390. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2391. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2392. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2393. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2394. do { \
  2395. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2396. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2397. } while (0)
  2398. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2399. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2400. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2401. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2402. do { \
  2403. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2404. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2405. } while (0)
  2406. /**
  2407. * @brief MAC DMA rx ring setup specification
  2408. * @details
  2409. * To allow for dynamic rx ring reconfiguration and to avoid race
  2410. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2411. * it uses. Instead, it sends this message to the target, indicating how
  2412. * the rx ring used by the host should be set up and maintained.
  2413. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2414. * specifications.
  2415. *
  2416. * |31 16|15 8|7 0|
  2417. * |---------------------------------------------------------------|
  2418. * header: | reserved | num rings | msg type |
  2419. * |---------------------------------------------------------------|
  2420. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2421. #if HTT_PADDR64
  2422. * | FW_IDX shadow register physical address (bits 63:32) |
  2423. #endif
  2424. * |---------------------------------------------------------------|
  2425. * | rx ring base physical address (bits 31:0) |
  2426. #if HTT_PADDR64
  2427. * | rx ring base physical address (bits 63:32) |
  2428. #endif
  2429. * |---------------------------------------------------------------|
  2430. * | rx ring buffer size | rx ring length |
  2431. * |---------------------------------------------------------------|
  2432. * | FW_IDX initial value | enabled flags |
  2433. * |---------------------------------------------------------------|
  2434. * | MSDU payload offset | 802.11 header offset |
  2435. * |---------------------------------------------------------------|
  2436. * | PPDU end offset | PPDU start offset |
  2437. * |---------------------------------------------------------------|
  2438. * | MPDU end offset | MPDU start offset |
  2439. * |---------------------------------------------------------------|
  2440. * | MSDU end offset | MSDU start offset |
  2441. * |---------------------------------------------------------------|
  2442. * | frag info offset | rx attention offset |
  2443. * |---------------------------------------------------------------|
  2444. * payload 2, if present, has the same format as payload 1
  2445. * Header fields:
  2446. * - MSG_TYPE
  2447. * Bits 7:0
  2448. * Purpose: identifies this as an rx ring configuration message
  2449. * Value: 0x2
  2450. * - NUM_RINGS
  2451. * Bits 15:8
  2452. * Purpose: indicates whether the host is setting up one rx ring or two
  2453. * Value: 1 or 2
  2454. * Payload:
  2455. * for systems using 64-bit format for bus addresses:
  2456. * - IDX_SHADOW_REG_PADDR_LO
  2457. * Bits 31:0
  2458. * Value: lower 4 bytes of physical address of the host's
  2459. * FW_IDX shadow register
  2460. * - IDX_SHADOW_REG_PADDR_HI
  2461. * Bits 31:0
  2462. * Value: upper 4 bytes of physical address of the host's
  2463. * FW_IDX shadow register
  2464. * - RING_BASE_PADDR_LO
  2465. * Bits 31:0
  2466. * Value: lower 4 bytes of physical address of the host's rx ring
  2467. * - RING_BASE_PADDR_HI
  2468. * Bits 31:0
  2469. * Value: uppper 4 bytes of physical address of the host's rx ring
  2470. * for systems using 32-bit format for bus addresses:
  2471. * - IDX_SHADOW_REG_PADDR
  2472. * Bits 31:0
  2473. * Value: physical address of the host's FW_IDX shadow register
  2474. * - RING_BASE_PADDR
  2475. * Bits 31:0
  2476. * Value: physical address of the host's rx ring
  2477. * - RING_LEN
  2478. * Bits 15:0
  2479. * Value: number of elements in the rx ring
  2480. * - RING_BUF_SZ
  2481. * Bits 31:16
  2482. * Value: size of the buffers referenced by the rx ring, in byte units
  2483. * - ENABLED_FLAGS
  2484. * Bits 15:0
  2485. * Value: 1-bit flags to show whether different rx fields are enabled
  2486. * bit 0: 802.11 header enabled (1) or disabled (0)
  2487. * bit 1: MSDU payload enabled (1) or disabled (0)
  2488. * bit 2: PPDU start enabled (1) or disabled (0)
  2489. * bit 3: PPDU end enabled (1) or disabled (0)
  2490. * bit 4: MPDU start enabled (1) or disabled (0)
  2491. * bit 5: MPDU end enabled (1) or disabled (0)
  2492. * bit 6: MSDU start enabled (1) or disabled (0)
  2493. * bit 7: MSDU end enabled (1) or disabled (0)
  2494. * bit 8: rx attention enabled (1) or disabled (0)
  2495. * bit 9: frag info enabled (1) or disabled (0)
  2496. * bit 10: unicast rx enabled (1) or disabled (0)
  2497. * bit 11: multicast rx enabled (1) or disabled (0)
  2498. * bit 12: ctrl rx enabled (1) or disabled (0)
  2499. * bit 13: mgmt rx enabled (1) or disabled (0)
  2500. * bit 14: null rx enabled (1) or disabled (0)
  2501. * bit 15: phy data rx enabled (1) or disabled (0)
  2502. * - IDX_INIT_VAL
  2503. * Bits 31:16
  2504. * Purpose: Specify the initial value for the FW_IDX.
  2505. * Value: the number of buffers initially present in the host's rx ring
  2506. * - OFFSET_802_11_HDR
  2507. * Bits 15:0
  2508. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2509. * - OFFSET_MSDU_PAYLOAD
  2510. * Bits 31:16
  2511. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2512. * - OFFSET_PPDU_START
  2513. * Bits 15:0
  2514. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2515. * - OFFSET_PPDU_END
  2516. * Bits 31:16
  2517. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2518. * - OFFSET_MPDU_START
  2519. * Bits 15:0
  2520. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2521. * - OFFSET_MPDU_END
  2522. * Bits 31:16
  2523. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2524. * - OFFSET_MSDU_START
  2525. * Bits 15:0
  2526. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2527. * - OFFSET_MSDU_END
  2528. * Bits 31:16
  2529. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2530. * - OFFSET_RX_ATTN
  2531. * Bits 15:0
  2532. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2533. * - OFFSET_FRAG_INFO
  2534. * Bits 31:16
  2535. * Value: offset in QUAD-bytes of frag info table
  2536. */
  2537. /* header fields */
  2538. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2539. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2540. /* payload fields */
  2541. /* for systems using a 64-bit format for bus addresses */
  2542. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2543. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2544. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2545. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2546. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2547. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2548. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2549. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2550. /* for systems using a 32-bit format for bus addresses */
  2551. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2552. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2553. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2554. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2555. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2556. #define HTT_RX_RING_CFG_LEN_S 0
  2557. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2558. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2559. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2560. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2561. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2562. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2563. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2564. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2565. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2566. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2567. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2568. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2569. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2570. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2571. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2572. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2573. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2574. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2575. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2576. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2577. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2578. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2579. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2580. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2581. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2582. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2583. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2584. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2585. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2586. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2587. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2588. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2589. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2590. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2591. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2592. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2593. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2594. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2595. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2596. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2597. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2598. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2599. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2600. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2601. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2602. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2603. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2604. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2605. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2606. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2607. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2608. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2609. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2610. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2611. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2612. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2613. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2614. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2615. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2616. #if HTT_PADDR64
  2617. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2618. #else
  2619. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2620. #endif
  2621. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2622. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2623. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2624. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2625. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2626. do { \
  2627. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2628. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2629. } while (0)
  2630. /* degenerate case for 32-bit fields */
  2631. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  2632. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  2633. ((_var) = (_val))
  2634. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  2635. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  2636. ((_var) = (_val))
  2637. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  2638. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  2639. ((_var) = (_val))
  2640. /* degenerate case for 32-bit fields */
  2641. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  2642. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  2643. ((_var) = (_val))
  2644. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  2645. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  2646. ((_var) = (_val))
  2647. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  2648. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  2649. ((_var) = (_val))
  2650. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  2651. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  2652. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  2653. do { \
  2654. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  2655. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  2656. } while (0)
  2657. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  2658. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  2659. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  2660. do { \
  2661. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  2662. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  2663. } while (0)
  2664. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  2665. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  2666. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  2667. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  2668. do { \
  2669. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  2670. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  2671. } while (0)
  2672. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  2673. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  2674. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  2675. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  2676. do { \
  2677. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  2678. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  2679. } while (0)
  2680. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  2681. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  2682. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  2683. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  2684. do { \
  2685. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  2686. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  2687. } while (0)
  2688. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  2689. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  2690. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  2691. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  2692. do { \
  2693. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  2694. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  2695. } while (0)
  2696. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  2697. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  2698. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  2699. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  2700. do { \
  2701. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  2702. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  2703. } while (0)
  2704. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  2705. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  2706. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  2707. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  2708. do { \
  2709. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  2710. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  2711. } while (0)
  2712. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  2713. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  2714. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  2715. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  2716. do { \
  2717. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  2718. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  2719. } while (0)
  2720. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  2721. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  2722. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  2723. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  2724. do { \
  2725. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  2726. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  2727. } while (0)
  2728. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  2729. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  2730. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  2731. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  2732. do { \
  2733. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  2734. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  2735. } while (0)
  2736. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  2737. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  2738. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  2739. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  2740. do { \
  2741. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  2742. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  2743. } while (0)
  2744. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  2745. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  2746. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  2747. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  2748. do { \
  2749. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  2750. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  2751. } while (0)
  2752. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  2753. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  2754. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  2755. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  2756. do { \
  2757. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  2758. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  2759. } while (0)
  2760. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  2761. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  2762. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  2763. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  2764. do { \
  2765. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  2766. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  2767. } while (0)
  2768. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  2769. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  2770. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  2771. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  2772. do { \
  2773. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  2774. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  2775. } while (0)
  2776. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  2777. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  2778. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  2779. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  2780. do { \
  2781. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  2782. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  2783. } while (0)
  2784. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  2785. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  2786. HTT_RX_RING_CFG_ENABLED_NULL_S)
  2787. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  2788. do { \
  2789. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  2790. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  2791. } while (0)
  2792. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  2793. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  2794. HTT_RX_RING_CFG_ENABLED_PHY_S)
  2795. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  2796. do { \
  2797. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  2798. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  2799. } while (0)
  2800. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  2801. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  2802. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  2803. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  2804. do { \
  2805. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  2806. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  2807. } while (0)
  2808. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  2809. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  2810. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  2811. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  2812. do { \
  2813. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  2814. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  2815. } while (0)
  2816. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  2817. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  2818. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  2819. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  2820. do { \
  2821. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  2822. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  2823. } while (0)
  2824. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  2825. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  2826. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  2827. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  2828. do { \
  2829. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  2830. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  2831. } while (0)
  2832. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  2833. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  2834. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  2835. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  2836. do { \
  2837. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  2838. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  2839. } while (0)
  2840. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  2841. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  2842. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  2843. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  2844. do { \
  2845. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  2846. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  2847. } while (0)
  2848. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  2849. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  2850. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  2851. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  2852. do { \
  2853. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  2854. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  2855. } while (0)
  2856. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  2857. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  2858. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  2859. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  2860. do { \
  2861. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  2862. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  2863. } while (0)
  2864. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  2865. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  2866. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  2867. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  2868. do { \
  2869. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  2870. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  2871. } while (0)
  2872. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  2873. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  2874. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  2875. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  2876. do { \
  2877. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  2878. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  2879. } while (0)
  2880. /**
  2881. * @brief host -> target FW statistics retrieve
  2882. *
  2883. * @details
  2884. * The following field definitions describe the format of the HTT host
  2885. * to target FW stats retrieve message. The message specifies the type of
  2886. * stats host wants to retrieve.
  2887. *
  2888. * |31 24|23 16|15 8|7 0|
  2889. * |-----------------------------------------------------------|
  2890. * | stats types request bitmask | msg type |
  2891. * |-----------------------------------------------------------|
  2892. * | stats types reset bitmask | reserved |
  2893. * |-----------------------------------------------------------|
  2894. * | stats type | config value |
  2895. * |-----------------------------------------------------------|
  2896. * | cookie LSBs |
  2897. * |-----------------------------------------------------------|
  2898. * | cookie MSBs |
  2899. * |-----------------------------------------------------------|
  2900. * Header fields:
  2901. * - MSG_TYPE
  2902. * Bits 7:0
  2903. * Purpose: identifies this is a stats upload request message
  2904. * Value: 0x3
  2905. * - UPLOAD_TYPES
  2906. * Bits 31:8
  2907. * Purpose: identifies which types of FW statistics to upload
  2908. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  2909. * - RESET_TYPES
  2910. * Bits 31:8
  2911. * Purpose: identifies which types of FW statistics to reset
  2912. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  2913. * - CFG_VAL
  2914. * Bits 23:0
  2915. * Purpose: give an opaque configuration value to the specified stats type
  2916. * Value: stats-type specific configuration value
  2917. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  2918. * bits 7:0 - how many per-MPDU byte counts to include in a record
  2919. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  2920. * bits 23:16 - how many per-MSDU byte counts to include in a record
  2921. * - CFG_STAT_TYPE
  2922. * Bits 31:24
  2923. * Purpose: specify which stats type (if any) the config value applies to
  2924. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  2925. * a valid configuration specification
  2926. * - COOKIE_LSBS
  2927. * Bits 31:0
  2928. * Purpose: Provide a mechanism to match a target->host stats confirmation
  2929. * message with its preceding host->target stats request message.
  2930. * Value: LSBs of the opaque cookie specified by the host-side requestor
  2931. * - COOKIE_MSBS
  2932. * Bits 31:0
  2933. * Purpose: Provide a mechanism to match a target->host stats confirmation
  2934. * message with its preceding host->target stats request message.
  2935. * Value: MSBs of the opaque cookie specified by the host-side requestor
  2936. */
  2937. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  2938. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  2939. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  2940. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  2941. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  2942. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  2943. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  2944. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  2945. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  2946. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  2947. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  2948. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  2949. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  2950. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  2951. do { \
  2952. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  2953. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  2954. } while (0)
  2955. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  2956. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  2957. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  2958. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  2959. do { \
  2960. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  2961. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  2962. } while (0)
  2963. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  2964. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  2965. HTT_H2T_STATS_REQ_CFG_VAL_S)
  2966. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  2967. do { \
  2968. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  2969. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  2970. } while (0)
  2971. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  2972. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  2973. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  2974. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  2975. do { \
  2976. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  2977. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  2978. } while (0)
  2979. /**
  2980. * @brief host -> target HTT out-of-band sync request
  2981. *
  2982. * @details
  2983. * The HTT SYNC tells the target to suspend processing of subsequent
  2984. * HTT host-to-target messages until some other target agent locally
  2985. * informs the target HTT FW that the current sync counter is equal to
  2986. * or greater than (in a modulo sense) the sync counter specified in
  2987. * the SYNC message.
  2988. * This allows other host-target components to synchronize their operation
  2989. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  2990. * security key has been downloaded to and activated by the target.
  2991. * In the absence of any explicit synchronization counter value
  2992. * specification, the target HTT FW will use zero as the default current
  2993. * sync value.
  2994. *
  2995. * |31 24|23 16|15 8|7 0|
  2996. * |-----------------------------------------------------------|
  2997. * | reserved | sync count | msg type |
  2998. * |-----------------------------------------------------------|
  2999. * Header fields:
  3000. * - MSG_TYPE
  3001. * Bits 7:0
  3002. * Purpose: identifies this as a sync message
  3003. * Value: 0x4
  3004. * - SYNC_COUNT
  3005. * Bits 15:8
  3006. * Purpose: specifies what sync value the HTT FW will wait for from
  3007. * an out-of-band specification to resume its operation
  3008. * Value: in-band sync counter value to compare against the out-of-band
  3009. * counter spec.
  3010. * The HTT target FW will suspend its host->target message processing
  3011. * as long as
  3012. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3013. */
  3014. #define HTT_H2T_SYNC_MSG_SZ 4
  3015. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3016. #define HTT_H2T_SYNC_COUNT_S 8
  3017. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3018. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3019. HTT_H2T_SYNC_COUNT_S)
  3020. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3021. do { \
  3022. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3023. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3024. } while (0)
  3025. /**
  3026. * @brief HTT aggregation configuration
  3027. */
  3028. #define HTT_AGGR_CFG_MSG_SZ 4
  3029. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3030. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3031. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3032. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3033. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3034. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3035. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3036. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3037. do { \
  3038. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3039. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3040. } while (0)
  3041. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3042. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3043. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3044. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3045. do { \
  3046. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3047. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3048. } while (0)
  3049. /**
  3050. * @brief host -> target HTT configure max amsdu info per vdev
  3051. *
  3052. * @details
  3053. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3054. *
  3055. * |31 21|20 16|15 8|7 0|
  3056. * |-----------------------------------------------------------|
  3057. * | reserved | vdev id | max amsdu | msg type |
  3058. * |-----------------------------------------------------------|
  3059. * Header fields:
  3060. * - MSG_TYPE
  3061. * Bits 7:0
  3062. * Purpose: identifies this as a aggr cfg ex message
  3063. * Value: 0xa
  3064. * - MAX_NUM_AMSDU_SUBFRM
  3065. * Bits 15:8
  3066. * Purpose: max MSDUs per A-MSDU
  3067. * - VDEV_ID
  3068. * Bits 20:16
  3069. * Purpose: ID of the vdev to which this limit is applied
  3070. */
  3071. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3072. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3073. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3074. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3075. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3076. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3077. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3078. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3079. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3080. do { \
  3081. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3082. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3083. } while (0)
  3084. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3085. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3086. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3087. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3088. do { \
  3089. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3090. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3091. } while (0)
  3092. /**
  3093. * @brief HTT WDI_IPA Config Message
  3094. *
  3095. * @details
  3096. * The HTT WDI_IPA config message is created/sent by host at driver
  3097. * init time. It contains information about data structures used on
  3098. * WDI_IPA TX and RX path.
  3099. * TX CE ring is used for pushing packet metadata from IPA uC
  3100. * to WLAN FW
  3101. * TX Completion ring is used for generating TX completions from
  3102. * WLAN FW to IPA uC
  3103. * RX Indication ring is used for indicating RX packets from FW
  3104. * to IPA uC
  3105. * RX Ring2 is used as either completion ring or as second
  3106. * indication ring. when Ring2 is used as completion ring, IPA uC
  3107. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3108. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3109. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3110. * indicated in RX Indication ring. Please see WDI_IPA specification
  3111. * for more details.
  3112. * |31 24|23 16|15 8|7 0|
  3113. * |----------------+----------------+----------------+----------------|
  3114. * | tx pkt pool size | Rsvd | msg_type |
  3115. * |-------------------------------------------------------------------|
  3116. * | tx comp ring base (bits 31:0) |
  3117. #if HTT_PADDR64
  3118. * | tx comp ring base (bits 63:32) |
  3119. #endif
  3120. * |-------------------------------------------------------------------|
  3121. * | tx comp ring size |
  3122. * |-------------------------------------------------------------------|
  3123. * | tx comp WR_IDX physical address (bits 31:0) |
  3124. #if HTT_PADDR64
  3125. * | tx comp WR_IDX physical address (bits 63:32) |
  3126. #endif
  3127. * |-------------------------------------------------------------------|
  3128. * | tx CE WR_IDX physical address (bits 31:0) |
  3129. #if HTT_PADDR64
  3130. * | tx CE WR_IDX physical address (bits 63:32) |
  3131. #endif
  3132. * |-------------------------------------------------------------------|
  3133. * | rx indication ring base (bits 31:0) |
  3134. #if HTT_PADDR64
  3135. * | rx indication ring base (bits 63:32) |
  3136. #endif
  3137. * |-------------------------------------------------------------------|
  3138. * | rx indication ring size |
  3139. * |-------------------------------------------------------------------|
  3140. * | rx ind RD_IDX physical address (bits 31:0) |
  3141. #if HTT_PADDR64
  3142. * | rx ind RD_IDX physical address (bits 63:32) |
  3143. #endif
  3144. * |-------------------------------------------------------------------|
  3145. * | rx ind WR_IDX physical address (bits 31:0) |
  3146. #if HTT_PADDR64
  3147. * | rx ind WR_IDX physical address (bits 63:32) |
  3148. #endif
  3149. * |-------------------------------------------------------------------|
  3150. * |-------------------------------------------------------------------|
  3151. * | rx ring2 base (bits 31:0) |
  3152. #if HTT_PADDR64
  3153. * | rx ring2 base (bits 63:32) |
  3154. #endif
  3155. * |-------------------------------------------------------------------|
  3156. * | rx ring2 size |
  3157. * |-------------------------------------------------------------------|
  3158. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3159. #if HTT_PADDR64
  3160. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3161. #endif
  3162. * |-------------------------------------------------------------------|
  3163. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3164. #if HTT_PADDR64
  3165. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3166. #endif
  3167. * |-------------------------------------------------------------------|
  3168. *
  3169. * Header fields:
  3170. * Header fields:
  3171. * - MSG_TYPE
  3172. * Bits 7:0
  3173. * Purpose: Identifies this as WDI_IPA config message
  3174. * value: = 0x8
  3175. * - TX_PKT_POOL_SIZE
  3176. * Bits 15:0
  3177. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3178. * WDI_IPA TX path
  3179. * For systems using 32-bit format for bus addresses:
  3180. * - TX_COMP_RING_BASE_ADDR
  3181. * Bits 31:0
  3182. * Purpose: TX Completion Ring base address in DDR
  3183. * - TX_COMP_RING_SIZE
  3184. * Bits 31:0
  3185. * Purpose: TX Completion Ring size (must be power of 2)
  3186. * - TX_COMP_WR_IDX_ADDR
  3187. * Bits 31:0
  3188. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3189. * updates the Write Index for WDI_IPA TX completion ring
  3190. * - TX_CE_WR_IDX_ADDR
  3191. * Bits 31:0
  3192. * Purpose: DDR address where IPA uC
  3193. * updates the WR Index for TX CE ring
  3194. * (needed for fusion platforms)
  3195. * - RX_IND_RING_BASE_ADDR
  3196. * Bits 31:0
  3197. * Purpose: RX Indication Ring base address in DDR
  3198. * - RX_IND_RING_SIZE
  3199. * Bits 31:0
  3200. * Purpose: RX Indication Ring size
  3201. * - RX_IND_RD_IDX_ADDR
  3202. * Bits 31:0
  3203. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3204. * RX indication ring
  3205. * - RX_IND_WR_IDX_ADDR
  3206. * Bits 31:0
  3207. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3208. * updates the Write Index for WDI_IPA RX indication ring
  3209. * - RX_RING2_BASE_ADDR
  3210. * Bits 31:0
  3211. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3212. * - RX_RING2_SIZE
  3213. * Bits 31:0
  3214. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3215. * - RX_RING2_RD_IDX_ADDR
  3216. * Bits 31:0
  3217. * Purpose: If Second RX ring is Indication ring, DDR address where
  3218. * IPA uC updates the Read Index for Ring2.
  3219. * If Second RX ring is completion ring, this is NOT used
  3220. * - RX_RING2_WR_IDX_ADDR
  3221. * Bits 31:0
  3222. * Purpose: If Second RX ring is Indication ring, DDR address where
  3223. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3224. * If second RX ring is completion ring, DDR address where
  3225. * IPA uC updates the Write Index for Ring 2.
  3226. * For systems using 64-bit format for bus addresses:
  3227. * - TX_COMP_RING_BASE_ADDR_LO
  3228. * Bits 31:0
  3229. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3230. * - TX_COMP_RING_BASE_ADDR_HI
  3231. * Bits 31:0
  3232. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3233. * - TX_COMP_RING_SIZE
  3234. * Bits 31:0
  3235. * Purpose: TX Completion Ring size (must be power of 2)
  3236. * - TX_COMP_WR_IDX_ADDR_LO
  3237. * Bits 31:0
  3238. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3239. * Lower 4 bytes of DDR address where WIFI FW
  3240. * updates the Write Index for WDI_IPA TX completion ring
  3241. * - TX_COMP_WR_IDX_ADDR_HI
  3242. * Bits 31:0
  3243. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3244. * Higher 4 bytes of DDR address where WIFI FW
  3245. * updates the Write Index for WDI_IPA TX completion ring
  3246. * - TX_CE_WR_IDX_ADDR_LO
  3247. * Bits 31:0
  3248. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3249. * updates the WR Index for TX CE ring
  3250. * (needed for fusion platforms)
  3251. * - TX_CE_WR_IDX_ADDR_HI
  3252. * Bits 31:0
  3253. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3254. * updates the WR Index for TX CE ring
  3255. * (needed for fusion platforms)
  3256. * - RX_IND_RING_BASE_ADDR_LO
  3257. * Bits 31:0
  3258. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3259. * - RX_IND_RING_BASE_ADDR_HI
  3260. * Bits 31:0
  3261. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3262. * - RX_IND_RING_SIZE
  3263. * Bits 31:0
  3264. * Purpose: RX Indication Ring size
  3265. * - RX_IND_RD_IDX_ADDR_LO
  3266. * Bits 31:0
  3267. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3268. * for WDI_IPA RX indication ring
  3269. * - RX_IND_RD_IDX_ADDR_HI
  3270. * Bits 31:0
  3271. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3272. * for WDI_IPA RX indication ring
  3273. * - RX_IND_WR_IDX_ADDR_LO
  3274. * Bits 31:0
  3275. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3276. * Lower 4 bytes of DDR address where WIFI FW
  3277. * updates the Write Index for WDI_IPA RX indication ring
  3278. * - RX_IND_WR_IDX_ADDR_HI
  3279. * Bits 31:0
  3280. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3281. * Higher 4 bytes of DDR address where WIFI FW
  3282. * updates the Write Index for WDI_IPA RX indication ring
  3283. * - RX_RING2_BASE_ADDR_LO
  3284. * Bits 31:0
  3285. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3286. * - RX_RING2_BASE_ADDR_HI
  3287. * Bits 31:0
  3288. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3289. * - RX_RING2_SIZE
  3290. * Bits 31:0
  3291. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3292. * - RX_RING2_RD_IDX_ADDR_LO
  3293. * Bits 31:0
  3294. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3295. * DDR address where IPA uC updates the Read Index for Ring2.
  3296. * If Second RX ring is completion ring, this is NOT used
  3297. * - RX_RING2_RD_IDX_ADDR_HI
  3298. * Bits 31:0
  3299. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3300. * DDR address where IPA uC updates the Read Index for Ring2.
  3301. * If Second RX ring is completion ring, this is NOT used
  3302. * - RX_RING2_WR_IDX_ADDR_LO
  3303. * Bits 31:0
  3304. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3305. * DDR address where WIFI FW updates the Write Index
  3306. * for WDI_IPA RX ring2
  3307. * If second RX ring is completion ring, lower 4 bytes of
  3308. * DDR address where IPA uC updates the Write Index for Ring 2.
  3309. * - RX_RING2_WR_IDX_ADDR_HI
  3310. * Bits 31:0
  3311. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3312. * DDR address where WIFI FW updates the Write Index
  3313. * for WDI_IPA RX ring2
  3314. * If second RX ring is completion ring, higher 4 bytes of
  3315. * DDR address where IPA uC updates the Write Index for Ring 2.
  3316. */
  3317. #if HTT_PADDR64
  3318. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3319. #else
  3320. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3321. #endif
  3322. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3323. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3324. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3325. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3326. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3327. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3328. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3329. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3330. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3331. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3332. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3333. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3334. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3335. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3336. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3337. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3338. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3339. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3340. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3341. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3342. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3343. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3344. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3345. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3346. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3347. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3348. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3349. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3350. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3351. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3352. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3353. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3354. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3355. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3356. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3357. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3358. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3359. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3360. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3361. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3362. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3363. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3364. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3365. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3366. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3367. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3368. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3369. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3370. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3371. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3372. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3373. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3374. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3375. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3376. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3377. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3378. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3379. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3380. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3381. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3382. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3383. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3384. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3385. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3386. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3387. do { \
  3388. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3389. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3390. } while (0)
  3391. /* for systems using 32-bit format for bus addr */
  3392. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3393. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3394. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3395. do { \
  3396. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3397. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3398. } while (0)
  3399. /* for systems using 64-bit format for bus addr */
  3400. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3401. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3402. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3403. do { \
  3404. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3405. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3406. } while (0)
  3407. /* for systems using 64-bit format for bus addr */
  3408. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3409. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3410. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3411. do { \
  3412. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3413. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3414. } while (0)
  3415. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3416. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3417. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3418. do { \
  3419. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3420. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3421. } while (0)
  3422. /* for systems using 32-bit format for bus addr */
  3423. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3424. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3425. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3426. do { \
  3427. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3428. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3429. } while (0)
  3430. /* for systems using 64-bit format for bus addr */
  3431. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3432. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3433. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3434. do { \
  3435. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3436. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3437. } while (0)
  3438. /* for systems using 64-bit format for bus addr */
  3439. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3440. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3441. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3442. do { \
  3443. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3444. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3445. } while (0)
  3446. /* for systems using 32-bit format for bus addr */
  3447. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3448. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3449. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3450. do { \
  3451. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3452. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3453. } while (0)
  3454. /* for systems using 64-bit format for bus addr */
  3455. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3456. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3457. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3458. do { \
  3459. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3460. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3461. } while (0)
  3462. /* for systems using 64-bit format for bus addr */
  3463. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3464. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3465. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3466. do { \
  3467. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3468. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3469. } while (0)
  3470. /* for systems using 32-bit format for bus addr */
  3471. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3472. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3473. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3474. do { \
  3475. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3476. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3477. } while (0)
  3478. /* for systems using 64-bit format for bus addr */
  3479. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3480. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3481. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3482. do { \
  3483. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3484. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3485. } while (0)
  3486. /* for systems using 64-bit format for bus addr */
  3487. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3488. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3489. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3490. do { \
  3491. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3492. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3493. } while (0)
  3494. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3495. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3496. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3497. do { \
  3498. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3499. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3500. } while (0)
  3501. /* for systems using 32-bit format for bus addr */
  3502. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3503. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3504. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3505. do { \
  3506. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3507. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3508. } while (0)
  3509. /* for systems using 64-bit format for bus addr */
  3510. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3511. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3512. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3513. do { \
  3514. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3515. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3516. } while (0)
  3517. /* for systems using 64-bit format for bus addr */
  3518. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3519. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3520. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3521. do { \
  3522. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3523. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3524. } while (0)
  3525. /* for systems using 32-bit format for bus addr */
  3526. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3527. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3528. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3529. do { \
  3530. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3531. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3532. } while (0)
  3533. /* for systems using 64-bit format for bus addr */
  3534. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3535. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3536. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3537. do { \
  3538. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3539. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3540. } while (0)
  3541. /* for systems using 64-bit format for bus addr */
  3542. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3543. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3544. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3545. do { \
  3546. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3547. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3548. } while (0)
  3549. /* for systems using 32-bit format for bus addr */
  3550. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3551. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3552. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3553. do { \
  3554. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3555. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3556. } while (0)
  3557. /* for systems using 64-bit format for bus addr */
  3558. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3559. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3560. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3561. do { \
  3562. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3563. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3564. } while (0)
  3565. /* for systems using 64-bit format for bus addr */
  3566. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3567. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3568. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3569. do { \
  3570. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3571. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3572. } while (0)
  3573. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3574. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3575. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3576. do { \
  3577. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3578. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3579. } while (0)
  3580. /* for systems using 32-bit format for bus addr */
  3581. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3582. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3583. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3584. do { \
  3585. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3586. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3587. } while (0)
  3588. /* for systems using 64-bit format for bus addr */
  3589. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3590. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3591. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3592. do { \
  3593. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3594. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3595. } while (0)
  3596. /* for systems using 64-bit format for bus addr */
  3597. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3598. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3599. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3600. do { \
  3601. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3602. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3603. } while (0)
  3604. /* for systems using 32-bit format for bus addr */
  3605. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3606. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3607. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3608. do { \
  3609. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3610. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3611. } while (0)
  3612. /* for systems using 64-bit format for bus addr */
  3613. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3614. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3615. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3616. do { \
  3617. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3618. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3619. } while (0)
  3620. /* for systems using 64-bit format for bus addr */
  3621. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  3622. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  3623. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  3624. do { \
  3625. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  3626. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  3627. } while (0)
  3628. /*
  3629. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  3630. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  3631. * addresses are stored in a XXX-bit field.
  3632. * This macro is used to define both htt_wdi_ipa_config32_t and
  3633. * htt_wdi_ipa_config64_t structs.
  3634. */
  3635. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  3636. _paddr__tx_comp_ring_base_addr_, \
  3637. _paddr__tx_comp_wr_idx_addr_, \
  3638. _paddr__tx_ce_wr_idx_addr_, \
  3639. _paddr__rx_ind_ring_base_addr_, \
  3640. _paddr__rx_ind_rd_idx_addr_, \
  3641. _paddr__rx_ind_wr_idx_addr_, \
  3642. _paddr__rx_ring2_base_addr_,\
  3643. _paddr__rx_ring2_rd_idx_addr_,\
  3644. _paddr__rx_ring2_wr_idx_addr_) \
  3645. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  3646. { \
  3647. /* DWORD 0: flags and meta-data */ \
  3648. A_UINT32 \
  3649. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  3650. reserved: 8, \
  3651. tx_pkt_pool_size: 16;\
  3652. /* DWORD 1 */\
  3653. _paddr__tx_comp_ring_base_addr_;\
  3654. /* DWORD 2 (or 3)*/\
  3655. A_UINT32 tx_comp_ring_size;\
  3656. /* DWORD 3 (or 4)*/\
  3657. _paddr__tx_comp_wr_idx_addr_;\
  3658. /* DWORD 4 (or 6)*/\
  3659. _paddr__tx_ce_wr_idx_addr_;\
  3660. /* DWORD 5 (or 8)*/\
  3661. _paddr__rx_ind_ring_base_addr_;\
  3662. /* DWORD 6 (or 10)*/\
  3663. A_UINT32 rx_ind_ring_size;\
  3664. /* DWORD 7 (or 11)*/\
  3665. _paddr__rx_ind_rd_idx_addr_;\
  3666. /* DWORD 8 (or 13)*/\
  3667. _paddr__rx_ind_wr_idx_addr_;\
  3668. /* DWORD 9 (or 15)*/\
  3669. _paddr__rx_ring2_base_addr_;\
  3670. /* DWORD 10 (or 17) */\
  3671. A_UINT32 rx_ring2_size;\
  3672. /* DWORD 11 (or 18) */\
  3673. _paddr__rx_ring2_rd_idx_addr_;\
  3674. /* DWORD 12 (or 20) */\
  3675. _paddr__rx_ring2_wr_idx_addr_;\
  3676. } POSTPACK
  3677. /* define a htt_wdi_ipa_config32_t type */
  3678. 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));
  3679. /* define a htt_wdi_ipa_config64_t type */
  3680. 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));
  3681. #if HTT_PADDR64
  3682. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  3683. #else
  3684. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  3685. #endif
  3686. enum htt_wdi_ipa_op_code {
  3687. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  3688. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  3689. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  3690. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  3691. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  3692. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  3693. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  3694. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  3695. /* keep this last */
  3696. HTT_WDI_IPA_OPCODE_MAX
  3697. };
  3698. /**
  3699. * @brief HTT WDI_IPA Operation Request Message
  3700. *
  3701. * @details
  3702. * HTT WDI_IPA Operation Request message is sent by host
  3703. * to either suspend or resume WDI_IPA TX or RX path.
  3704. * |31 24|23 16|15 8|7 0|
  3705. * |----------------+----------------+----------------+----------------|
  3706. * | op_code | Rsvd | msg_type |
  3707. * |-------------------------------------------------------------------|
  3708. *
  3709. * Header fields:
  3710. * - MSG_TYPE
  3711. * Bits 7:0
  3712. * Purpose: Identifies this as WDI_IPA Operation Request message
  3713. * value: = 0x9
  3714. * - OP_CODE
  3715. * Bits 31:16
  3716. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  3717. * value: = enum htt_wdi_ipa_op_code
  3718. */
  3719. PREPACK struct htt_wdi_ipa_op_request_t
  3720. {
  3721. /* DWORD 0: flags and meta-data */
  3722. A_UINT32
  3723. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  3724. reserved: 8,
  3725. op_code: 16;
  3726. } POSTPACK;
  3727. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  3728. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  3729. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  3730. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  3731. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  3732. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  3733. do { \
  3734. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  3735. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  3736. } while (0)
  3737. /*
  3738. * @brief host -> target HTT_SRING_SETUP message
  3739. *
  3740. * @details
  3741. * After target is booted up, Host can send SRING setup message for
  3742. * each host facing LMAC SRING. Target setups up HW registers based
  3743. * on setup message and confirms back to Host if response_required is set.
  3744. * Host should wait for confirmation message before sending new SRING
  3745. * setup message
  3746. *
  3747. * The message would appear as follows:
  3748. * |31 24|23 20|19|18 16|15|14 8|7 0|
  3749. * |--------------- +-----------------+----------------+------------------|
  3750. * | ring_type | ring_id | pdev_id | msg_type |
  3751. * |----------------------------------------------------------------------|
  3752. * | ring_base_addr_lo |
  3753. * |----------------------------------------------------------------------|
  3754. * | ring_base_addr_hi |
  3755. * |----------------------------------------------------------------------|
  3756. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  3757. * |----------------------------------------------------------------------|
  3758. * | ring_head_offset32_remote_addr_lo |
  3759. * |----------------------------------------------------------------------|
  3760. * | ring_head_offset32_remote_addr_hi |
  3761. * |----------------------------------------------------------------------|
  3762. * | ring_tail_offset32_remote_addr_lo |
  3763. * |----------------------------------------------------------------------|
  3764. * | ring_tail_offset32_remote_addr_hi |
  3765. * |----------------------------------------------------------------------|
  3766. * | ring_msi_addr_lo |
  3767. * |----------------------------------------------------------------------|
  3768. * | ring_msi_addr_hi |
  3769. * |----------------------------------------------------------------------|
  3770. * | ring_msi_data |
  3771. * |----------------------------------------------------------------------|
  3772. * | intr_timer_th |IM| intr_batch_counter_th |
  3773. * |----------------------------------------------------------------------|
  3774. * | reserved |RR|PTCF| intr_low_threshold |
  3775. * |----------------------------------------------------------------------|
  3776. * Where
  3777. * IM = sw_intr_mode
  3778. * RR = response_required
  3779. * PTCF = prefetch_timer_cfg
  3780. *
  3781. * The message is interpreted as follows:
  3782. * dword0 - b'0:7 - msg_type: This will be set to
  3783. * HTT_H2T_MSG_TYPE_SRING_SETUP
  3784. * b'8:15 - pdev_id:
  3785. * 0 (for rings at SOC/UMAC level),
  3786. * 1/2/3 mac id (for rings at LMAC level)
  3787. * b'16:23 - ring_id: identify which ring is to setup,
  3788. * more details can be got from enum htt_srng_ring_id
  3789. * b'24:31 - ring_type: identify type of host rings,
  3790. * more details can be got from enum htt_srng_ring_type
  3791. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  3792. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  3793. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  3794. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  3795. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  3796. * SW_TO_HW_RING.
  3797. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  3798. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  3799. * Lower 32 bits of memory address of the remote variable
  3800. * storing the 4-byte word offset that identifies the head
  3801. * element within the ring.
  3802. * (The head offset variable has type A_UINT32.)
  3803. * Valid for HW_TO_SW and SW_TO_SW rings.
  3804. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  3805. * Upper 32 bits of memory address of the remote variable
  3806. * storing the 4-byte word offset that identifies the head
  3807. * element within the ring.
  3808. * (The head offset variable has type A_UINT32.)
  3809. * Valid for HW_TO_SW and SW_TO_SW rings.
  3810. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  3811. * Lower 32 bits of memory address of the remote variable
  3812. * storing the 4-byte word offset that identifies the tail
  3813. * element within the ring.
  3814. * (The tail offset variable has type A_UINT32.)
  3815. * Valid for HW_TO_SW and SW_TO_SW rings.
  3816. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  3817. * Upper 32 bits of memory address of the remote variable
  3818. * storing the 4-byte word offset that identifies the tail
  3819. * element within the ring.
  3820. * (The tail offset variable has type A_UINT32.)
  3821. * Valid for HW_TO_SW and SW_TO_SW rings.
  3822. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  3823. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3824. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  3825. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3826. * dword10 - b'0:31 - ring_msi_data: MSI data
  3827. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  3828. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3829. * dword11 - b'0:14 - intr_batch_counter_th:
  3830. * batch counter threshold is in units of 4-byte words.
  3831. * HW internally maintains and increments batch count.
  3832. * (see SRING spec for detail description).
  3833. * When batch count reaches threshold value, an interrupt
  3834. * is generated by HW.
  3835. * b'15 - sw_intr_mode:
  3836. * This configuration shall be static.
  3837. * Only programmed at power up.
  3838. * 0: generate pulse style sw interrupts
  3839. * 1: generate level style sw interrupts
  3840. * b'16:31 - intr_timer_th:
  3841. * The timer init value when timer is idle or is
  3842. * initialized to start downcounting.
  3843. * In 8us units (to cover a range of 0 to 524 ms)
  3844. * dword12 - b'0:15 - intr_low_threshold:
  3845. * Used only by Consumer ring to generate ring_sw_int_p.
  3846. * Ring entries low threshold water mark, that is used
  3847. * in combination with the interrupt timer as well as
  3848. * the the clearing of the level interrupt.
  3849. * b'16:18 - prefetch_timer_cfg:
  3850. * Used only by Consumer ring to set timer mode to
  3851. * support Application prefetch handling.
  3852. * The external tail offset/pointer will be updated
  3853. * at following intervals:
  3854. * 3'b000: (Prefetch feature disabled; used only for debug)
  3855. * 3'b001: 1 usec
  3856. * 3'b010: 4 usec
  3857. * 3'b011: 8 usec (default)
  3858. * 3'b100: 16 usec
  3859. * Others: Reserverd
  3860. * b'19 - response_required:
  3861. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  3862. * b'20:31 - reserved: reserved for future use
  3863. */
  3864. PREPACK struct htt_sring_setup_t {
  3865. A_UINT32 msg_type: 8,
  3866. pdev_id: 8,
  3867. ring_id: 8,
  3868. ring_type: 8;
  3869. A_UINT32 ring_base_addr_lo;
  3870. A_UINT32 ring_base_addr_hi;
  3871. A_UINT32 ring_size: 16,
  3872. ring_entry_size: 8,
  3873. ring_misc_cfg_flag: 8;
  3874. A_UINT32 ring_head_offset32_remote_addr_lo;
  3875. A_UINT32 ring_head_offset32_remote_addr_hi;
  3876. A_UINT32 ring_tail_offset32_remote_addr_lo;
  3877. A_UINT32 ring_tail_offset32_remote_addr_hi;
  3878. A_UINT32 ring_msi_addr_lo;
  3879. A_UINT32 ring_msi_addr_hi;
  3880. A_UINT32 ring_msi_data;
  3881. A_UINT32 intr_batch_counter_th: 15,
  3882. sw_intr_mode: 1,
  3883. intr_timer_th: 16;
  3884. A_UINT32 intr_low_threshold: 16,
  3885. prefetch_timer_cfg: 3,
  3886. response_required: 1,
  3887. reserved1: 12;
  3888. } POSTPACK;
  3889. enum htt_srng_ring_type {
  3890. HTT_HW_TO_SW_RING = 0,
  3891. HTT_SW_TO_HW_RING,
  3892. HTT_SW_TO_SW_RING,
  3893. /* Insert new ring types above this line */
  3894. };
  3895. enum htt_srng_ring_id {
  3896. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  3897. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  3898. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  3899. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  3900. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  3901. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  3902. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  3903. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  3904. /* Add Other SRING which can't be directly configured by host software above this line */
  3905. };
  3906. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  3907. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  3908. #define HTT_SRING_SETUP_PDEV_ID_S 8
  3909. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  3910. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  3911. HTT_SRING_SETUP_PDEV_ID_S)
  3912. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  3913. do { \
  3914. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  3915. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  3916. } while (0)
  3917. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  3918. #define HTT_SRING_SETUP_RING_ID_S 16
  3919. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  3920. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  3921. HTT_SRING_SETUP_RING_ID_S)
  3922. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  3923. do { \
  3924. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  3925. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  3926. } while (0)
  3927. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  3928. #define HTT_SRING_SETUP_RING_TYPE_S 24
  3929. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  3930. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  3931. HTT_SRING_SETUP_RING_TYPE_S)
  3932. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  3933. do { \
  3934. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  3935. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  3936. } while (0)
  3937. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  3938. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  3939. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  3940. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  3941. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  3942. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3943. do { \
  3944. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  3945. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  3946. } while (0)
  3947. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  3948. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  3949. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  3950. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  3951. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  3952. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3953. do { \
  3954. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  3955. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  3956. } while (0)
  3957. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  3958. #define HTT_SRING_SETUP_RING_SIZE_S 0
  3959. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  3960. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  3961. HTT_SRING_SETUP_RING_SIZE_S)
  3962. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  3963. do { \
  3964. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  3965. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  3966. } while (0)
  3967. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  3968. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  3969. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  3970. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  3971. HTT_SRING_SETUP_ENTRY_SIZE_S)
  3972. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  3973. do { \
  3974. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  3975. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  3976. } while (0)
  3977. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  3978. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  3979. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  3980. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  3981. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  3982. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  3983. do { \
  3984. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  3985. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  3986. } while (0)
  3987. /* This control bit is applicable to only Producer, which updates Ring ID field
  3988. * of each descriptor before pushing into the ring.
  3989. * 0: updates ring_id(default)
  3990. * 1: ring_id updating disabled */
  3991. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  3992. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  3993. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  3994. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  3995. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  3996. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  3997. do { \
  3998. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  3999. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4000. } while (0)
  4001. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4002. * of each descriptor before pushing into the ring.
  4003. * 0: updates Loopcnt(default)
  4004. * 1: Loopcnt updating disabled */
  4005. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4006. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4007. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4008. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4009. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4010. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4011. do { \
  4012. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4013. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4014. } while (0)
  4015. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4016. * into security_id port of GXI/AXI. */
  4017. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4018. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4019. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4020. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4021. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4022. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4023. do { \
  4024. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4025. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4026. } while (0)
  4027. /* During MSI write operation, SRNG drives value of this register bit into
  4028. * swap bit of GXI/AXI. */
  4029. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4030. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4031. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4032. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4033. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4034. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4035. do { \
  4036. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4037. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4038. } while (0)
  4039. /* During Pointer write operation, SRNG drives value of this register bit into
  4040. * swap bit of GXI/AXI. */
  4041. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4042. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4043. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4044. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4045. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4046. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4047. do { \
  4048. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4049. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4050. } while (0)
  4051. /* During any data or TLV write operation, SRNG drives value of this register
  4052. * bit into swap bit of GXI/AXI. */
  4053. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4054. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4055. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4056. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4057. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4058. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4059. do { \
  4060. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4061. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4062. } while (0)
  4063. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4064. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4065. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4066. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4067. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4068. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4069. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4070. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4071. do { \
  4072. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4073. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4074. } while (0)
  4075. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4076. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4077. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4078. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4079. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4080. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4081. do { \
  4082. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4083. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4084. } while (0)
  4085. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4086. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4087. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4088. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4089. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4090. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4091. do { \
  4092. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4093. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4094. } while (0)
  4095. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4096. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4097. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4098. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4099. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4100. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4101. do { \
  4102. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4103. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4104. } while (0)
  4105. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4106. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4107. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4108. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4109. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4110. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4111. do { \
  4112. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4113. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4114. } while (0)
  4115. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4116. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4117. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4118. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4119. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4120. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4121. do { \
  4122. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4123. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4124. } while (0)
  4125. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4126. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4127. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4128. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4129. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4130. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4131. do { \
  4132. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4133. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4134. } while (0)
  4135. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4136. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4137. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4138. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4139. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4140. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4141. do { \
  4142. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4143. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4144. } while (0)
  4145. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4146. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4147. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4148. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4149. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4150. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4151. do { \
  4152. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4153. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4154. } while (0)
  4155. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4156. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4157. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4158. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4159. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4160. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4161. do { \
  4162. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4163. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4164. } while (0)
  4165. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4166. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4167. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4168. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4169. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4170. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4171. do { \
  4172. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4173. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4174. } while (0)
  4175. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4176. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4177. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4178. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4179. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4180. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4181. do { \
  4182. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4183. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4184. } while (0)
  4185. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4186. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4187. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4188. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4189. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4190. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4191. do { \
  4192. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4193. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4194. } while (0)
  4195. /**
  4196. * @brief HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG Message
  4197. *
  4198. * @details
  4199. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4200. * configure RXDMA rings.
  4201. * The configuration is per ring based and includes both packet subtypes
  4202. * and PPDU/MPDU TLVs.
  4203. *
  4204. * The message would appear as follows:
  4205. *
  4206. * |31 26|25|24|23 16|15 8|7 0|
  4207. * |-----------------+----------------+----------------+---------------|
  4208. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  4209. * |-------------------------------------------------------------------|
  4210. * | rsvd2 | ring_buffer_size |
  4211. * |-------------------------------------------------------------------|
  4212. * | packet_type_enable_flags_0 |
  4213. * |-------------------------------------------------------------------|
  4214. * | packet_type_enable_flags_1 |
  4215. * |-------------------------------------------------------------------|
  4216. * | packet_type_enable_flags_2 |
  4217. * |-------------------------------------------------------------------|
  4218. * | packet_type_enable_flags_3 |
  4219. * |-------------------------------------------------------------------|
  4220. * | tlv_filter_in_flags |
  4221. * |-------------------------------------------------------------------|
  4222. * Where:
  4223. * PS = pkt_swap
  4224. * SS = status_swap
  4225. * The message is interpreted as follows:
  4226. * dword0 - b'0:7 - msg_type: This will be set to
  4227. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4228. * b'8:15 - pdev_id:
  4229. * 0 (for rings at SOC/UMAC level),
  4230. * 1/2/3 mac id (for rings at LMAC level)
  4231. * b'16:23 - ring_id : Identify the ring to configure.
  4232. * More details can be got from enum htt_srng_ring_id
  4233. * b'24 - status_swap: 1 is to swap status TLV
  4234. * b'25 - pkt_swap: 1 is to swap packet TLV
  4235. * b'26:31 - rsvd1: reserved for future use
  4236. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4237. * in byte units.
  4238. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4239. * - b'16:31 - rsvd2: Reserved for future use
  4240. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4241. * Enable MGMT packet from 0b0000 to 0b1001
  4242. * bits from low to high: FP, MD, MO - 3 bits
  4243. * FP: Filter_Pass
  4244. * MD: Monitor_Direct
  4245. * MO: Monitor_Other
  4246. * 10 mgmt subtypes * 3 bits -> 30 bits
  4247. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4248. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4249. * Enable MGMT packet from 0b1010 to 0b1111
  4250. * bits from low to high: FP, MD, MO - 3 bits
  4251. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4252. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4253. * Enable CTRL packet from 0b0000 to 0b1001
  4254. * bits from low to high: FP, MD, MO - 3 bits
  4255. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4256. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4257. * Enable CTRL packet from 0b1010 to 0b1111,
  4258. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4259. * bits from low to high: FP, MD, MO - 3 bits
  4260. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4261. * dword6 - b'0:31 - tlv_filter_in_flags:
  4262. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4263. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4264. */
  4265. PREPACK struct htt_rx_ring_selection_cfg_t {
  4266. A_UINT32 msg_type: 8,
  4267. pdev_id: 8,
  4268. ring_id: 8,
  4269. status_swap: 1,
  4270. pkt_swap: 1,
  4271. rsvd1: 6;
  4272. A_UINT32 ring_buffer_size: 16,
  4273. rsvd2: 16;
  4274. A_UINT32 packet_type_enable_flags_0;
  4275. A_UINT32 packet_type_enable_flags_1;
  4276. A_UINT32 packet_type_enable_flags_2;
  4277. A_UINT32 packet_type_enable_flags_3;
  4278. A_UINT32 tlv_filter_in_flags;
  4279. } POSTPACK;
  4280. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4281. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4282. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4283. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4284. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4285. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4286. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4287. do { \
  4288. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4289. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4290. } while (0)
  4291. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4292. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4293. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4294. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4295. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4296. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4297. do { \
  4298. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4299. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4300. } while (0)
  4301. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4302. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4303. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4304. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4305. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4306. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4307. do { \
  4308. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  4309. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4310. } while (0)
  4311. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4312. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4313. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4314. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4315. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4316. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4317. do { \
  4318. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  4319. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4320. } while (0)
  4321. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4322. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4323. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4324. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4325. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4326. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4327. do { \
  4328. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  4329. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4330. } while (0)
  4331. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4332. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4333. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4334. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4335. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4336. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4337. do { \
  4338. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  4339. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4340. } while (0)
  4341. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4342. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4343. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4344. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4345. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4346. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4347. do { \
  4348. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  4349. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4350. } while (0)
  4351. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4352. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4353. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4354. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4355. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4356. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4357. do { \
  4358. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  4359. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4360. } while (0)
  4361. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4362. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4363. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4364. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4365. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4366. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4367. do { \
  4368. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  4369. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4370. } while (0)
  4371. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4372. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4373. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4374. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4375. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4376. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4377. do { \
  4378. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4379. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4380. } while (0)
  4381. /*
  4382. * Subtype based MGMT frames enable bits.
  4383. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4384. */
  4385. /* association request */
  4386. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  4387. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4388. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  4389. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4390. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  4391. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4392. /* association response */
  4393. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  4394. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4395. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  4396. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4397. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  4398. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4399. /* Reassociation request */
  4400. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  4401. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  4402. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  4403. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  4404. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  4405. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  4406. /* Reassociation response */
  4407. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  4408. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  4409. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  4410. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  4411. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  4412. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  4413. /* Probe request */
  4414. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  4415. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  4416. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  4417. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  4418. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  4419. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  4420. /* Probe response */
  4421. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  4422. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  4423. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  4424. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  4425. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  4426. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  4427. /* Timing Advertisement */
  4428. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  4429. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  4430. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  4431. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  4432. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  4433. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  4434. /* Reserved */
  4435. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  4436. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  4437. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  4438. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  4439. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  4440. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  4441. /* Beacon */
  4442. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000001
  4443. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  4444. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000001
  4445. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  4446. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x00000001
  4447. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  4448. /* ATIM */
  4449. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x00000001
  4450. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  4451. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x00000001
  4452. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  4453. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x00000001
  4454. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  4455. /* Disassociation */
  4456. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  4457. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  4458. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  4459. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  4460. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  4461. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  4462. /* Authentication */
  4463. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  4464. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  4465. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  4466. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  4467. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  4468. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  4469. /* Deauthentication */
  4470. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  4471. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  4472. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  4473. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  4474. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  4475. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  4476. /* Action */
  4477. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  4478. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  4479. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  4480. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  4481. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  4482. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  4483. /* Action No Ack */
  4484. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  4485. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  4486. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  4487. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  4488. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  4489. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  4490. /* Reserved */
  4491. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  4492. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  4493. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  4494. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  4495. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  4496. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  4497. /*
  4498. * Subtype based CTRL frames enable bits.
  4499. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  4500. */
  4501. /* Reserved */
  4502. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  4503. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  4504. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  4505. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  4506. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  4507. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  4508. /* Reserved */
  4509. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  4510. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  4511. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  4512. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  4513. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  4514. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  4515. /* Reserved */
  4516. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  4517. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  4518. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  4519. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  4520. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  4521. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  4522. /* Reserved */
  4523. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  4524. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  4525. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  4526. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  4527. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  4528. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  4529. /* Reserved */
  4530. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  4531. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  4532. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  4533. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  4534. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  4535. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  4536. /* Reserved */
  4537. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  4538. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  4539. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  4540. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  4541. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  4542. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  4543. /* Reserved */
  4544. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  4545. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  4546. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  4547. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  4548. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  4549. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  4550. /* Control Wrapper */
  4551. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  4552. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  4553. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  4554. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  4555. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  4556. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  4557. /* Block Ack Request */
  4558. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000001
  4559. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  4560. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000001
  4561. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  4562. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x00000001
  4563. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  4564. /* Block Ack*/
  4565. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x00000001
  4566. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  4567. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x00000001
  4568. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  4569. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x00000001
  4570. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  4571. /* PS-POLL */
  4572. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  4573. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  4574. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  4575. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  4576. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  4577. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  4578. /* RTS */
  4579. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  4580. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  4581. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  4582. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  4583. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  4584. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  4585. /* CTS */
  4586. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  4587. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  4588. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  4589. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  4590. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  4591. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  4592. /* ACK */
  4593. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  4594. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  4595. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  4596. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  4597. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  4598. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  4599. /* CF-END */
  4600. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  4601. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  4602. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  4603. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  4604. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  4605. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  4606. /* CF-END + CF-ACK */
  4607. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  4608. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  4609. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  4610. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  4611. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  4612. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  4613. /* Multicast data */
  4614. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  4615. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  4616. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  4617. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  4618. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  4619. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  4620. /* Unicast data */
  4621. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  4622. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  4623. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  4624. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  4625. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  4626. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  4627. /* NULL data */
  4628. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  4629. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  4630. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  4631. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  4632. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  4633. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  4634. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  4635. do { \
  4636. HTT_CHECK_SET_VAL(httsym, value); \
  4637. (word) |= (value) << httsym##_S; \
  4638. } while (0)
  4639. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  4640. (((word) & httsym##_M) >> httsym##_S)
  4641. #define htt_rx_ring_pkt_enable_subtype_set( \
  4642. word, flag, mode, type, subtype, val) \
  4643. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  4644. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  4645. #define htt_rx_ring_pkt_enable_subtype_get( \
  4646. word, flag, mode, type, subtype) \
  4647. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  4648. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  4649. /* Definition to filter in TLVs */
  4650. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  4651. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  4652. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  4653. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  4654. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  4655. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  4656. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  4657. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  4658. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  4659. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  4660. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  4661. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  4662. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  4663. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  4664. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  4665. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  4666. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  4667. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  4668. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  4669. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  4670. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  4671. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  4672. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  4673. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  4674. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  4675. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  4676. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  4677. do { \
  4678. HTT_CHECK_SET_VAL(httsym, enable); \
  4679. (word) |= (enable) << httsym##_S; \
  4680. } while (0)
  4681. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  4682. (((word) & httsym##_M) >> httsym##_S)
  4683. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  4684. HTT_RX_RING_TLV_ENABLE_SET( \
  4685. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  4686. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  4687. HTT_RX_RING_TLV_ENABLE_GET( \
  4688. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  4689. /**
  4690. * @brief HTT_H2T_MSG_TYPE_RFS_CONFIG
  4691. * host --> target Receive Flow Steering configuration message definition.
  4692. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  4693. * The reason for this is we want RFS to be configured and ready before MAC
  4694. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  4695. *
  4696. * |31 24|23 16|15 9|8|7 0|
  4697. * |----------------+----------------+----------------+----------------|
  4698. * | reserved |E| msg type |
  4699. * |-------------------------------------------------------------------|
  4700. * Where E = RFS enable flag
  4701. *
  4702. * The RFS_CONFIG message consists of a single 4-byte word.
  4703. *
  4704. * Header fields:
  4705. * - MSG_TYPE
  4706. * Bits 7:0
  4707. * Purpose: identifies this as a RFS config msg
  4708. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  4709. * - RFS_CONFIG
  4710. * Bit 8
  4711. * Purpose: Tells target whether to enable (1) or disable (0)
  4712. * flow steering feature when sending rx indication messages to host
  4713. */
  4714. #define HTT_H2T_RFS_CONFIG_M 0x100
  4715. #define HTT_H2T_RFS_CONFIG_S 8
  4716. #define HTT_RX_RFS_CONFIG_GET(_var) \
  4717. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  4718. HTT_H2T_RFS_CONFIG_S)
  4719. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  4720. do { \
  4721. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  4722. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  4723. } while (0)
  4724. #define HTT_RFS_CFG_REQ_BYTES 4
  4725. /**
  4726. * @brief host -> target FW extended statistics retrieve
  4727. *
  4728. * @details
  4729. * The following field definitions describe the format of the HTT host
  4730. * to target FW extended stats retrieve message.
  4731. * The message specifies the type of stats the host wants to retrieve.
  4732. *
  4733. * |31 24|23 16|15 8|7 0|
  4734. * |-----------------------------------------------------------|
  4735. * | reserved | stats type | pdev_mask | msg type |
  4736. * |-----------------------------------------------------------|
  4737. * | config param [0] |
  4738. * |-----------------------------------------------------------|
  4739. * | config param [1] |
  4740. * |-----------------------------------------------------------|
  4741. * | config param [2] |
  4742. * |-----------------------------------------------------------|
  4743. * | config param [3] |
  4744. * |-----------------------------------------------------------|
  4745. * | reserved |
  4746. * |-----------------------------------------------------------|
  4747. * | cookie LSBs |
  4748. * |-----------------------------------------------------------|
  4749. * | cookie MSBs |
  4750. * |-----------------------------------------------------------|
  4751. * Header fields:
  4752. * - MSG_TYPE
  4753. * Bits 7:0
  4754. * Purpose: identifies this is a extended stats upload request message
  4755. * Value: 0x10
  4756. * - PDEV_MASK
  4757. * Bits 8:15
  4758. * Purpose: identifies the mask of PDEVs to retrieve stats from
  4759. * Value: This is a overloaded field, refer to usage and interpretation of
  4760. * PDEV in interface document.
  4761. * Bit 8 : Reserved for SOC stats
  4762. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  4763. * Indicates MACID_MASK in DBS
  4764. * - STATS_TYPE
  4765. * Bits 23:16
  4766. * Purpose: identifies which FW statistics to upload
  4767. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  4768. * - Reserved
  4769. * Bits 31:24
  4770. * - CONFIG_PARAM [0]
  4771. * Bits 31:0
  4772. * Purpose: give an opaque configuration value to the specified stats type
  4773. * Value: stats-type specific configuration value
  4774. * Refer to htt_stats.h for interpretation for each stats sub_type
  4775. * - CONFIG_PARAM [1]
  4776. * Bits 31:0
  4777. * Purpose: give an opaque configuration value to the specified stats type
  4778. * Value: stats-type specific configuration value
  4779. * Refer to htt_stats.h for interpretation for each stats sub_type
  4780. * - CONFIG_PARAM [2]
  4781. * Bits 31:0
  4782. * Purpose: give an opaque configuration value to the specified stats type
  4783. * Value: stats-type specific configuration value
  4784. * Refer to htt_stats.h for interpretation for each stats sub_type
  4785. * - CONFIG_PARAM [3]
  4786. * Bits 31:0
  4787. * Purpose: give an opaque configuration value to the specified stats type
  4788. * Value: stats-type specific configuration value
  4789. * Refer to htt_stats.h for interpretation for each stats sub_type
  4790. * - Reserved [31:0] for future use.
  4791. * - COOKIE_LSBS
  4792. * Bits 31:0
  4793. * Purpose: Provide a mechanism to match a target->host stats confirmation
  4794. * message with its preceding host->target stats request message.
  4795. * Value: LSBs of the opaque cookie specified by the host-side requestor
  4796. * - COOKIE_MSBS
  4797. * Bits 31:0
  4798. * Purpose: Provide a mechanism to match a target->host stats confirmation
  4799. * message with its preceding host->target stats request message.
  4800. * Value: MSBs of the opaque cookie specified by the host-side requestor
  4801. */
  4802. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  4803. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  4804. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  4805. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  4806. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  4807. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  4808. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  4809. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  4810. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  4811. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  4812. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  4813. do { \
  4814. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  4815. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  4816. } while (0)
  4817. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  4818. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  4819. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  4820. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  4821. do { \
  4822. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  4823. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  4824. } while (0)
  4825. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  4826. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  4827. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  4828. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  4829. do { \
  4830. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  4831. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  4832. } while (0)
  4833. /**
  4834. * @brief host -> target FW PPDU_STATS request message
  4835. *
  4836. * @details
  4837. * The following field definitions describe the format of the HTT host
  4838. * to target FW for PPDU_STATS_CFG msg.
  4839. * The message allows the host to configure the PPDU_STATS_IND messages
  4840. * produced by the target.
  4841. *
  4842. * |31 24|23 16|15 8|7 0|
  4843. * |-----------------------------------------------------------|
  4844. * | REQ bit mask | pdev_mask | msg type |
  4845. * |-----------------------------------------------------------|
  4846. * Header fields:
  4847. * - MSG_TYPE
  4848. * Bits 7:0
  4849. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  4850. * Value: 0x11
  4851. * - PDEV_MASK
  4852. * Bits 8:15
  4853. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  4854. * Value: This is a overloaded field, refer to usage and interpretation of
  4855. * PDEV in interface document.
  4856. * Bit 8 : Reserved for SOC stats
  4857. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  4858. * Indicates MACID_MASK in DBS
  4859. * - REQ_TLV_BIT_MASK
  4860. * Bits 16:31
  4861. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  4862. * needs to be included in the target's PPDU_STATS_IND messages.
  4863. * Value: refer htt_ppdu_stats_tlv_tag_t
  4864. *
  4865. */
  4866. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  4867. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  4868. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  4869. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  4870. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  4871. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  4872. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  4873. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  4874. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  4875. do { \
  4876. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  4877. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  4878. } while (0)
  4879. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  4880. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  4881. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  4882. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  4883. do { \
  4884. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  4885. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  4886. } while (0)
  4887. /*=== target -> host messages ===============================================*/
  4888. enum htt_t2h_msg_type {
  4889. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  4890. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  4891. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  4892. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  4893. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  4894. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  4895. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  4896. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  4897. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  4898. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  4899. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  4900. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  4901. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  4902. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  4903. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  4904. /* only used for HL, add HTT MSG for HTT CREDIT update */
  4905. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  4906. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  4907. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  4908. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  4909. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  4910. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  4911. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  4912. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  4913. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  4914. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  4915. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  4916. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  4917. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  4918. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  4919. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  4920. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  4921. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  4922. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  4923. HTT_T2H_MSG_TYPE_TEST,
  4924. /* keep this last */
  4925. HTT_T2H_NUM_MSGS
  4926. };
  4927. /*
  4928. * HTT target to host message type -
  4929. * stored in bits 7:0 of the first word of the message
  4930. */
  4931. #define HTT_T2H_MSG_TYPE_M 0xff
  4932. #define HTT_T2H_MSG_TYPE_S 0
  4933. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  4934. do { \
  4935. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  4936. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  4937. } while (0)
  4938. #define HTT_T2H_MSG_TYPE_GET(word) \
  4939. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  4940. /**
  4941. * @brief target -> host version number confirmation message definition
  4942. *
  4943. * |31 24|23 16|15 8|7 0|
  4944. * |----------------+----------------+----------------+----------------|
  4945. * | reserved | major number | minor number | msg type |
  4946. * |-------------------------------------------------------------------|
  4947. * : option request TLV (optional) |
  4948. * :...................................................................:
  4949. *
  4950. * The VER_CONF message may consist of a single 4-byte word, or may be
  4951. * extended with TLVs that specify HTT options selected by the target.
  4952. * The following option TLVs may be appended to the VER_CONF message:
  4953. * - LL_BUS_ADDR_SIZE
  4954. * - HL_SUPPRESS_TX_COMPL_IND
  4955. * - MAX_TX_QUEUE_GROUPS
  4956. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  4957. * may be appended to the VER_CONF message (but only one TLV of each type).
  4958. *
  4959. * Header fields:
  4960. * - MSG_TYPE
  4961. * Bits 7:0
  4962. * Purpose: identifies this as a version number confirmation message
  4963. * Value: 0x0
  4964. * - VER_MINOR
  4965. * Bits 15:8
  4966. * Purpose: Specify the minor number of the HTT message library version
  4967. * in use by the target firmware.
  4968. * The minor number specifies the specific revision within a range
  4969. * of fundamentally compatible HTT message definition revisions.
  4970. * Compatible revisions involve adding new messages or perhaps
  4971. * adding new fields to existing messages, in a backwards-compatible
  4972. * manner.
  4973. * Incompatible revisions involve changing the message type values,
  4974. * or redefining existing messages.
  4975. * Value: minor number
  4976. * - VER_MAJOR
  4977. * Bits 15:8
  4978. * Purpose: Specify the major number of the HTT message library version
  4979. * in use by the target firmware.
  4980. * The major number specifies the family of minor revisions that are
  4981. * fundamentally compatible with each other, but not with prior or
  4982. * later families.
  4983. * Value: major number
  4984. */
  4985. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  4986. #define HTT_VER_CONF_MINOR_S 8
  4987. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  4988. #define HTT_VER_CONF_MAJOR_S 16
  4989. #define HTT_VER_CONF_MINOR_SET(word, value) \
  4990. do { \
  4991. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  4992. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  4993. } while (0)
  4994. #define HTT_VER_CONF_MINOR_GET(word) \
  4995. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  4996. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  4997. do { \
  4998. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  4999. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  5000. } while (0)
  5001. #define HTT_VER_CONF_MAJOR_GET(word) \
  5002. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  5003. #define HTT_VER_CONF_BYTES 4
  5004. /**
  5005. * @brief - target -> host HTT Rx In order indication message
  5006. *
  5007. * @details
  5008. *
  5009. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  5010. * |----------------+-------------------+---------------------+---------------|
  5011. * | peer ID | P| F| O| ext TID | msg type |
  5012. * |--------------------------------------------------------------------------|
  5013. * | MSDU count | Reserved | vdev id |
  5014. * |--------------------------------------------------------------------------|
  5015. * | MSDU 0 bus address (bits 31:0) |
  5016. #if HTT_PADDR64
  5017. * | MSDU 0 bus address (bits 63:32) |
  5018. #endif
  5019. * |--------------------------------------------------------------------------|
  5020. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  5021. * |--------------------------------------------------------------------------|
  5022. * | MSDU 1 bus address (bits 31:0) |
  5023. #if HTT_PADDR64
  5024. * | MSDU 1 bus address (bits 63:32) |
  5025. #endif
  5026. * |--------------------------------------------------------------------------|
  5027. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  5028. * |--------------------------------------------------------------------------|
  5029. */
  5030. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  5031. *
  5032. * @details
  5033. * bits
  5034. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  5035. * |-----+----+-------+--------+--------+---------+---------+-----------|
  5036. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  5037. * | | frag | | | | fail |chksum fail|
  5038. * |-----+----+-------+--------+--------+---------+---------+-----------|
  5039. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  5040. */
  5041. struct htt_rx_in_ord_paddr_ind_hdr_t
  5042. {
  5043. A_UINT32 /* word 0 */
  5044. msg_type: 8,
  5045. ext_tid: 5,
  5046. offload: 1,
  5047. frag: 1,
  5048. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  5049. peer_id: 16;
  5050. A_UINT32 /* word 1 */
  5051. vap_id: 8,
  5052. reserved_1: 8,
  5053. msdu_cnt: 16;
  5054. };
  5055. struct htt_rx_in_ord_paddr_ind_msdu32_t
  5056. {
  5057. A_UINT32 dma_addr;
  5058. A_UINT32
  5059. length: 16,
  5060. fw_desc: 8,
  5061. msdu_info:8;
  5062. };
  5063. struct htt_rx_in_ord_paddr_ind_msdu64_t
  5064. {
  5065. A_UINT32 dma_addr_lo;
  5066. A_UINT32 dma_addr_hi;
  5067. A_UINT32
  5068. length: 16,
  5069. fw_desc: 8,
  5070. msdu_info:8;
  5071. };
  5072. #if HTT_PADDR64
  5073. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  5074. #else
  5075. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  5076. #endif
  5077. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  5078. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  5079. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  5080. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  5081. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  5082. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  5083. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  5084. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  5085. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  5086. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  5087. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  5088. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  5089. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  5090. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  5091. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  5092. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  5093. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  5094. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  5095. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  5096. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  5097. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  5098. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  5099. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  5100. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  5101. /* for systems using 64-bit format for bus addresses */
  5102. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  5103. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  5104. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  5105. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  5106. /* for systems using 32-bit format for bus addresses */
  5107. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  5108. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  5109. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  5110. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  5111. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  5112. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  5113. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  5114. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  5115. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  5116. do { \
  5117. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  5118. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  5119. } while (0)
  5120. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  5121. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  5122. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  5123. do { \
  5124. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  5125. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  5126. } while (0)
  5127. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  5128. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  5129. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  5130. do { \
  5131. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  5132. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  5133. } while (0)
  5134. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  5135. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  5136. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  5137. do { \
  5138. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  5139. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  5140. } while (0)
  5141. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  5142. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  5143. /* for systems using 64-bit format for bus addresses */
  5144. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  5145. do { \
  5146. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  5147. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  5148. } while (0)
  5149. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  5150. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  5151. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  5152. do { \
  5153. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  5154. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  5155. } while (0)
  5156. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  5157. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  5158. /* for systems using 32-bit format for bus addresses */
  5159. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  5160. do { \
  5161. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  5162. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  5163. } while (0)
  5164. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  5165. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  5166. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  5167. do { \
  5168. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  5169. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  5170. } while (0)
  5171. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  5172. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  5173. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  5174. do { \
  5175. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  5176. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  5177. } while (0)
  5178. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  5179. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  5180. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  5181. do { \
  5182. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  5183. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  5184. } while (0)
  5185. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  5186. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  5187. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  5188. do { \
  5189. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  5190. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  5191. } while (0)
  5192. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  5193. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  5194. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  5195. do { \
  5196. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  5197. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  5198. } while (0)
  5199. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  5200. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  5201. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  5202. do { \
  5203. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  5204. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  5205. } while (0)
  5206. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  5207. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  5208. /* definitions used within target -> host rx indication message */
  5209. PREPACK struct htt_rx_ind_hdr_prefix_t
  5210. {
  5211. A_UINT32 /* word 0 */
  5212. msg_type: 8,
  5213. ext_tid: 5,
  5214. release_valid: 1,
  5215. flush_valid: 1,
  5216. reserved0: 1,
  5217. peer_id: 16;
  5218. A_UINT32 /* word 1 */
  5219. flush_start_seq_num: 6,
  5220. flush_end_seq_num: 6,
  5221. release_start_seq_num: 6,
  5222. release_end_seq_num: 6,
  5223. num_mpdu_ranges: 8;
  5224. } POSTPACK;
  5225. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  5226. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  5227. #define HTT_TGT_RSSI_INVALID 0x80
  5228. PREPACK struct htt_rx_ppdu_desc_t
  5229. {
  5230. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  5231. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  5232. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  5233. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  5234. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  5235. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  5236. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  5237. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  5238. A_UINT32 /* word 0 */
  5239. rssi_cmb: 8,
  5240. timestamp_submicrosec: 8,
  5241. phy_err_code: 8,
  5242. phy_err: 1,
  5243. legacy_rate: 4,
  5244. legacy_rate_sel: 1,
  5245. end_valid: 1,
  5246. start_valid: 1;
  5247. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  5248. union {
  5249. A_UINT32 /* word 1 */
  5250. rssi0_pri20: 8,
  5251. rssi0_ext20: 8,
  5252. rssi0_ext40: 8,
  5253. rssi0_ext80: 8;
  5254. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  5255. } u0;
  5256. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  5257. union {
  5258. A_UINT32 /* word 2 */
  5259. rssi1_pri20: 8,
  5260. rssi1_ext20: 8,
  5261. rssi1_ext40: 8,
  5262. rssi1_ext80: 8;
  5263. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  5264. } u1;
  5265. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  5266. union {
  5267. A_UINT32 /* word 3 */
  5268. rssi2_pri20: 8,
  5269. rssi2_ext20: 8,
  5270. rssi2_ext40: 8,
  5271. rssi2_ext80: 8;
  5272. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  5273. } u2;
  5274. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  5275. union {
  5276. A_UINT32 /* word 4 */
  5277. rssi3_pri20: 8,
  5278. rssi3_ext20: 8,
  5279. rssi3_ext40: 8,
  5280. rssi3_ext80: 8;
  5281. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  5282. } u3;
  5283. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  5284. A_UINT32 tsf32; /* word 5 */
  5285. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  5286. A_UINT32 timestamp_microsec; /* word 6 */
  5287. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  5288. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  5289. A_UINT32 /* word 7 */
  5290. vht_sig_a1: 24,
  5291. preamble_type: 8;
  5292. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  5293. A_UINT32 /* word 8 */
  5294. vht_sig_a2: 24,
  5295. reserved0: 8;
  5296. } POSTPACK;
  5297. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  5298. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  5299. PREPACK struct htt_rx_ind_hdr_suffix_t
  5300. {
  5301. A_UINT32 /* word 0 */
  5302. fw_rx_desc_bytes: 16,
  5303. reserved0: 16;
  5304. } POSTPACK;
  5305. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  5306. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  5307. PREPACK struct htt_rx_ind_hdr_t
  5308. {
  5309. struct htt_rx_ind_hdr_prefix_t prefix;
  5310. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  5311. struct htt_rx_ind_hdr_suffix_t suffix;
  5312. } POSTPACK;
  5313. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  5314. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  5315. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  5316. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  5317. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  5318. /*
  5319. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  5320. * the offset into the HTT rx indication message at which the
  5321. * FW rx PPDU descriptor resides
  5322. */
  5323. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  5324. /*
  5325. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  5326. * the offset into the HTT rx indication message at which the
  5327. * header suffix (FW rx MSDU byte count) resides
  5328. */
  5329. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  5330. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  5331. /*
  5332. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  5333. * the offset into the HTT rx indication message at which the per-MSDU
  5334. * information starts
  5335. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  5336. * per-MSDU information portion of the message. The per-MSDU info itself
  5337. * starts at byte 12.
  5338. */
  5339. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  5340. /**
  5341. * @brief target -> host rx indication message definition
  5342. *
  5343. * @details
  5344. * The following field definitions describe the format of the rx indication
  5345. * message sent from the target to the host.
  5346. * The message consists of three major sections:
  5347. * 1. a fixed-length header
  5348. * 2. a variable-length list of firmware rx MSDU descriptors
  5349. * 3. one or more 4-octet MPDU range information elements
  5350. * The fixed length header itself has two sub-sections
  5351. * 1. the message meta-information, including identification of the
  5352. * sender and type of the received data, and a 4-octet flush/release IE
  5353. * 2. the firmware rx PPDU descriptor
  5354. *
  5355. * The format of the message is depicted below.
  5356. * in this depiction, the following abbreviations are used for information
  5357. * elements within the message:
  5358. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  5359. * elements associated with the PPDU start are valid.
  5360. * Specifically, the following fields are valid only if SV is set:
  5361. * RSSI (all variants), L, legacy rate, preamble type, service,
  5362. * VHT-SIG-A
  5363. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  5364. * elements associated with the PPDU end are valid.
  5365. * Specifically, the following fields are valid only if EV is set:
  5366. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  5367. * - L - Legacy rate selector - if legacy rates are used, this flag
  5368. * indicates whether the rate is from a CCK (L == 1) or OFDM
  5369. * (L == 0) PHY.
  5370. * - P - PHY error flag - boolean indication of whether the rx frame had
  5371. * a PHY error
  5372. *
  5373. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  5374. * |----------------+-------------------+---------------------+---------------|
  5375. * | peer ID | |RV|FV| ext TID | msg type |
  5376. * |--------------------------------------------------------------------------|
  5377. * | num | release | release | flush | flush |
  5378. * | MPDU | end | start | end | start |
  5379. * | ranges | seq num | seq num | seq num | seq num |
  5380. * |==========================================================================|
  5381. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  5382. * |V|V| | rate | | | timestamp | RSSI |
  5383. * |--------------------------------------------------------------------------|
  5384. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  5385. * |--------------------------------------------------------------------------|
  5386. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  5387. * |--------------------------------------------------------------------------|
  5388. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  5389. * |--------------------------------------------------------------------------|
  5390. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  5391. * |--------------------------------------------------------------------------|
  5392. * | TSF LSBs |
  5393. * |--------------------------------------------------------------------------|
  5394. * | microsec timestamp |
  5395. * |--------------------------------------------------------------------------|
  5396. * | preamble type | HT-SIG / VHT-SIG-A1 |
  5397. * |--------------------------------------------------------------------------|
  5398. * | service | HT-SIG / VHT-SIG-A2 |
  5399. * |==========================================================================|
  5400. * | reserved | FW rx desc bytes |
  5401. * |--------------------------------------------------------------------------|
  5402. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  5403. * | desc B3 | desc B2 | desc B1 | desc B0 |
  5404. * |--------------------------------------------------------------------------|
  5405. * : : :
  5406. * |--------------------------------------------------------------------------|
  5407. * | alignment | MSDU Rx |
  5408. * | padding | desc Bn |
  5409. * |--------------------------------------------------------------------------|
  5410. * | reserved | MPDU range status | MPDU count |
  5411. * |--------------------------------------------------------------------------|
  5412. * : reserved : MPDU range status : MPDU count :
  5413. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  5414. *
  5415. * Header fields:
  5416. * - MSG_TYPE
  5417. * Bits 7:0
  5418. * Purpose: identifies this as an rx indication message
  5419. * Value: 0x1
  5420. * - EXT_TID
  5421. * Bits 12:8
  5422. * Purpose: identify the traffic ID of the rx data, including
  5423. * special "extended" TID values for multicast, broadcast, and
  5424. * non-QoS data frames
  5425. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  5426. * - FLUSH_VALID (FV)
  5427. * Bit 13
  5428. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  5429. * is valid
  5430. * Value:
  5431. * 1 -> flush IE is valid and needs to be processed
  5432. * 0 -> flush IE is not valid and should be ignored
  5433. * - REL_VALID (RV)
  5434. * Bit 13
  5435. * Purpose: indicate whether the release IE (start/end sequence numbers)
  5436. * is valid
  5437. * Value:
  5438. * 1 -> release IE is valid and needs to be processed
  5439. * 0 -> release IE is not valid and should be ignored
  5440. * - PEER_ID
  5441. * Bits 31:16
  5442. * Purpose: Identify, by ID, which peer sent the rx data
  5443. * Value: ID of the peer who sent the rx data
  5444. * - FLUSH_SEQ_NUM_START
  5445. * Bits 5:0
  5446. * Purpose: Indicate the start of a series of MPDUs to flush
  5447. * Not all MPDUs within this series are necessarily valid - the host
  5448. * must check each sequence number within this range to see if the
  5449. * corresponding MPDU is actually present.
  5450. * This field is only valid if the FV bit is set.
  5451. * Value:
  5452. * The sequence number for the first MPDUs to check to flush.
  5453. * The sequence number is masked by 0x3f.
  5454. * - FLUSH_SEQ_NUM_END
  5455. * Bits 11:6
  5456. * Purpose: Indicate the end of a series of MPDUs to flush
  5457. * Value:
  5458. * The sequence number one larger than the sequence number of the
  5459. * last MPDU to check to flush.
  5460. * The sequence number is masked by 0x3f.
  5461. * Not all MPDUs within this series are necessarily valid - the host
  5462. * must check each sequence number within this range to see if the
  5463. * corresponding MPDU is actually present.
  5464. * This field is only valid if the FV bit is set.
  5465. * - REL_SEQ_NUM_START
  5466. * Bits 17:12
  5467. * Purpose: Indicate the start of a series of MPDUs to release.
  5468. * All MPDUs within this series are present and valid - the host
  5469. * need not check each sequence number within this range to see if
  5470. * the corresponding MPDU is actually present.
  5471. * This field is only valid if the RV bit is set.
  5472. * Value:
  5473. * The sequence number for the first MPDUs to check to release.
  5474. * The sequence number is masked by 0x3f.
  5475. * - REL_SEQ_NUM_END
  5476. * Bits 23:18
  5477. * Purpose: Indicate the end of a series of MPDUs to release.
  5478. * Value:
  5479. * The sequence number one larger than the sequence number of the
  5480. * last MPDU to check to release.
  5481. * The sequence number is masked by 0x3f.
  5482. * All MPDUs within this series are present and valid - the host
  5483. * need not check each sequence number within this range to see if
  5484. * the corresponding MPDU is actually present.
  5485. * This field is only valid if the RV bit is set.
  5486. * - NUM_MPDU_RANGES
  5487. * Bits 31:24
  5488. * Purpose: Indicate how many ranges of MPDUs are present.
  5489. * Each MPDU range consists of a series of contiguous MPDUs within the
  5490. * rx frame sequence which all have the same MPDU status.
  5491. * Value: 1-63 (typically a small number, like 1-3)
  5492. *
  5493. * Rx PPDU descriptor fields:
  5494. * - RSSI_CMB
  5495. * Bits 7:0
  5496. * Purpose: Combined RSSI from all active rx chains, across the active
  5497. * bandwidth.
  5498. * Value: RSSI dB units w.r.t. noise floor
  5499. * - TIMESTAMP_SUBMICROSEC
  5500. * Bits 15:8
  5501. * Purpose: high-resolution timestamp
  5502. * Value:
  5503. * Sub-microsecond time of PPDU reception.
  5504. * This timestamp ranges from [0,MAC clock MHz).
  5505. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  5506. * to form a high-resolution, large range rx timestamp.
  5507. * - PHY_ERR_CODE
  5508. * Bits 23:16
  5509. * Purpose:
  5510. * If the rx frame processing resulted in a PHY error, indicate what
  5511. * type of rx PHY error occurred.
  5512. * Value:
  5513. * This field is valid if the "P" (PHY_ERR) flag is set.
  5514. * TBD: document/specify the values for this field
  5515. * - PHY_ERR
  5516. * Bit 24
  5517. * Purpose: indicate whether the rx PPDU had a PHY error
  5518. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  5519. * - LEGACY_RATE
  5520. * Bits 28:25
  5521. * Purpose:
  5522. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  5523. * specify which rate was used.
  5524. * Value:
  5525. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  5526. * flag.
  5527. * If LEGACY_RATE_SEL is 0:
  5528. * 0x8: OFDM 48 Mbps
  5529. * 0x9: OFDM 24 Mbps
  5530. * 0xA: OFDM 12 Mbps
  5531. * 0xB: OFDM 6 Mbps
  5532. * 0xC: OFDM 54 Mbps
  5533. * 0xD: OFDM 36 Mbps
  5534. * 0xE: OFDM 18 Mbps
  5535. * 0xF: OFDM 9 Mbps
  5536. * If LEGACY_RATE_SEL is 1:
  5537. * 0x8: CCK 11 Mbps long preamble
  5538. * 0x9: CCK 5.5 Mbps long preamble
  5539. * 0xA: CCK 2 Mbps long preamble
  5540. * 0xB: CCK 1 Mbps long preamble
  5541. * 0xC: CCK 11 Mbps short preamble
  5542. * 0xD: CCK 5.5 Mbps short preamble
  5543. * 0xE: CCK 2 Mbps short preamble
  5544. * - LEGACY_RATE_SEL
  5545. * Bit 29
  5546. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  5547. * Value:
  5548. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  5549. * used a legacy rate.
  5550. * 0 -> OFDM, 1 -> CCK
  5551. * - END_VALID
  5552. * Bit 30
  5553. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5554. * the start of the PPDU are valid. Specifically, the following
  5555. * fields are only valid if END_VALID is set:
  5556. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  5557. * TIMESTAMP_SUBMICROSEC
  5558. * Value:
  5559. * 0 -> rx PPDU desc end fields are not valid
  5560. * 1 -> rx PPDU desc end fields are valid
  5561. * - START_VALID
  5562. * Bit 31
  5563. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5564. * the end of the PPDU are valid. Specifically, the following
  5565. * fields are only valid if START_VALID is set:
  5566. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  5567. * VHT-SIG-A
  5568. * Value:
  5569. * 0 -> rx PPDU desc start fields are not valid
  5570. * 1 -> rx PPDU desc start fields are valid
  5571. * - RSSI0_PRI20
  5572. * Bits 7:0
  5573. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  5574. * Value: RSSI dB units w.r.t. noise floor
  5575. *
  5576. * - RSSI0_EXT20
  5577. * Bits 7:0
  5578. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  5579. * (if the rx bandwidth was >= 40 MHz)
  5580. * Value: RSSI dB units w.r.t. noise floor
  5581. * - RSSI0_EXT40
  5582. * Bits 7:0
  5583. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  5584. * (if the rx bandwidth was >= 80 MHz)
  5585. * Value: RSSI dB units w.r.t. noise floor
  5586. * - RSSI0_EXT80
  5587. * Bits 7:0
  5588. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  5589. * (if the rx bandwidth was >= 160 MHz)
  5590. * Value: RSSI dB units w.r.t. noise floor
  5591. *
  5592. * - RSSI1_PRI20
  5593. * Bits 7:0
  5594. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  5595. * Value: RSSI dB units w.r.t. noise floor
  5596. * - RSSI1_EXT20
  5597. * Bits 7:0
  5598. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  5599. * (if the rx bandwidth was >= 40 MHz)
  5600. * Value: RSSI dB units w.r.t. noise floor
  5601. * - RSSI1_EXT40
  5602. * Bits 7:0
  5603. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  5604. * (if the rx bandwidth was >= 80 MHz)
  5605. * Value: RSSI dB units w.r.t. noise floor
  5606. * - RSSI1_EXT80
  5607. * Bits 7:0
  5608. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  5609. * (if the rx bandwidth was >= 160 MHz)
  5610. * Value: RSSI dB units w.r.t. noise floor
  5611. *
  5612. * - RSSI2_PRI20
  5613. * Bits 7:0
  5614. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  5615. * Value: RSSI dB units w.r.t. noise floor
  5616. * - RSSI2_EXT20
  5617. * Bits 7:0
  5618. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  5619. * (if the rx bandwidth was >= 40 MHz)
  5620. * Value: RSSI dB units w.r.t. noise floor
  5621. * - RSSI2_EXT40
  5622. * Bits 7:0
  5623. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  5624. * (if the rx bandwidth was >= 80 MHz)
  5625. * Value: RSSI dB units w.r.t. noise floor
  5626. * - RSSI2_EXT80
  5627. * Bits 7:0
  5628. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  5629. * (if the rx bandwidth was >= 160 MHz)
  5630. * Value: RSSI dB units w.r.t. noise floor
  5631. *
  5632. * - RSSI3_PRI20
  5633. * Bits 7:0
  5634. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  5635. * Value: RSSI dB units w.r.t. noise floor
  5636. * - RSSI3_EXT20
  5637. * Bits 7:0
  5638. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  5639. * (if the rx bandwidth was >= 40 MHz)
  5640. * Value: RSSI dB units w.r.t. noise floor
  5641. * - RSSI3_EXT40
  5642. * Bits 7:0
  5643. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  5644. * (if the rx bandwidth was >= 80 MHz)
  5645. * Value: RSSI dB units w.r.t. noise floor
  5646. * - RSSI3_EXT80
  5647. * Bits 7:0
  5648. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  5649. * (if the rx bandwidth was >= 160 MHz)
  5650. * Value: RSSI dB units w.r.t. noise floor
  5651. *
  5652. * - TSF32
  5653. * Bits 31:0
  5654. * Purpose: specify the time the rx PPDU was received, in TSF units
  5655. * Value: 32 LSBs of the TSF
  5656. * - TIMESTAMP_MICROSEC
  5657. * Bits 31:0
  5658. * Purpose: specify the time the rx PPDU was received, in microsecond units
  5659. * Value: PPDU rx time, in microseconds
  5660. * - VHT_SIG_A1
  5661. * Bits 23:0
  5662. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  5663. * from the rx PPDU
  5664. * Value:
  5665. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  5666. * VHT-SIG-A1 data.
  5667. * If PREAMBLE_TYPE specifies HT, then this field contains the
  5668. * first 24 bits of the HT-SIG data.
  5669. * Otherwise, this field is invalid.
  5670. * Refer to the the 802.11 protocol for the definition of the
  5671. * HT-SIG and VHT-SIG-A1 fields
  5672. * - VHT_SIG_A2
  5673. * Bits 23:0
  5674. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  5675. * from the rx PPDU
  5676. * Value:
  5677. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  5678. * VHT-SIG-A2 data.
  5679. * If PREAMBLE_TYPE specifies HT, then this field contains the
  5680. * last 24 bits of the HT-SIG data.
  5681. * Otherwise, this field is invalid.
  5682. * Refer to the the 802.11 protocol for the definition of the
  5683. * HT-SIG and VHT-SIG-A2 fields
  5684. * - PREAMBLE_TYPE
  5685. * Bits 31:24
  5686. * Purpose: indicate the PHY format of the received burst
  5687. * Value:
  5688. * 0x4: Legacy (OFDM/CCK)
  5689. * 0x8: HT
  5690. * 0x9: HT with TxBF
  5691. * 0xC: VHT
  5692. * 0xD: VHT with TxBF
  5693. * - SERVICE
  5694. * Bits 31:24
  5695. * Purpose: TBD
  5696. * Value: TBD
  5697. *
  5698. * Rx MSDU descriptor fields:
  5699. * - FW_RX_DESC_BYTES
  5700. * Bits 15:0
  5701. * Purpose: Indicate how many bytes in the Rx indication are used for
  5702. * FW Rx descriptors
  5703. *
  5704. * Payload fields:
  5705. * - MPDU_COUNT
  5706. * Bits 7:0
  5707. * Purpose: Indicate how many sequential MPDUs share the same status.
  5708. * All MPDUs within the indicated list are from the same RA-TA-TID.
  5709. * - MPDU_STATUS
  5710. * Bits 15:8
  5711. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  5712. * received successfully.
  5713. * Value:
  5714. * 0x1: success
  5715. * 0x2: FCS error
  5716. * 0x3: duplicate error
  5717. * 0x4: replay error
  5718. * 0x5: invalid peer
  5719. */
  5720. /* header fields */
  5721. #define HTT_RX_IND_EXT_TID_M 0x1f00
  5722. #define HTT_RX_IND_EXT_TID_S 8
  5723. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  5724. #define HTT_RX_IND_FLUSH_VALID_S 13
  5725. #define HTT_RX_IND_REL_VALID_M 0x4000
  5726. #define HTT_RX_IND_REL_VALID_S 14
  5727. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  5728. #define HTT_RX_IND_PEER_ID_S 16
  5729. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  5730. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  5731. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  5732. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  5733. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  5734. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  5735. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  5736. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  5737. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  5738. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  5739. /* rx PPDU descriptor fields */
  5740. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  5741. #define HTT_RX_IND_RSSI_CMB_S 0
  5742. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  5743. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  5744. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  5745. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  5746. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  5747. #define HTT_RX_IND_PHY_ERR_S 24
  5748. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  5749. #define HTT_RX_IND_LEGACY_RATE_S 25
  5750. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  5751. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  5752. #define HTT_RX_IND_END_VALID_M 0x40000000
  5753. #define HTT_RX_IND_END_VALID_S 30
  5754. #define HTT_RX_IND_START_VALID_M 0x80000000
  5755. #define HTT_RX_IND_START_VALID_S 31
  5756. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  5757. #define HTT_RX_IND_RSSI_PRI20_S 0
  5758. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  5759. #define HTT_RX_IND_RSSI_EXT20_S 8
  5760. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  5761. #define HTT_RX_IND_RSSI_EXT40_S 16
  5762. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  5763. #define HTT_RX_IND_RSSI_EXT80_S 24
  5764. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  5765. #define HTT_RX_IND_VHT_SIG_A1_S 0
  5766. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  5767. #define HTT_RX_IND_VHT_SIG_A2_S 0
  5768. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  5769. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  5770. #define HTT_RX_IND_SERVICE_M 0xff000000
  5771. #define HTT_RX_IND_SERVICE_S 24
  5772. /* rx MSDU descriptor fields */
  5773. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  5774. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  5775. /* payload fields */
  5776. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  5777. #define HTT_RX_IND_MPDU_COUNT_S 0
  5778. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  5779. #define HTT_RX_IND_MPDU_STATUS_S 8
  5780. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  5781. do { \
  5782. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  5783. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  5784. } while (0)
  5785. #define HTT_RX_IND_EXT_TID_GET(word) \
  5786. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  5787. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  5788. do { \
  5789. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  5790. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  5791. } while (0)
  5792. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  5793. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  5794. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  5795. do { \
  5796. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  5797. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  5798. } while (0)
  5799. #define HTT_RX_IND_REL_VALID_GET(word) \
  5800. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  5801. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  5802. do { \
  5803. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  5804. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  5805. } while (0)
  5806. #define HTT_RX_IND_PEER_ID_GET(word) \
  5807. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  5808. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  5809. do { \
  5810. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  5811. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  5812. } while (0)
  5813. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  5814. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  5815. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  5816. do { \
  5817. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  5818. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  5819. } while (0)
  5820. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  5821. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  5822. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  5823. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  5824. do { \
  5825. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  5826. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  5827. } while (0)
  5828. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  5829. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  5830. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  5831. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  5832. do { \
  5833. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  5834. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  5835. } while (0)
  5836. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  5837. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  5838. HTT_RX_IND_REL_SEQ_NUM_START_S)
  5839. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  5840. do { \
  5841. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  5842. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  5843. } while (0)
  5844. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  5845. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  5846. HTT_RX_IND_REL_SEQ_NUM_END_S)
  5847. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  5848. do { \
  5849. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  5850. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  5851. } while (0)
  5852. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  5853. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  5854. HTT_RX_IND_NUM_MPDU_RANGES_S)
  5855. /* FW rx PPDU descriptor fields */
  5856. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  5857. do { \
  5858. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  5859. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  5860. } while (0)
  5861. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  5862. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  5863. HTT_RX_IND_RSSI_CMB_S)
  5864. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  5865. do { \
  5866. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  5867. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  5868. } while (0)
  5869. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  5870. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  5871. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  5872. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  5873. do { \
  5874. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  5875. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  5876. } while (0)
  5877. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  5878. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  5879. HTT_RX_IND_PHY_ERR_CODE_S)
  5880. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  5881. do { \
  5882. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  5883. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  5884. } while (0)
  5885. #define HTT_RX_IND_PHY_ERR_GET(word) \
  5886. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  5887. HTT_RX_IND_PHY_ERR_S)
  5888. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  5889. do { \
  5890. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  5891. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  5892. } while (0)
  5893. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  5894. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  5895. HTT_RX_IND_LEGACY_RATE_S)
  5896. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  5897. do { \
  5898. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  5899. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  5900. } while (0)
  5901. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  5902. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  5903. HTT_RX_IND_LEGACY_RATE_SEL_S)
  5904. #define HTT_RX_IND_END_VALID_SET(word, value) \
  5905. do { \
  5906. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  5907. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  5908. } while (0)
  5909. #define HTT_RX_IND_END_VALID_GET(word) \
  5910. (((word) & HTT_RX_IND_END_VALID_M) >> \
  5911. HTT_RX_IND_END_VALID_S)
  5912. #define HTT_RX_IND_START_VALID_SET(word, value) \
  5913. do { \
  5914. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  5915. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  5916. } while (0)
  5917. #define HTT_RX_IND_START_VALID_GET(word) \
  5918. (((word) & HTT_RX_IND_START_VALID_M) >> \
  5919. HTT_RX_IND_START_VALID_S)
  5920. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  5921. do { \
  5922. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  5923. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  5924. } while (0)
  5925. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  5926. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  5927. HTT_RX_IND_RSSI_PRI20_S)
  5928. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  5929. do { \
  5930. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  5931. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  5932. } while (0)
  5933. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  5934. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  5935. HTT_RX_IND_RSSI_EXT20_S)
  5936. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  5937. do { \
  5938. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  5939. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  5940. } while (0)
  5941. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  5942. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  5943. HTT_RX_IND_RSSI_EXT40_S)
  5944. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  5945. do { \
  5946. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  5947. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  5948. } while (0)
  5949. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  5950. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  5951. HTT_RX_IND_RSSI_EXT80_S)
  5952. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  5953. do { \
  5954. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  5955. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  5956. } while (0)
  5957. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  5958. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  5959. HTT_RX_IND_VHT_SIG_A1_S)
  5960. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  5961. do { \
  5962. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  5963. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  5964. } while (0)
  5965. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  5966. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  5967. HTT_RX_IND_VHT_SIG_A2_S)
  5968. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  5969. do { \
  5970. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  5971. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  5972. } while (0)
  5973. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  5974. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  5975. HTT_RX_IND_PREAMBLE_TYPE_S)
  5976. #define HTT_RX_IND_SERVICE_SET(word, value) \
  5977. do { \
  5978. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  5979. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  5980. } while (0)
  5981. #define HTT_RX_IND_SERVICE_GET(word) \
  5982. (((word) & HTT_RX_IND_SERVICE_M) >> \
  5983. HTT_RX_IND_SERVICE_S)
  5984. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  5985. do { \
  5986. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  5987. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  5988. } while (0)
  5989. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  5990. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  5991. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  5992. do { \
  5993. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  5994. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  5995. } while (0)
  5996. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  5997. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  5998. #define HTT_RX_IND_HL_BYTES \
  5999. (HTT_RX_IND_HDR_BYTES + \
  6000. 4 /* single FW rx MSDU descriptor, plus padding */ + \
  6001. 4 /* single MPDU range information element */)
  6002. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  6003. /* Could we use one macro entry? */
  6004. #define HTT_WORD_SET(word, field, value) \
  6005. do { \
  6006. HTT_CHECK_SET_VAL(field, value); \
  6007. (word) |= ((value) << field ## _S); \
  6008. } while (0)
  6009. #define HTT_WORD_GET(word, field) \
  6010. (((word) & field ## _M) >> field ## _S)
  6011. PREPACK struct hl_htt_rx_ind_base {
  6012. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  6013. } POSTPACK;
  6014. /*
  6015. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  6016. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  6017. * HL host needed info. The field is just after the msdu fw rx desc.
  6018. */
  6019. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  6020. struct htt_rx_ind_hl_rx_desc_t {
  6021. A_UINT8 ver;
  6022. A_UINT8 len;
  6023. struct {
  6024. A_UINT8
  6025. first_msdu: 1,
  6026. last_msdu: 1,
  6027. c3_failed: 1,
  6028. c4_failed: 1,
  6029. ipv6: 1,
  6030. tcp: 1,
  6031. udp: 1,
  6032. reserved: 1;
  6033. } flags;
  6034. };
  6035. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  6036. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6037. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  6038. #define HTT_RX_IND_HL_RX_DESC_VER 0
  6039. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  6040. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6041. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  6042. #define HTT_RX_IND_HL_FLAG_OFFSET \
  6043. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6044. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  6045. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  6046. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  6047. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  6048. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  6049. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  6050. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  6051. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  6052. /* This structure is used in HL, the basic descriptor information
  6053. * used by host. the structure is translated by FW from HW desc
  6054. * or generated by FW. But in HL monitor mode, the host would use
  6055. * the same structure with LL.
  6056. */
  6057. PREPACK struct hl_htt_rx_desc_base {
  6058. A_UINT32
  6059. seq_num:12,
  6060. encrypted:1,
  6061. chan_info_present:1,
  6062. resv0:2,
  6063. mcast_bcast:1,
  6064. fragment:1,
  6065. key_id_oct:8,
  6066. resv1:6;
  6067. A_UINT32
  6068. pn_31_0;
  6069. union {
  6070. struct {
  6071. A_UINT16 pn_47_32;
  6072. A_UINT16 pn_63_48;
  6073. } pn16;
  6074. A_UINT32 pn_63_32;
  6075. } u0;
  6076. A_UINT32
  6077. pn_95_64;
  6078. A_UINT32
  6079. pn_127_96;
  6080. } POSTPACK;
  6081. /*
  6082. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  6083. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  6084. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  6085. * Please see htt_chan_change_t for description of the fields.
  6086. */
  6087. PREPACK struct htt_chan_info_t
  6088. {
  6089. A_UINT32 primary_chan_center_freq_mhz: 16,
  6090. contig_chan1_center_freq_mhz: 16;
  6091. A_UINT32 contig_chan2_center_freq_mhz: 16,
  6092. phy_mode: 8,
  6093. reserved: 8;
  6094. } POSTPACK;
  6095. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  6096. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  6097. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  6098. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  6099. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  6100. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  6101. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  6102. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  6103. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  6104. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  6105. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  6106. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  6107. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  6108. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  6109. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  6110. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  6111. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  6112. /* Channel information */
  6113. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  6114. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  6115. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  6116. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  6117. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  6118. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  6119. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  6120. #define HTT_CHAN_INFO_PHY_MODE_S 16
  6121. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  6122. do { \
  6123. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  6124. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  6125. } while (0)
  6126. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  6127. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  6128. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  6129. do { \
  6130. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  6131. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  6132. } while (0)
  6133. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  6134. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  6135. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  6136. do { \
  6137. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  6138. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  6139. } while (0)
  6140. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  6141. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  6142. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  6143. do { \
  6144. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  6145. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  6146. } while (0)
  6147. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  6148. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  6149. /*
  6150. * @brief target -> host rx reorder flush message definition
  6151. *
  6152. * @details
  6153. * The following field definitions describe the format of the rx flush
  6154. * message sent from the target to the host.
  6155. * The message consists of a 4-octet header, followed by one or more
  6156. * 4-octet payload information elements.
  6157. *
  6158. * |31 24|23 8|7 0|
  6159. * |--------------------------------------------------------------|
  6160. * | TID | peer ID | msg type |
  6161. * |--------------------------------------------------------------|
  6162. * | seq num end | seq num start | MPDU status | reserved |
  6163. * |--------------------------------------------------------------|
  6164. * First DWORD:
  6165. * - MSG_TYPE
  6166. * Bits 7:0
  6167. * Purpose: identifies this as an rx flush message
  6168. * Value: 0x2
  6169. * - PEER_ID
  6170. * Bits 23:8 (only bits 18:8 actually used)
  6171. * Purpose: identify which peer's rx data is being flushed
  6172. * Value: (rx) peer ID
  6173. * - TID
  6174. * Bits 31:24 (only bits 27:24 actually used)
  6175. * Purpose: Specifies which traffic identifier's rx data is being flushed
  6176. * Value: traffic identifier
  6177. * Second DWORD:
  6178. * - MPDU_STATUS
  6179. * Bits 15:8
  6180. * Purpose:
  6181. * Indicate whether the flushed MPDUs should be discarded or processed.
  6182. * Value:
  6183. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  6184. * stages of rx processing
  6185. * other: discard the MPDUs
  6186. * It is anticipated that flush messages will always have
  6187. * MPDU status == 1, but the status flag is included for
  6188. * flexibility.
  6189. * - SEQ_NUM_START
  6190. * Bits 23:16
  6191. * Purpose:
  6192. * Indicate the start of a series of consecutive MPDUs being flushed.
  6193. * Not all MPDUs within this range are necessarily valid - the host
  6194. * must check each sequence number within this range to see if the
  6195. * corresponding MPDU is actually present.
  6196. * Value:
  6197. * The sequence number for the first MPDU in the sequence.
  6198. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6199. * - SEQ_NUM_END
  6200. * Bits 30:24
  6201. * Purpose:
  6202. * Indicate the end of a series of consecutive MPDUs being flushed.
  6203. * Value:
  6204. * The sequence number one larger than the sequence number of the
  6205. * last MPDU being flushed.
  6206. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6207. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  6208. * are to be released for further rx processing.
  6209. * Not all MPDUs within this range are necessarily valid - the host
  6210. * must check each sequence number within this range to see if the
  6211. * corresponding MPDU is actually present.
  6212. */
  6213. /* first DWORD */
  6214. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  6215. #define HTT_RX_FLUSH_PEER_ID_S 8
  6216. #define HTT_RX_FLUSH_TID_M 0xff000000
  6217. #define HTT_RX_FLUSH_TID_S 24
  6218. /* second DWORD */
  6219. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  6220. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  6221. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  6222. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  6223. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  6224. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  6225. #define HTT_RX_FLUSH_BYTES 8
  6226. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  6227. do { \
  6228. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  6229. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  6230. } while (0)
  6231. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  6232. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  6233. #define HTT_RX_FLUSH_TID_SET(word, value) \
  6234. do { \
  6235. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  6236. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  6237. } while (0)
  6238. #define HTT_RX_FLUSH_TID_GET(word) \
  6239. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  6240. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  6241. do { \
  6242. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  6243. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  6244. } while (0)
  6245. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  6246. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  6247. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  6248. do { \
  6249. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  6250. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  6251. } while (0)
  6252. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  6253. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  6254. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  6255. do { \
  6256. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  6257. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  6258. } while (0)
  6259. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  6260. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  6261. /*
  6262. * @brief target -> host rx pn check indication message
  6263. *
  6264. * @details
  6265. * The following field definitions describe the format of the Rx PN check
  6266. * indication message sent from the target to the host.
  6267. * The message consists of a 4-octet header, followed by the start and
  6268. * end sequence numbers to be released, followed by the PN IEs. Each PN
  6269. * IE is one octet containing the sequence number that failed the PN
  6270. * check.
  6271. *
  6272. * |31 24|23 8|7 0|
  6273. * |--------------------------------------------------------------|
  6274. * | TID | peer ID | msg type |
  6275. * |--------------------------------------------------------------|
  6276. * | Reserved | PN IE count | seq num end | seq num start|
  6277. * |--------------------------------------------------------------|
  6278. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  6279. * |--------------------------------------------------------------|
  6280. * First DWORD:
  6281. * - MSG_TYPE
  6282. * Bits 7:0
  6283. * Purpose: Identifies this as an rx pn check indication message
  6284. * Value: 0x2
  6285. * - PEER_ID
  6286. * Bits 23:8 (only bits 18:8 actually used)
  6287. * Purpose: identify which peer
  6288. * Value: (rx) peer ID
  6289. * - TID
  6290. * Bits 31:24 (only bits 27:24 actually used)
  6291. * Purpose: identify traffic identifier
  6292. * Value: traffic identifier
  6293. * Second DWORD:
  6294. * - SEQ_NUM_START
  6295. * Bits 7:0
  6296. * Purpose:
  6297. * Indicates the starting sequence number of the MPDU in this
  6298. * series of MPDUs that went though PN check.
  6299. * Value:
  6300. * The sequence number for the first MPDU in the sequence.
  6301. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6302. * - SEQ_NUM_END
  6303. * Bits 15:8
  6304. * Purpose:
  6305. * Indicates the ending sequence number of the MPDU in this
  6306. * series of MPDUs that went though PN check.
  6307. * Value:
  6308. * The sequence number one larger then the sequence number of the last
  6309. * MPDU being flushed.
  6310. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6311. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  6312. * for invalid PN numbers and are ready to be released for further processing.
  6313. * Not all MPDUs within this range are necessarily valid - the host
  6314. * must check each sequence number within this range to see if the
  6315. * corresponding MPDU is actually present.
  6316. * - PN_IE_COUNT
  6317. * Bits 23:16
  6318. * Purpose:
  6319. * Used to determine the variable number of PN information elements in this
  6320. * message
  6321. *
  6322. * PN information elements:
  6323. * - PN_IE_x-
  6324. * Purpose:
  6325. * Each PN information element contains the sequence number of the MPDU that
  6326. * has failed the target PN check.
  6327. * Value:
  6328. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  6329. * that failed the PN check.
  6330. */
  6331. /* first DWORD */
  6332. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  6333. #define HTT_RX_PN_IND_PEER_ID_S 8
  6334. #define HTT_RX_PN_IND_TID_M 0xff000000
  6335. #define HTT_RX_PN_IND_TID_S 24
  6336. /* second DWORD */
  6337. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  6338. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  6339. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  6340. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  6341. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  6342. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  6343. #define HTT_RX_PN_IND_BYTES 8
  6344. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  6345. do { \
  6346. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  6347. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  6348. } while (0)
  6349. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  6350. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  6351. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  6352. do { \
  6353. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  6354. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  6355. } while (0)
  6356. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  6357. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  6358. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  6359. do { \
  6360. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  6361. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  6362. } while (0)
  6363. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  6364. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  6365. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  6366. do { \
  6367. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  6368. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  6369. } while (0)
  6370. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  6371. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  6372. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  6373. do { \
  6374. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  6375. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  6376. } while (0)
  6377. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  6378. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  6379. /*
  6380. * @brief target -> host rx offload deliver message for LL system
  6381. *
  6382. * @details
  6383. * In a low latency system this message is sent whenever the offload
  6384. * manager flushes out the packets it has coalesced in its coalescing buffer.
  6385. * The DMA of the actual packets into host memory is done before sending out
  6386. * this message. This message indicates only how many MSDUs to reap. The
  6387. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  6388. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  6389. * DMA'd by the MAC directly into host memory these packets do not contain
  6390. * the MAC descriptors in the header portion of the packet. Instead they contain
  6391. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  6392. * message, the packets are delivered directly to the NW stack without going
  6393. * through the regular reorder buffering and PN checking path since it has
  6394. * already been done in target.
  6395. *
  6396. * |31 24|23 16|15 8|7 0|
  6397. * |-----------------------------------------------------------------------|
  6398. * | Total MSDU count | reserved | msg type |
  6399. * |-----------------------------------------------------------------------|
  6400. *
  6401. * @brief target -> host rx offload deliver message for HL system
  6402. *
  6403. * @details
  6404. * In a high latency system this message is sent whenever the offload manager
  6405. * flushes out the packets it has coalesced in its coalescing buffer. The
  6406. * actual packets are also carried along with this message. When the host
  6407. * receives this message, it is expected to deliver these packets to the NW
  6408. * stack directly instead of routing them through the reorder buffering and
  6409. * PN checking path since it has already been done in target.
  6410. *
  6411. * |31 24|23 16|15 8|7 0|
  6412. * |-----------------------------------------------------------------------|
  6413. * | Total MSDU count | reserved | msg type |
  6414. * |-----------------------------------------------------------------------|
  6415. * | peer ID | MSDU length |
  6416. * |-----------------------------------------------------------------------|
  6417. * | MSDU payload | FW Desc | tid | vdev ID |
  6418. * |-----------------------------------------------------------------------|
  6419. * | MSDU payload contd. |
  6420. * |-----------------------------------------------------------------------|
  6421. * | peer ID | MSDU length |
  6422. * |-----------------------------------------------------------------------|
  6423. * | MSDU payload | FW Desc | tid | vdev ID |
  6424. * |-----------------------------------------------------------------------|
  6425. * | MSDU payload contd. |
  6426. * |-----------------------------------------------------------------------|
  6427. *
  6428. */
  6429. /* first DWORD */
  6430. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  6431. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  6432. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  6433. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  6434. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  6435. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  6436. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  6437. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  6438. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  6439. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  6440. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  6441. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  6442. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  6443. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  6444. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  6445. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  6446. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  6447. do { \
  6448. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  6449. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  6450. } while (0)
  6451. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  6452. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  6453. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  6454. do { \
  6455. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  6456. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  6457. } while (0)
  6458. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  6459. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  6460. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  6461. do { \
  6462. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  6463. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  6464. } while (0)
  6465. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  6466. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  6467. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  6468. do { \
  6469. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  6470. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  6471. } while (0)
  6472. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  6473. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  6474. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  6475. do { \
  6476. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  6477. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  6478. } while (0)
  6479. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  6480. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  6481. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  6482. do { \
  6483. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  6484. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  6485. } while (0)
  6486. /**
  6487. * @brief target -> host rx peer map/unmap message definition
  6488. *
  6489. * @details
  6490. * The following diagram shows the format of the rx peer map message sent
  6491. * from the target to the host. This layout assumes the target operates
  6492. * as little-endian.
  6493. *
  6494. * This message always contains a SW peer ID. The main purpose of the
  6495. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  6496. * with, so that the host can use that peer ID to determine which peer
  6497. * transmitted the rx frame. This SW peer ID is sometimes also used for
  6498. * other purposes, such as identifying during tx completions which peer
  6499. * the tx frames in question were transmitted to.
  6500. *
  6501. * In certain generations of chips, the peer map message also contains
  6502. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  6503. * to identify which peer the frame needs to be forwarded to (i.e. the
  6504. * peer assocated with the Destination MAC Address within the packet),
  6505. * and particularly which vdev needs to transmit the frame (for cases
  6506. * of inter-vdev rx --> tx forwarding).
  6507. * This DA-based peer ID that is provided for certain rx frames
  6508. * (the rx frames that need to be re-transmitted as tx frames)
  6509. * is the ID that the HW uses for referring to the peer in question,
  6510. * rather than the peer ID that the SW+FW use to refer to the peer.
  6511. *
  6512. *
  6513. * |31 24|23 16|15 8|7 0|
  6514. * |-----------------------------------------------------------------------|
  6515. * | SW peer ID | VDEV ID | msg type |
  6516. * |-----------------------------------------------------------------------|
  6517. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6518. * |-----------------------------------------------------------------------|
  6519. * | HW peer ID | MAC addr 5 | MAC addr 4 |
  6520. * |-----------------------------------------------------------------------|
  6521. *
  6522. *
  6523. * The following diagram shows the format of the rx peer unmap message sent
  6524. * from the target to the host.
  6525. *
  6526. * |31 24|23 16|15 8|7 0|
  6527. * |-----------------------------------------------------------------------|
  6528. * | SW peer ID | VDEV ID | msg type |
  6529. * |-----------------------------------------------------------------------|
  6530. *
  6531. * The following field definitions describe the format of the rx peer map
  6532. * and peer unmap messages sent from the target to the host.
  6533. * - MSG_TYPE
  6534. * Bits 7:0
  6535. * Purpose: identifies this as an rx peer map or peer unmap message
  6536. * Value: peer map -> 0x3, peer unmap -> 0x4
  6537. * - VDEV_ID
  6538. * Bits 15:8
  6539. * Purpose: Indicates which virtual device the peer is associated
  6540. * with.
  6541. * Value: vdev ID (used in the host to look up the vdev object)
  6542. * - PEER_ID (a.k.a. SW_PEER_ID)
  6543. * Bits 31:16
  6544. * Purpose: The peer ID (index) that WAL is allocating (map) or
  6545. * freeing (unmap)
  6546. * Value: (rx) peer ID
  6547. * - MAC_ADDR_L32 (peer map only)
  6548. * Bits 31:0
  6549. * Purpose: Identifies which peer node the peer ID is for.
  6550. * Value: lower 4 bytes of peer node's MAC address
  6551. * - MAC_ADDR_U16 (peer map only)
  6552. * Bits 15:0
  6553. * Purpose: Identifies which peer node the peer ID is for.
  6554. * Value: upper 2 bytes of peer node's MAC address
  6555. * - HW_PEER_ID
  6556. * Bits 31:16
  6557. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  6558. * address, so for rx frames marked for rx --> tx forwarding, the
  6559. * host can determine from the HW peer ID provided as meta-data with
  6560. * the rx frame which peer the frame is supposed to be forwarded to.
  6561. * Value: ID used by the MAC HW to identify the peer
  6562. */
  6563. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  6564. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  6565. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  6566. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  6567. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  6568. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  6569. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  6570. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  6571. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  6572. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  6573. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  6574. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  6575. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  6576. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  6577. do { \
  6578. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  6579. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  6580. } while (0)
  6581. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  6582. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  6583. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  6584. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  6585. do { \
  6586. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  6587. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  6588. } while (0)
  6589. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  6590. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  6591. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  6592. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  6593. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  6594. do { \
  6595. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  6596. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  6597. } while (0)
  6598. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  6599. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  6600. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  6601. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  6602. #define HTT_RX_PEER_MAP_BYTES 12
  6603. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  6604. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  6605. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  6606. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  6607. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  6608. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  6609. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  6610. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  6611. #define HTT_RX_PEER_UNMAP_BYTES 4
  6612. /**
  6613. * @brief target -> host rx peer map V2 message definition
  6614. *
  6615. * @details
  6616. * The following diagram shows the format of the rx peer map v2 message sent
  6617. * from the target to the host. This layout assumes the target operates
  6618. * as little-endian.
  6619. *
  6620. * This message always contains a SW peer ID. The main purpose of the
  6621. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  6622. * with, so that the host can use that peer ID to determine which peer
  6623. * transmitted the rx frame. This SW peer ID is sometimes also used for
  6624. * other purposes, such as identifying during tx completions which peer
  6625. * the tx frames in question were transmitted to.
  6626. *
  6627. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  6628. * is used during rx --> tx frame forwarding to identify which peer the
  6629. * frame needs to be forwarded to (i.e. the peer assocated with the
  6630. * Destination MAC Address within the packet), and particularly which vdev
  6631. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  6632. * This DA-based peer ID that is provided for certain rx frames
  6633. * (the rx frames that need to be re-transmitted as tx frames)
  6634. * is the ID that the HW uses for referring to the peer in question,
  6635. * rather than the peer ID that the SW+FW use to refer to the peer.
  6636. *
  6637. *
  6638. * |31 24|23 16|15 8|7 0|
  6639. * |-----------------------------------------------------------------------|
  6640. * | SW peer ID | VDEV ID | msg type |
  6641. * |-----------------------------------------------------------------------|
  6642. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6643. * |-----------------------------------------------------------------------|
  6644. * | HW peer ID | MAC addr 5 | MAC addr 4 |
  6645. * |-----------------------------------------------------------------------|
  6646. * | Reserved_17_31 | Next Hop | AST Hash Value |
  6647. * |-----------------------------------------------------------------------|
  6648. * | Reserved_0 |
  6649. * |-----------------------------------------------------------------------|
  6650. * | Reserved_1 |
  6651. * |-----------------------------------------------------------------------|
  6652. * | Reserved_2 |
  6653. * |-----------------------------------------------------------------------|
  6654. * | Reserved_3 |
  6655. * |-----------------------------------------------------------------------|
  6656. *
  6657. *
  6658. * The following field definitions describe the format of the rx peer map v2
  6659. * messages sent from the target to the host.
  6660. * - MSG_TYPE
  6661. * Bits 7:0
  6662. * Purpose: identifies this as an rx peer map v2 message
  6663. * Value: peer map v2 -> 0x1e
  6664. * - VDEV_ID
  6665. * Bits 15:8
  6666. * Purpose: Indicates which virtual device the peer is associated with.
  6667. * Value: vdev ID (used in the host to look up the vdev object)
  6668. * - SW_PEER_ID
  6669. * Bits 31:16
  6670. * Purpose: The peer ID (index) that WAL is allocating
  6671. * Value: (rx) peer ID
  6672. * - MAC_ADDR_L32
  6673. * Bits 31:0
  6674. * Purpose: Identifies which peer node the peer ID is for.
  6675. * Value: lower 4 bytes of peer node's MAC address
  6676. * - MAC_ADDR_U16
  6677. * Bits 15:0
  6678. * Purpose: Identifies which peer node the peer ID is for.
  6679. * Value: upper 2 bytes of peer node's MAC address
  6680. * - HW_PEER_ID
  6681. * Bits 31:16
  6682. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  6683. * address, so for rx frames marked for rx --> tx forwarding, the
  6684. * host can determine from the HW peer ID provided as meta-data with
  6685. * the rx frame which peer the frame is supposed to be forwarded to.
  6686. * Value: ID used by the MAC HW to identify the peer
  6687. * - AST_HASH_VALUE
  6688. * Bits 15:0
  6689. * Purpose: Indicates AST Hash value is required for the TCL AST index
  6690. * override feature.
  6691. * - NEXT_HOP
  6692. * Bit 16
  6693. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  6694. * (Wireless Distribution System).
  6695. */
  6696. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  6697. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  6698. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  6699. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  6700. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  6701. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  6702. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  6703. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  6704. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  6705. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  6706. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  6707. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  6708. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  6709. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  6710. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  6711. do { \
  6712. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  6713. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  6714. } while (0)
  6715. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  6716. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  6717. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  6718. do { \
  6719. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  6720. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  6721. } while (0)
  6722. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  6723. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  6724. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  6725. do { \
  6726. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  6727. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  6728. } while (0)
  6729. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  6730. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  6731. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  6732. do { \
  6733. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  6734. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  6735. } while (0)
  6736. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  6737. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  6738. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  6739. do { \
  6740. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  6741. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  6742. } while (0)
  6743. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  6744. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  6745. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  6746. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  6747. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  6748. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  6749. #define HTT_RX_PEER_MAP_V2_BYTES 32
  6750. /**
  6751. * @brief target -> host rx peer unmap V2 message definition
  6752. *
  6753. *
  6754. * The following diagram shows the format of the rx peer unmap message sent
  6755. * from the target to the host.
  6756. *
  6757. * |31 24|23 16|15 8|7 0|
  6758. * |-----------------------------------------------------------------------|
  6759. * | SW peer ID | VDEV ID | msg type |
  6760. * |-----------------------------------------------------------------------|
  6761. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6762. * |-----------------------------------------------------------------------|
  6763. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  6764. * |-----------------------------------------------------------------------|
  6765. * | Peer Delete Duration |
  6766. * |-----------------------------------------------------------------------|
  6767. * | Reserved_0 |
  6768. * |-----------------------------------------------------------------------|
  6769. * | Reserved_1 |
  6770. * |-----------------------------------------------------------------------|
  6771. * | Reserved_2 |
  6772. * |-----------------------------------------------------------------------|
  6773. *
  6774. *
  6775. * The following field definitions describe the format of the rx peer unmap
  6776. * messages sent from the target to the host.
  6777. * - MSG_TYPE
  6778. * Bits 7:0
  6779. * Purpose: identifies this as an rx peer unmap v2 message
  6780. * Value: peer unmap v2 -> 0x1f
  6781. * - VDEV_ID
  6782. * Bits 15:8
  6783. * Purpose: Indicates which virtual device the peer is associated
  6784. * with.
  6785. * Value: vdev ID (used in the host to look up the vdev object)
  6786. * - SW_PEER_ID
  6787. * Bits 31:16
  6788. * Purpose: The peer ID (index) that WAL is freeing
  6789. * Value: (rx) peer ID
  6790. * - MAC_ADDR_L32
  6791. * Bits 31:0
  6792. * Purpose: Identifies which peer node the peer ID is for.
  6793. * Value: lower 4 bytes of peer node's MAC address
  6794. * - MAC_ADDR_U16
  6795. * Bits 15:0
  6796. * Purpose: Identifies which peer node the peer ID is for.
  6797. * Value: upper 2 bytes of peer node's MAC address
  6798. * - NEXT_HOP
  6799. * Bits 16
  6800. * Purpose: Bit indicates next_hop AST entry used for WDS
  6801. * (Wireless Distribution System).
  6802. * - PEER_DELETE_DURATION
  6803. * Bits 31:0
  6804. * Purpose: Time taken to delete peer, in msec,
  6805. * Used for monitoring / debugging PEER delete response delay
  6806. */
  6807. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  6808. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  6809. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  6810. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  6811. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  6812. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  6813. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  6814. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  6815. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  6816. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  6817. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  6818. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  6819. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  6820. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  6821. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  6822. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  6823. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  6824. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  6825. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  6826. do { \
  6827. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  6828. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  6829. } while (0)
  6830. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  6831. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  6832. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  6833. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  6834. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  6835. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  6836. /**
  6837. * @brief target -> host message specifying security parameters
  6838. *
  6839. * @details
  6840. * The following diagram shows the format of the security specification
  6841. * message sent from the target to the host.
  6842. * This security specification message tells the host whether a PN check is
  6843. * necessary on rx data frames, and if so, how large the PN counter is.
  6844. * This message also tells the host about the security processing to apply
  6845. * to defragmented rx frames - specifically, whether a Message Integrity
  6846. * Check is required, and the Michael key to use.
  6847. *
  6848. * |31 24|23 16|15|14 8|7 0|
  6849. * |-----------------------------------------------------------------------|
  6850. * | peer ID | U| security type | msg type |
  6851. * |-----------------------------------------------------------------------|
  6852. * | Michael Key K0 |
  6853. * |-----------------------------------------------------------------------|
  6854. * | Michael Key K1 |
  6855. * |-----------------------------------------------------------------------|
  6856. * | WAPI RSC Low0 |
  6857. * |-----------------------------------------------------------------------|
  6858. * | WAPI RSC Low1 |
  6859. * |-----------------------------------------------------------------------|
  6860. * | WAPI RSC Hi0 |
  6861. * |-----------------------------------------------------------------------|
  6862. * | WAPI RSC Hi1 |
  6863. * |-----------------------------------------------------------------------|
  6864. *
  6865. * The following field definitions describe the format of the security
  6866. * indication message sent from the target to the host.
  6867. * - MSG_TYPE
  6868. * Bits 7:0
  6869. * Purpose: identifies this as a security specification message
  6870. * Value: 0xb
  6871. * - SEC_TYPE
  6872. * Bits 14:8
  6873. * Purpose: specifies which type of security applies to the peer
  6874. * Value: htt_sec_type enum value
  6875. * - UNICAST
  6876. * Bit 15
  6877. * Purpose: whether this security is applied to unicast or multicast data
  6878. * Value: 1 -> unicast, 0 -> multicast
  6879. * - PEER_ID
  6880. * Bits 31:16
  6881. * Purpose: The ID number for the peer the security specification is for
  6882. * Value: peer ID
  6883. * - MICHAEL_KEY_K0
  6884. * Bits 31:0
  6885. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  6886. * Value: Michael Key K0 (if security type is TKIP)
  6887. * - MICHAEL_KEY_K1
  6888. * Bits 31:0
  6889. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  6890. * Value: Michael Key K1 (if security type is TKIP)
  6891. * - WAPI_RSC_LOW0
  6892. * Bits 31:0
  6893. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  6894. * Value: WAPI RSC Low0 (if security type is WAPI)
  6895. * - WAPI_RSC_LOW1
  6896. * Bits 31:0
  6897. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  6898. * Value: WAPI RSC Low1 (if security type is WAPI)
  6899. * - WAPI_RSC_HI0
  6900. * Bits 31:0
  6901. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  6902. * Value: WAPI RSC Hi0 (if security type is WAPI)
  6903. * - WAPI_RSC_HI1
  6904. * Bits 31:0
  6905. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  6906. * Value: WAPI RSC Hi1 (if security type is WAPI)
  6907. */
  6908. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  6909. #define HTT_SEC_IND_SEC_TYPE_S 8
  6910. #define HTT_SEC_IND_UNICAST_M 0x00008000
  6911. #define HTT_SEC_IND_UNICAST_S 15
  6912. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  6913. #define HTT_SEC_IND_PEER_ID_S 16
  6914. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  6915. do { \
  6916. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  6917. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  6918. } while (0)
  6919. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  6920. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  6921. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  6922. do { \
  6923. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  6924. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  6925. } while (0)
  6926. #define HTT_SEC_IND_UNICAST_GET(word) \
  6927. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  6928. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  6929. do { \
  6930. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  6931. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  6932. } while (0)
  6933. #define HTT_SEC_IND_PEER_ID_GET(word) \
  6934. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  6935. #define HTT_SEC_IND_BYTES 28
  6936. /**
  6937. * @brief target -> host rx ADDBA / DELBA message definitions
  6938. *
  6939. * @details
  6940. * The following diagram shows the format of the rx ADDBA message sent
  6941. * from the target to the host:
  6942. *
  6943. * |31 20|19 16|15 8|7 0|
  6944. * |---------------------------------------------------------------------|
  6945. * | peer ID | TID | window size | msg type |
  6946. * |---------------------------------------------------------------------|
  6947. *
  6948. * The following diagram shows the format of the rx DELBA message sent
  6949. * from the target to the host:
  6950. *
  6951. * |31 20|19 16|15 8|7 0|
  6952. * |---------------------------------------------------------------------|
  6953. * | peer ID | TID | reserved | msg type |
  6954. * |---------------------------------------------------------------------|
  6955. *
  6956. * The following field definitions describe the format of the rx ADDBA
  6957. * and DELBA messages sent from the target to the host.
  6958. * - MSG_TYPE
  6959. * Bits 7:0
  6960. * Purpose: identifies this as an rx ADDBA or DELBA message
  6961. * Value: ADDBA -> 0x5, DELBA -> 0x6
  6962. * - WIN_SIZE
  6963. * Bits 15:8 (ADDBA only)
  6964. * Purpose: Specifies the length of the block ack window (max = 64).
  6965. * Value:
  6966. * block ack window length specified by the received ADDBA
  6967. * management message.
  6968. * - TID
  6969. * Bits 19:16
  6970. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  6971. * Value:
  6972. * TID specified by the received ADDBA or DELBA management message.
  6973. * - PEER_ID
  6974. * Bits 31:20
  6975. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  6976. * Value:
  6977. * ID (hash value) used by the host for fast, direct lookup of
  6978. * host SW peer info, including rx reorder states.
  6979. */
  6980. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  6981. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  6982. #define HTT_RX_ADDBA_TID_M 0xf0000
  6983. #define HTT_RX_ADDBA_TID_S 16
  6984. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  6985. #define HTT_RX_ADDBA_PEER_ID_S 20
  6986. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  6987. do { \
  6988. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  6989. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  6990. } while (0)
  6991. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  6992. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  6993. #define HTT_RX_ADDBA_TID_SET(word, value) \
  6994. do { \
  6995. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  6996. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  6997. } while (0)
  6998. #define HTT_RX_ADDBA_TID_GET(word) \
  6999. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  7000. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  7001. do { \
  7002. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  7003. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  7004. } while (0)
  7005. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  7006. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  7007. #define HTT_RX_ADDBA_BYTES 4
  7008. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  7009. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  7010. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  7011. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  7012. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  7013. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  7014. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  7015. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  7016. #define HTT_RX_DELBA_BYTES 4
  7017. /**
  7018. * @brief tx queue group information element definition
  7019. *
  7020. * @details
  7021. * The following diagram shows the format of the tx queue group
  7022. * information element, which can be included in target --> host
  7023. * messages to specify the number of tx "credits" (tx descriptors
  7024. * for LL, or tx buffers for HL) available to a particular group
  7025. * of host-side tx queues, and which host-side tx queues belong to
  7026. * the group.
  7027. *
  7028. * |31|30 24|23 16|15|14|13 0|
  7029. * |------------------------------------------------------------------------|
  7030. * | X| reserved | tx queue grp ID | A| S| credit count |
  7031. * |------------------------------------------------------------------------|
  7032. * | vdev ID mask | AC mask |
  7033. * |------------------------------------------------------------------------|
  7034. *
  7035. * The following definitions describe the fields within the tx queue group
  7036. * information element:
  7037. * - credit_count
  7038. * Bits 13:1
  7039. * Purpose: specify how many tx credits are available to the tx queue group
  7040. * Value: An absolute or relative, positive or negative credit value
  7041. * The 'A' bit specifies whether the value is absolute or relative.
  7042. * The 'S' bit specifies whether the value is positive or negative.
  7043. * A negative value can only be relative, not absolute.
  7044. * An absolute value replaces any prior credit value the host has for
  7045. * the tx queue group in question.
  7046. * A relative value is added to the prior credit value the host has for
  7047. * the tx queue group in question.
  7048. * - sign
  7049. * Bit 14
  7050. * Purpose: specify whether the credit count is positive or negative
  7051. * Value: 0 -> positive, 1 -> negative
  7052. * - absolute
  7053. * Bit 15
  7054. * Purpose: specify whether the credit count is absolute or relative
  7055. * Value: 0 -> relative, 1 -> absolute
  7056. * - txq_group_id
  7057. * Bits 23:16
  7058. * Purpose: indicate which tx queue group's credit and/or membership are
  7059. * being specified
  7060. * Value: 0 to max_tx_queue_groups-1
  7061. * - reserved
  7062. * Bits 30:16
  7063. * Value: 0x0
  7064. * - eXtension
  7065. * Bit 31
  7066. * Purpose: specify whether another tx queue group info element follows
  7067. * Value: 0 -> no more tx queue group information elements
  7068. * 1 -> another tx queue group information element immediately follows
  7069. * - ac_mask
  7070. * Bits 15:0
  7071. * Purpose: specify which Access Categories belong to the tx queue group
  7072. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  7073. * the tx queue group.
  7074. * The AC bit-mask values are obtained by left-shifting by the
  7075. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  7076. * - vdev_id_mask
  7077. * Bits 31:16
  7078. * Purpose: specify which vdev's tx queues belong to the tx queue group
  7079. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  7080. * belong to the tx queue group.
  7081. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  7082. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  7083. */
  7084. PREPACK struct htt_txq_group {
  7085. A_UINT32
  7086. credit_count: 14,
  7087. sign: 1,
  7088. absolute: 1,
  7089. tx_queue_group_id: 8,
  7090. reserved0: 7,
  7091. extension: 1;
  7092. A_UINT32
  7093. ac_mask: 16,
  7094. vdev_id_mask: 16;
  7095. } POSTPACK;
  7096. /* first word */
  7097. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  7098. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  7099. #define HTT_TXQ_GROUP_SIGN_S 14
  7100. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  7101. #define HTT_TXQ_GROUP_ABS_S 15
  7102. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  7103. #define HTT_TXQ_GROUP_ID_S 16
  7104. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  7105. #define HTT_TXQ_GROUP_EXT_S 31
  7106. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  7107. /* second word */
  7108. #define HTT_TXQ_GROUP_AC_MASK_S 0
  7109. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  7110. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  7111. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  7112. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  7113. do { \
  7114. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  7115. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  7116. } while (0)
  7117. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  7118. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  7119. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  7120. do { \
  7121. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  7122. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  7123. } while (0)
  7124. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  7125. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  7126. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  7127. do { \
  7128. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  7129. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  7130. } while (0)
  7131. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  7132. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  7133. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  7134. do { \
  7135. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  7136. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  7137. } while (0)
  7138. #define HTT_TXQ_GROUP_ID_GET(_info) \
  7139. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  7140. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  7141. do { \
  7142. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  7143. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  7144. } while (0)
  7145. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  7146. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  7147. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  7148. do { \
  7149. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  7150. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  7151. } while (0)
  7152. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  7153. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  7154. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  7155. do { \
  7156. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  7157. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  7158. } while (0)
  7159. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  7160. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  7161. /**
  7162. * @brief target -> host TX completion indication message definition
  7163. *
  7164. * @details
  7165. * The following diagram shows the format of the TX completion indication sent
  7166. * from the target to the host
  7167. *
  7168. * |31 27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  7169. * |------------------------------------------------------------|
  7170. * header: | rsvd |TP|A1|A0| num | t_i| tid |status| msg_type |
  7171. * |------------------------------------------------------------|
  7172. * payload: | MSDU1 ID | MSDU0 ID |
  7173. * |------------------------------------------------------------|
  7174. * : MSDU3 ID : MSDU2 ID :
  7175. * |------------------------------------------------------------|
  7176. * | struct htt_tx_compl_ind_append_retries |
  7177. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7178. * | struct htt_tx_compl_ind_append_tx_tstamp |
  7179. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7180. * Where:
  7181. * A0 = append (a.k.a. append0)
  7182. * A1 = append1
  7183. * TP = MSDU tx power presence
  7184. *
  7185. * The following field definitions describe the format of the TX completion
  7186. * indication sent from the target to the host
  7187. * Header fields:
  7188. * - msg_type
  7189. * Bits 7:0
  7190. * Purpose: identifies this as HTT TX completion indication
  7191. * Value: 0x7
  7192. * - status
  7193. * Bits 10:8
  7194. * Purpose: the TX completion status of payload fragmentations descriptors
  7195. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  7196. * - tid
  7197. * Bits 14:11
  7198. * Purpose: the tid associated with those fragmentation descriptors. It is
  7199. * valid or not, depending on the tid_invalid bit.
  7200. * Value: 0 to 15
  7201. * - tid_invalid
  7202. * Bits 15:15
  7203. * Purpose: this bit indicates whether the tid field is valid or not
  7204. * Value: 0 indicates valid; 1 indicates invalid
  7205. * - num
  7206. * Bits 23:16
  7207. * Purpose: the number of payload in this indication
  7208. * Value: 1 to 255
  7209. * - append (a.k.a. append0)
  7210. * Bits 24:24
  7211. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  7212. * the number of tx retries for one MSDU at the end of this message
  7213. * Value: 0 indicates no appending; 1 indicates appending
  7214. * - append1
  7215. * Bits 25:25
  7216. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  7217. * contains the timestamp info for each TX msdu id in payload.
  7218. * The order of the timestamps matches the order of the MSDU IDs.
  7219. * Note that a big-endian host needs to account for the reordering
  7220. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  7221. * conversion) when determining which tx timestamp corresponds to
  7222. * which MSDU ID.
  7223. * Value: 0 indicates no appending; 1 indicates appending
  7224. * - msdu_tx_power_presence
  7225. * Bits 26:26
  7226. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  7227. * for each MSDU referenced by the TX_COMPL_IND message.
  7228. * The tx power is reported in 0.5 dBm units.
  7229. * The order of the per-MSDU tx power reports matches the order
  7230. * of the MSDU IDs.
  7231. * Note that a big-endian host needs to account for the reordering
  7232. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  7233. * conversion) when determining which Tx Power corresponds to
  7234. * which MSDU ID.
  7235. * Value: 0 indicates MSDU tx power reports are not appended,
  7236. * 1 indicates MSDU tx power reports are appended
  7237. * Payload fields:
  7238. * - hmsdu_id
  7239. * Bits 15:0
  7240. * Purpose: this ID is used to track the Tx buffer in host
  7241. * Value: 0 to "size of host MSDU descriptor pool - 1"
  7242. */
  7243. #define HTT_TX_COMPL_IND_STATUS_S 8
  7244. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  7245. #define HTT_TX_COMPL_IND_TID_S 11
  7246. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  7247. #define HTT_TX_COMPL_IND_TID_INV_S 15
  7248. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  7249. #define HTT_TX_COMPL_IND_NUM_S 16
  7250. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  7251. #define HTT_TX_COMPL_IND_APPEND_S 24
  7252. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  7253. #define HTT_TX_COMPL_IND_APPEND1_S 25
  7254. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  7255. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  7256. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  7257. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  7258. do { \
  7259. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  7260. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  7261. } while (0)
  7262. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  7263. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  7264. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  7265. do { \
  7266. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  7267. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  7268. } while (0)
  7269. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  7270. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  7271. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  7272. do { \
  7273. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  7274. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  7275. } while (0)
  7276. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  7277. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  7278. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  7279. do { \
  7280. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  7281. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  7282. } while (0)
  7283. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  7284. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  7285. HTT_TX_COMPL_IND_TID_INV_S)
  7286. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  7287. do { \
  7288. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  7289. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  7290. } while (0)
  7291. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  7292. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  7293. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  7294. do { \
  7295. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  7296. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  7297. } while (0)
  7298. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  7299. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  7300. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  7301. do { \
  7302. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  7303. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  7304. } while (0)
  7305. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  7306. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  7307. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  7308. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  7309. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  7310. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  7311. #define HTT_TX_COMPL_IND_STAT_OK 0
  7312. /* DISCARD:
  7313. * current meaning:
  7314. * MSDUs were queued for transmission but filtered by HW or SW
  7315. * without any over the air attempts
  7316. * legacy meaning (HL Rome):
  7317. * MSDUs were discarded by the target FW without any over the air
  7318. * attempts due to lack of space
  7319. */
  7320. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  7321. /* NO_ACK:
  7322. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  7323. */
  7324. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  7325. /* POSTPONE:
  7326. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  7327. * be downloaded again later (in the appropriate order), when they are
  7328. * deliverable.
  7329. */
  7330. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  7331. /*
  7332. * The PEER_DEL tx completion status is used for HL cases
  7333. * where the peer the frame is for has been deleted.
  7334. * The host has already discarded its copy of the frame, but
  7335. * it still needs the tx completion to restore its credit.
  7336. */
  7337. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  7338. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  7339. #define HTT_TX_COMPL_IND_STAT_DROP 5
  7340. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  7341. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  7342. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  7343. PREPACK struct htt_tx_compl_ind_base {
  7344. A_UINT32 hdr;
  7345. A_UINT16 payload[1/*or more*/];
  7346. } POSTPACK;
  7347. PREPACK struct htt_tx_compl_ind_append_retries {
  7348. A_UINT16 msdu_id;
  7349. A_UINT8 tx_retries;
  7350. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  7351. 0: this is the last append_retries struct */
  7352. } POSTPACK;
  7353. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  7354. A_UINT32 timestamp[1/*or more*/];
  7355. } POSTPACK;
  7356. /**
  7357. * @brief target -> host rate-control update indication message
  7358. *
  7359. * @details
  7360. * The following diagram shows the format of the RC Update message
  7361. * sent from the target to the host, while processing the tx-completion
  7362. * of a transmitted PPDU.
  7363. *
  7364. * |31 24|23 16|15 8|7 0|
  7365. * |-------------------------------------------------------------|
  7366. * | peer ID | vdev ID | msg_type |
  7367. * |-------------------------------------------------------------|
  7368. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  7369. * |-------------------------------------------------------------|
  7370. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  7371. * |-------------------------------------------------------------|
  7372. * | : |
  7373. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  7374. * | : |
  7375. * |-------------------------------------------------------------|
  7376. * | : |
  7377. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  7378. * | : |
  7379. * |-------------------------------------------------------------|
  7380. * : :
  7381. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  7382. *
  7383. */
  7384. typedef struct {
  7385. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  7386. A_UINT32 rate_code_flags;
  7387. A_UINT32 flags; /* Encodes information such as excessive
  7388. retransmission, aggregate, some info
  7389. from .11 frame control,
  7390. STBC, LDPC, (SGI and Tx Chain Mask
  7391. are encoded in ptx_rc->flags field),
  7392. AMPDU truncation (BT/time based etc.),
  7393. RTS/CTS attempt */
  7394. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  7395. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  7396. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  7397. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  7398. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  7399. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  7400. } HTT_RC_TX_DONE_PARAMS;
  7401. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  7402. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  7403. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  7404. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  7405. #define HTT_RC_UPDATE_VDEVID_S 8
  7406. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  7407. #define HTT_RC_UPDATE_PEERID_S 16
  7408. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  7409. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  7410. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  7411. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  7412. do { \
  7413. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  7414. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  7415. } while (0)
  7416. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  7417. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  7418. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  7419. do { \
  7420. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  7421. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  7422. } while (0)
  7423. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  7424. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  7425. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  7426. do { \
  7427. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  7428. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  7429. } while (0)
  7430. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  7431. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  7432. /**
  7433. * @brief target -> host rx fragment indication message definition
  7434. *
  7435. * @details
  7436. * The following field definitions describe the format of the rx fragment
  7437. * indication message sent from the target to the host.
  7438. * The rx fragment indication message shares the format of the
  7439. * rx indication message, but not all fields from the rx indication message
  7440. * are relevant to the rx fragment indication message.
  7441. *
  7442. *
  7443. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  7444. * |-----------+-------------------+---------------------+-------------|
  7445. * | peer ID | |FV| ext TID | msg type |
  7446. * |-------------------------------------------------------------------|
  7447. * | | flush | flush |
  7448. * | | end | start |
  7449. * | | seq num | seq num |
  7450. * |-------------------------------------------------------------------|
  7451. * | reserved | FW rx desc bytes |
  7452. * |-------------------------------------------------------------------|
  7453. * | | FW MSDU Rx |
  7454. * | | desc B0 |
  7455. * |-------------------------------------------------------------------|
  7456. * Header fields:
  7457. * - MSG_TYPE
  7458. * Bits 7:0
  7459. * Purpose: identifies this as an rx fragment indication message
  7460. * Value: 0xa
  7461. * - EXT_TID
  7462. * Bits 12:8
  7463. * Purpose: identify the traffic ID of the rx data, including
  7464. * special "extended" TID values for multicast, broadcast, and
  7465. * non-QoS data frames
  7466. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  7467. * - FLUSH_VALID (FV)
  7468. * Bit 13
  7469. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  7470. * is valid
  7471. * Value:
  7472. * 1 -> flush IE is valid and needs to be processed
  7473. * 0 -> flush IE is not valid and should be ignored
  7474. * - PEER_ID
  7475. * Bits 31:16
  7476. * Purpose: Identify, by ID, which peer sent the rx data
  7477. * Value: ID of the peer who sent the rx data
  7478. * - FLUSH_SEQ_NUM_START
  7479. * Bits 5:0
  7480. * Purpose: Indicate the start of a series of MPDUs to flush
  7481. * Not all MPDUs within this series are necessarily valid - the host
  7482. * must check each sequence number within this range to see if the
  7483. * corresponding MPDU is actually present.
  7484. * This field is only valid if the FV bit is set.
  7485. * Value:
  7486. * The sequence number for the first MPDUs to check to flush.
  7487. * The sequence number is masked by 0x3f.
  7488. * - FLUSH_SEQ_NUM_END
  7489. * Bits 11:6
  7490. * Purpose: Indicate the end of a series of MPDUs to flush
  7491. * Value:
  7492. * The sequence number one larger than the sequence number of the
  7493. * last MPDU to check to flush.
  7494. * The sequence number is masked by 0x3f.
  7495. * Not all MPDUs within this series are necessarily valid - the host
  7496. * must check each sequence number within this range to see if the
  7497. * corresponding MPDU is actually present.
  7498. * This field is only valid if the FV bit is set.
  7499. * Rx descriptor fields:
  7500. * - FW_RX_DESC_BYTES
  7501. * Bits 15:0
  7502. * Purpose: Indicate how many bytes in the Rx indication are used for
  7503. * FW Rx descriptors
  7504. * Value: 1
  7505. */
  7506. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  7507. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  7508. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  7509. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  7510. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  7511. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  7512. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  7513. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  7514. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  7515. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  7516. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  7517. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  7518. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  7519. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  7520. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  7521. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  7522. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  7523. #define HTT_RX_FRAG_IND_BYTES \
  7524. (4 /* msg hdr */ + \
  7525. 4 /* flush spec */ + \
  7526. 4 /* (unused) FW rx desc bytes spec */ + \
  7527. 4 /* FW rx desc */)
  7528. /**
  7529. * @brief target -> host test message definition
  7530. *
  7531. * @details
  7532. * The following field definitions describe the format of the test
  7533. * message sent from the target to the host.
  7534. * The message consists of a 4-octet header, followed by a variable
  7535. * number of 32-bit integer values, followed by a variable number
  7536. * of 8-bit character values.
  7537. *
  7538. * |31 16|15 8|7 0|
  7539. * |-----------------------------------------------------------|
  7540. * | num chars | num ints | msg type |
  7541. * |-----------------------------------------------------------|
  7542. * | int 0 |
  7543. * |-----------------------------------------------------------|
  7544. * | int 1 |
  7545. * |-----------------------------------------------------------|
  7546. * | ... |
  7547. * |-----------------------------------------------------------|
  7548. * | char 3 | char 2 | char 1 | char 0 |
  7549. * |-----------------------------------------------------------|
  7550. * | | | ... | char 4 |
  7551. * |-----------------------------------------------------------|
  7552. * - MSG_TYPE
  7553. * Bits 7:0
  7554. * Purpose: identifies this as a test message
  7555. * Value: HTT_MSG_TYPE_TEST
  7556. * - NUM_INTS
  7557. * Bits 15:8
  7558. * Purpose: indicate how many 32-bit integers follow the message header
  7559. * - NUM_CHARS
  7560. * Bits 31:16
  7561. * Purpose: indicate how many 8-bit charaters follow the series of integers
  7562. */
  7563. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  7564. #define HTT_RX_TEST_NUM_INTS_S 8
  7565. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  7566. #define HTT_RX_TEST_NUM_CHARS_S 16
  7567. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  7568. do { \
  7569. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  7570. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  7571. } while (0)
  7572. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  7573. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  7574. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  7575. do { \
  7576. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  7577. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  7578. } while (0)
  7579. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  7580. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  7581. /**
  7582. * @brief target -> host packet log message
  7583. *
  7584. * @details
  7585. * The following field definitions describe the format of the packet log
  7586. * message sent from the target to the host.
  7587. * The message consists of a 4-octet header,followed by a variable number
  7588. * of 32-bit character values.
  7589. *
  7590. * |31 16|15 12|11 10|9 8|7 0|
  7591. * |------------------------------------------------------------------|
  7592. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  7593. * |------------------------------------------------------------------|
  7594. * | payload |
  7595. * |------------------------------------------------------------------|
  7596. * - MSG_TYPE
  7597. * Bits 7:0
  7598. * Purpose: identifies this as a pktlog message
  7599. * Value: HTT_T2H_MSG_TYPE_PKTLOG
  7600. * - mac_id
  7601. * Bits 9:8
  7602. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  7603. * Value: 0-3
  7604. * - pdev_id
  7605. * Bits 11:10
  7606. * Purpose: pdev_id
  7607. * Value: 0-3
  7608. * 0 (for rings at SOC level),
  7609. * 1/2/3 PDEV -> 0/1/2
  7610. * - payload_size
  7611. * Bits 31:16
  7612. * Purpose: explicitly specify the payload size
  7613. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  7614. */
  7615. PREPACK struct htt_pktlog_msg {
  7616. A_UINT32 header;
  7617. A_UINT32 payload[1/* or more */];
  7618. } POSTPACK;
  7619. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  7620. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  7621. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  7622. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  7623. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  7624. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  7625. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  7626. do { \
  7627. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  7628. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  7629. } while (0)
  7630. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  7631. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  7632. HTT_T2H_PKTLOG_MAC_ID_S)
  7633. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  7634. do { \
  7635. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  7636. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  7637. } while (0)
  7638. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  7639. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  7640. HTT_T2H_PKTLOG_PDEV_ID_S)
  7641. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  7642. do { \
  7643. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  7644. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  7645. } while (0)
  7646. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  7647. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  7648. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  7649. /*
  7650. * Rx reorder statistics
  7651. * NB: all the fields must be defined in 4 octets size.
  7652. */
  7653. struct rx_reorder_stats {
  7654. /* Non QoS MPDUs received */
  7655. A_UINT32 deliver_non_qos;
  7656. /* MPDUs received in-order */
  7657. A_UINT32 deliver_in_order;
  7658. /* Flush due to reorder timer expired */
  7659. A_UINT32 deliver_flush_timeout;
  7660. /* Flush due to move out of window */
  7661. A_UINT32 deliver_flush_oow;
  7662. /* Flush due to DELBA */
  7663. A_UINT32 deliver_flush_delba;
  7664. /* MPDUs dropped due to FCS error */
  7665. A_UINT32 fcs_error;
  7666. /* MPDUs dropped due to monitor mode non-data packet */
  7667. A_UINT32 mgmt_ctrl;
  7668. /* Unicast-data MPDUs dropped due to invalid peer */
  7669. A_UINT32 invalid_peer;
  7670. /* MPDUs dropped due to duplication (non aggregation) */
  7671. A_UINT32 dup_non_aggr;
  7672. /* MPDUs dropped due to processed before */
  7673. A_UINT32 dup_past;
  7674. /* MPDUs dropped due to duplicate in reorder queue */
  7675. A_UINT32 dup_in_reorder;
  7676. /* Reorder timeout happened */
  7677. A_UINT32 reorder_timeout;
  7678. /* invalid bar ssn */
  7679. A_UINT32 invalid_bar_ssn;
  7680. /* reorder reset due to bar ssn */
  7681. A_UINT32 ssn_reset;
  7682. /* Flush due to delete peer */
  7683. A_UINT32 deliver_flush_delpeer;
  7684. /* Flush due to offload*/
  7685. A_UINT32 deliver_flush_offload;
  7686. /* Flush due to out of buffer*/
  7687. A_UINT32 deliver_flush_oob;
  7688. /* MPDUs dropped due to PN check fail */
  7689. A_UINT32 pn_fail;
  7690. /* MPDUs dropped due to unable to allocate memory */
  7691. A_UINT32 store_fail;
  7692. /* Number of times the tid pool alloc succeeded */
  7693. A_UINT32 tid_pool_alloc_succ;
  7694. /* Number of times the MPDU pool alloc succeeded */
  7695. A_UINT32 mpdu_pool_alloc_succ;
  7696. /* Number of times the MSDU pool alloc succeeded */
  7697. A_UINT32 msdu_pool_alloc_succ;
  7698. /* Number of times the tid pool alloc failed */
  7699. A_UINT32 tid_pool_alloc_fail;
  7700. /* Number of times the MPDU pool alloc failed */
  7701. A_UINT32 mpdu_pool_alloc_fail;
  7702. /* Number of times the MSDU pool alloc failed */
  7703. A_UINT32 msdu_pool_alloc_fail;
  7704. /* Number of times the tid pool freed */
  7705. A_UINT32 tid_pool_free;
  7706. /* Number of times the MPDU pool freed */
  7707. A_UINT32 mpdu_pool_free;
  7708. /* Number of times the MSDU pool freed */
  7709. A_UINT32 msdu_pool_free;
  7710. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  7711. A_UINT32 msdu_queued;
  7712. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  7713. A_UINT32 msdu_recycled;
  7714. /* Number of MPDUs with invalid peer but A2 found in AST */
  7715. A_UINT32 invalid_peer_a2_in_ast;
  7716. /* Number of MPDUs with invalid peer but A3 found in AST */
  7717. A_UINT32 invalid_peer_a3_in_ast;
  7718. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  7719. A_UINT32 invalid_peer_bmc_mpdus;
  7720. /* Number of MSDUs with err attention word */
  7721. A_UINT32 rxdesc_err_att;
  7722. /* Number of MSDUs with flag of peer_idx_invalid */
  7723. A_UINT32 rxdesc_err_peer_idx_inv;
  7724. /* Number of MSDUs with flag of peer_idx_timeout */
  7725. A_UINT32 rxdesc_err_peer_idx_to;
  7726. /* Number of MSDUs with flag of overflow */
  7727. A_UINT32 rxdesc_err_ov;
  7728. /* Number of MSDUs with flag of msdu_length_err */
  7729. A_UINT32 rxdesc_err_msdu_len;
  7730. /* Number of MSDUs with flag of mpdu_length_err */
  7731. A_UINT32 rxdesc_err_mpdu_len;
  7732. /* Number of MSDUs with flag of tkip_mic_err */
  7733. A_UINT32 rxdesc_err_tkip_mic;
  7734. /* Number of MSDUs with flag of decrypt_err */
  7735. A_UINT32 rxdesc_err_decrypt;
  7736. /* Number of MSDUs with flag of fcs_err */
  7737. A_UINT32 rxdesc_err_fcs;
  7738. /* Number of Unicast (bc_mc bit is not set in attention word)
  7739. * frames with invalid peer handler
  7740. */
  7741. A_UINT32 rxdesc_uc_msdus_inv_peer;
  7742. /* Number of unicast frame directly (direct bit is set in attention word)
  7743. * to DUT with invalid peer handler
  7744. */
  7745. A_UINT32 rxdesc_direct_msdus_inv_peer;
  7746. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  7747. * frames with invalid peer handler
  7748. */
  7749. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  7750. /* Number of MSDUs dropped due to no first MSDU flag */
  7751. A_UINT32 rxdesc_no_1st_msdu;
  7752. /* Number of MSDUs droped due to ring overflow */
  7753. A_UINT32 msdu_drop_ring_ov;
  7754. /* Number of MSDUs dropped due to FC mismatch */
  7755. A_UINT32 msdu_drop_fc_mismatch;
  7756. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  7757. A_UINT32 msdu_drop_mgmt_remote_ring;
  7758. /* Number of MSDUs dropped due to errors not reported in attention word */
  7759. A_UINT32 msdu_drop_misc;
  7760. /* Number of MSDUs go to offload before reorder */
  7761. A_UINT32 offload_msdu_wal;
  7762. /* Number of data frame dropped by offload after reorder */
  7763. A_UINT32 offload_msdu_reorder;
  7764. /* Number of MPDUs with sequence number in the past and within the BA window */
  7765. A_UINT32 dup_past_within_window;
  7766. /* Number of MPDUs with sequence number in the past and outside the BA window */
  7767. A_UINT32 dup_past_outside_window;
  7768. /* Number of MSDUs with decrypt/MIC error */
  7769. A_UINT32 rxdesc_err_decrypt_mic;
  7770. /* Number of data MSDUs received on both local and remote rings */
  7771. A_UINT32 data_msdus_on_both_rings;
  7772. /* MPDUs never filled */
  7773. A_UINT32 holes_not_filled;
  7774. };
  7775. /*
  7776. * Rx Remote buffer statistics
  7777. * NB: all the fields must be defined in 4 octets size.
  7778. */
  7779. struct rx_remote_buffer_mgmt_stats {
  7780. /* Total number of MSDUs reaped for Rx processing */
  7781. A_UINT32 remote_reaped;
  7782. /* MSDUs recycled within firmware */
  7783. A_UINT32 remote_recycled;
  7784. /* MSDUs stored by Data Rx */
  7785. A_UINT32 data_rx_msdus_stored;
  7786. /* Number of HTT indications from WAL Rx MSDU */
  7787. A_UINT32 wal_rx_ind;
  7788. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  7789. A_UINT32 wal_rx_ind_unconsumed;
  7790. /* Number of HTT indications from Data Rx MSDU */
  7791. A_UINT32 data_rx_ind;
  7792. /* Number of unconsumed HTT indications from Data Rx MSDU */
  7793. A_UINT32 data_rx_ind_unconsumed;
  7794. /* Number of HTT indications from ATHBUF */
  7795. A_UINT32 athbuf_rx_ind;
  7796. /* Number of remote buffers requested for refill */
  7797. A_UINT32 refill_buf_req;
  7798. /* Number of remote buffers filled by the host */
  7799. A_UINT32 refill_buf_rsp;
  7800. /* Number of times MAC hw_index = f/w write_index */
  7801. A_INT32 mac_no_bufs;
  7802. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  7803. A_INT32 fw_indices_equal;
  7804. /* Number of times f/w finds no buffers to post */
  7805. A_INT32 host_no_bufs;
  7806. };
  7807. /*
  7808. * TXBF MU/SU packets and NDPA statistics
  7809. * NB: all the fields must be defined in 4 octets size.
  7810. */
  7811. struct rx_txbf_musu_ndpa_pkts_stats {
  7812. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  7813. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  7814. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  7815. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  7816. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  7817. A_UINT32 reserved[3]; /* must be set to 0x0 */
  7818. };
  7819. /*
  7820. * htt_dbg_stats_status -
  7821. * present - The requested stats have been delivered in full.
  7822. * This indicates that either the stats information was contained
  7823. * in its entirety within this message, or else this message
  7824. * completes the delivery of the requested stats info that was
  7825. * partially delivered through earlier STATS_CONF messages.
  7826. * partial - The requested stats have been delivered in part.
  7827. * One or more subsequent STATS_CONF messages with the same
  7828. * cookie value will be sent to deliver the remainder of the
  7829. * information.
  7830. * error - The requested stats could not be delivered, for example due
  7831. * to a shortage of memory to construct a message holding the
  7832. * requested stats.
  7833. * invalid - The requested stat type is either not recognized, or the
  7834. * target is configured to not gather the stats type in question.
  7835. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  7836. * series_done - This special value indicates that no further stats info
  7837. * elements are present within a series of stats info elems
  7838. * (within a stats upload confirmation message).
  7839. */
  7840. enum htt_dbg_stats_status {
  7841. HTT_DBG_STATS_STATUS_PRESENT = 0,
  7842. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  7843. HTT_DBG_STATS_STATUS_ERROR = 2,
  7844. HTT_DBG_STATS_STATUS_INVALID = 3,
  7845. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  7846. };
  7847. /**
  7848. * @brief target -> host statistics upload
  7849. *
  7850. * @details
  7851. * The following field definitions describe the format of the HTT target
  7852. * to host stats upload confirmation message.
  7853. * The message contains a cookie echoed from the HTT host->target stats
  7854. * upload request, which identifies which request the confirmation is
  7855. * for, and a series of tag-length-value stats information elements.
  7856. * The tag-length header for each stats info element also includes a
  7857. * status field, to indicate whether the request for the stat type in
  7858. * question was fully met, partially met, unable to be met, or invalid
  7859. * (if the stat type in question is disabled in the target).
  7860. * A special value of all 1's in this status field is used to indicate
  7861. * the end of the series of stats info elements.
  7862. *
  7863. *
  7864. * |31 16|15 8|7 5|4 0|
  7865. * |------------------------------------------------------------|
  7866. * | reserved | msg type |
  7867. * |------------------------------------------------------------|
  7868. * | cookie LSBs |
  7869. * |------------------------------------------------------------|
  7870. * | cookie MSBs |
  7871. * |------------------------------------------------------------|
  7872. * | stats entry length | reserved | S |stat type|
  7873. * |------------------------------------------------------------|
  7874. * | |
  7875. * | type-specific stats info |
  7876. * | |
  7877. * |------------------------------------------------------------|
  7878. * | stats entry length | reserved | S |stat type|
  7879. * |------------------------------------------------------------|
  7880. * | |
  7881. * | type-specific stats info |
  7882. * | |
  7883. * |------------------------------------------------------------|
  7884. * | n/a | reserved | 111 | n/a |
  7885. * |------------------------------------------------------------|
  7886. * Header fields:
  7887. * - MSG_TYPE
  7888. * Bits 7:0
  7889. * Purpose: identifies this is a statistics upload confirmation message
  7890. * Value: 0x9
  7891. * - COOKIE_LSBS
  7892. * Bits 31:0
  7893. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7894. * message with its preceding host->target stats request message.
  7895. * Value: LSBs of the opaque cookie specified by the host-side requestor
  7896. * - COOKIE_MSBS
  7897. * Bits 31:0
  7898. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7899. * message with its preceding host->target stats request message.
  7900. * Value: MSBs of the opaque cookie specified by the host-side requestor
  7901. *
  7902. * Stats Information Element tag-length header fields:
  7903. * - STAT_TYPE
  7904. * Bits 4:0
  7905. * Purpose: identifies the type of statistics info held in the
  7906. * following information element
  7907. * Value: htt_dbg_stats_type
  7908. * - STATUS
  7909. * Bits 7:5
  7910. * Purpose: indicate whether the requested stats are present
  7911. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  7912. * the completion of the stats entry series
  7913. * - LENGTH
  7914. * Bits 31:16
  7915. * Purpose: indicate the stats information size
  7916. * Value: This field specifies the number of bytes of stats information
  7917. * that follows the element tag-length header.
  7918. * It is expected but not required that this length is a multiple of
  7919. * 4 bytes. Even if the length is not an integer multiple of 4, the
  7920. * subsequent stats entry header will begin on a 4-byte aligned
  7921. * boundary.
  7922. */
  7923. #define HTT_T2H_STATS_COOKIE_SIZE 8
  7924. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  7925. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  7926. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  7927. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  7928. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  7929. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  7930. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  7931. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  7932. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  7933. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  7934. do { \
  7935. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  7936. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  7937. } while (0)
  7938. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  7939. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  7940. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  7941. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  7942. do { \
  7943. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  7944. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  7945. } while (0)
  7946. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  7947. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  7948. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  7949. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  7950. do { \
  7951. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  7952. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  7953. } while (0)
  7954. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  7955. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  7956. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  7957. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  7958. #define HTT_MAX_AGGR 64
  7959. #define HTT_HL_MAX_AGGR 18
  7960. /**
  7961. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  7962. *
  7963. * @details
  7964. * The following field definitions describe the format of the HTT host
  7965. * to target frag_desc/msdu_ext bank configuration message.
  7966. * The message contains the based address and the min and max id of the
  7967. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  7968. * MSDU_EXT/FRAG_DESC.
  7969. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  7970. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  7971. * the hardware does the mapping/translation.
  7972. *
  7973. * Total banks that can be configured is configured to 16.
  7974. *
  7975. * This should be called before any TX has be initiated by the HTT
  7976. *
  7977. * |31 16|15 8|7 5|4 0|
  7978. * |------------------------------------------------------------|
  7979. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  7980. * |------------------------------------------------------------|
  7981. * | BANK0_BASE_ADDRESS (bits 31:0) |
  7982. #if HTT_PADDR64
  7983. * | BANK0_BASE_ADDRESS (bits 63:32) |
  7984. #endif
  7985. * |------------------------------------------------------------|
  7986. * | ... |
  7987. * |------------------------------------------------------------|
  7988. * | BANK15_BASE_ADDRESS (bits 31:0) |
  7989. #if HTT_PADDR64
  7990. * | BANK15_BASE_ADDRESS (bits 63:32) |
  7991. #endif
  7992. * |------------------------------------------------------------|
  7993. * | BANK0_MAX_ID | BANK0_MIN_ID |
  7994. * |------------------------------------------------------------|
  7995. * | ... |
  7996. * |------------------------------------------------------------|
  7997. * | BANK15_MAX_ID | BANK15_MIN_ID |
  7998. * |------------------------------------------------------------|
  7999. * Header fields:
  8000. * - MSG_TYPE
  8001. * Bits 7:0
  8002. * Value: 0x6
  8003. * for systems with 64-bit format for bus addresses:
  8004. * - BANKx_BASE_ADDRESS_LO
  8005. * Bits 31:0
  8006. * Purpose: Provide a mechanism to specify the base address of the
  8007. * MSDU_EXT bank physical/bus address.
  8008. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  8009. * - BANKx_BASE_ADDRESS_HI
  8010. * Bits 31:0
  8011. * Purpose: Provide a mechanism to specify the base address of the
  8012. * MSDU_EXT bank physical/bus address.
  8013. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  8014. * for systems with 32-bit format for bus addresses:
  8015. * - BANKx_BASE_ADDRESS
  8016. * Bits 31:0
  8017. * Purpose: Provide a mechanism to specify the base address of the
  8018. * MSDU_EXT bank physical/bus address.
  8019. * Value: MSDU_EXT bank physical / bus address
  8020. * - BANKx_MIN_ID
  8021. * Bits 15:0
  8022. * Purpose: Provide a mechanism to specify the min index that needs to
  8023. * mapped.
  8024. * - BANKx_MAX_ID
  8025. * Bits 31:16
  8026. * Purpose: Provide a mechanism to specify the max index that needs to
  8027. * mapped.
  8028. *
  8029. */
  8030. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  8031. * safe value.
  8032. * @note MAX supported banks is 16.
  8033. */
  8034. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  8035. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  8036. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  8037. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  8038. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  8039. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  8040. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  8041. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  8042. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  8043. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  8044. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  8045. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  8046. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  8047. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  8048. do { \
  8049. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  8050. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  8051. } while (0)
  8052. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  8053. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  8054. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  8055. do { \
  8056. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  8057. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  8058. } while (0)
  8059. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  8060. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  8061. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  8062. do { \
  8063. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  8064. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  8065. } while (0)
  8066. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  8067. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  8068. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  8069. do { \
  8070. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  8071. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  8072. } while (0)
  8073. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  8074. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  8075. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  8076. do { \
  8077. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  8078. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  8079. } while (0)
  8080. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  8081. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  8082. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  8083. do { \
  8084. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  8085. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  8086. } while (0)
  8087. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  8088. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  8089. /*
  8090. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  8091. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  8092. * addresses are stored in a XXX-bit field.
  8093. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  8094. * htt_tx_frag_desc64_bank_cfg_t structs.
  8095. */
  8096. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  8097. _paddr_bits_, \
  8098. _paddr__bank_base_address_) \
  8099. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  8100. /** word 0 \
  8101. * msg_type: 8, \
  8102. * pdev_id: 2, \
  8103. * swap: 1, \
  8104. * reserved0: 5, \
  8105. * num_banks: 8, \
  8106. * desc_size: 8; \
  8107. */ \
  8108. A_UINT32 word0; \
  8109. /* \
  8110. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  8111. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  8112. * the second A_UINT32). \
  8113. */ \
  8114. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  8115. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  8116. } POSTPACK
  8117. /* define htt_tx_frag_desc32_bank_cfg_t */
  8118. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  8119. /* define htt_tx_frag_desc64_bank_cfg_t */
  8120. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  8121. /*
  8122. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  8123. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  8124. */
  8125. #if HTT_PADDR64
  8126. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  8127. #else
  8128. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  8129. #endif
  8130. /**
  8131. * @brief target -> host HTT TX Credit total count update message definition
  8132. *
  8133. *|31 16|15|14 9| 8 |7 0 |
  8134. *|---------------------+--+----------+-------+----------|
  8135. *|cur htt credit delta | Q| reserved | sign | msg type |
  8136. *|------------------------------------------------------|
  8137. *
  8138. * Header fields:
  8139. * - MSG_TYPE
  8140. * Bits 7:0
  8141. * Purpose: identifies this as a htt tx credit delta update message
  8142. * Value: 0xe
  8143. * - SIGN
  8144. * Bits 8
  8145. * identifies whether credit delta is positive or negative
  8146. * Value:
  8147. * - 0x0: credit delta is positive, rebalance in some buffers
  8148. * - 0x1: credit delta is negative, rebalance out some buffers
  8149. * - reserved
  8150. * Bits 14:9
  8151. * Value: 0x0
  8152. * - TXQ_GRP
  8153. * Bit 15
  8154. * Purpose: indicates whether any tx queue group information elements
  8155. * are appended to the tx credit update message
  8156. * Value: 0 -> no tx queue group information element is present
  8157. * 1 -> a tx queue group information element immediately follows
  8158. * - DELTA_COUNT
  8159. * Bits 31:16
  8160. * Purpose: Specify current htt credit delta absolute count
  8161. */
  8162. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  8163. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  8164. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  8165. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  8166. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  8167. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  8168. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  8169. do { \
  8170. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  8171. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  8172. } while (0)
  8173. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  8174. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  8175. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  8176. do { \
  8177. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  8178. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  8179. } while (0)
  8180. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  8181. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  8182. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  8183. do { \
  8184. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  8185. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  8186. } while (0)
  8187. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  8188. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  8189. #define HTT_TX_CREDIT_MSG_BYTES 4
  8190. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  8191. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  8192. /**
  8193. * @brief HTT WDI_IPA Operation Response Message
  8194. *
  8195. * @details
  8196. * HTT WDI_IPA Operation Response message is sent by target
  8197. * to host confirming suspend or resume operation.
  8198. * |31 24|23 16|15 8|7 0|
  8199. * |----------------+----------------+----------------+----------------|
  8200. * | op_code | Rsvd | msg_type |
  8201. * |-------------------------------------------------------------------|
  8202. * | Rsvd | Response len |
  8203. * |-------------------------------------------------------------------|
  8204. * | |
  8205. * | Response-type specific info |
  8206. * | |
  8207. * | |
  8208. * |-------------------------------------------------------------------|
  8209. * Header fields:
  8210. * - MSG_TYPE
  8211. * Bits 7:0
  8212. * Purpose: Identifies this as WDI_IPA Operation Response message
  8213. * value: = 0x13
  8214. * - OP_CODE
  8215. * Bits 31:16
  8216. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  8217. * value: = enum htt_wdi_ipa_op_code
  8218. * - RSP_LEN
  8219. * Bits 16:0
  8220. * Purpose: length for the response-type specific info
  8221. * value: = length in bytes for response-type specific info
  8222. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  8223. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  8224. */
  8225. PREPACK struct htt_wdi_ipa_op_response_t
  8226. {
  8227. /* DWORD 0: flags and meta-data */
  8228. A_UINT32
  8229. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  8230. reserved1: 8,
  8231. op_code: 16;
  8232. A_UINT32
  8233. rsp_len: 16,
  8234. reserved2: 16;
  8235. } POSTPACK;
  8236. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  8237. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  8238. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  8239. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  8240. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  8241. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  8242. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  8243. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  8244. do { \
  8245. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  8246. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  8247. } while (0)
  8248. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  8249. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  8250. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  8251. do { \
  8252. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  8253. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  8254. } while (0)
  8255. enum htt_phy_mode {
  8256. htt_phy_mode_11a = 0,
  8257. htt_phy_mode_11g = 1,
  8258. htt_phy_mode_11b = 2,
  8259. htt_phy_mode_11g_only = 3,
  8260. htt_phy_mode_11na_ht20 = 4,
  8261. htt_phy_mode_11ng_ht20 = 5,
  8262. htt_phy_mode_11na_ht40 = 6,
  8263. htt_phy_mode_11ng_ht40 = 7,
  8264. htt_phy_mode_11ac_vht20 = 8,
  8265. htt_phy_mode_11ac_vht40 = 9,
  8266. htt_phy_mode_11ac_vht80 = 10,
  8267. htt_phy_mode_11ac_vht20_2g = 11,
  8268. htt_phy_mode_11ac_vht40_2g = 12,
  8269. htt_phy_mode_11ac_vht80_2g = 13,
  8270. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  8271. htt_phy_mode_11ac_vht160 = 15,
  8272. htt_phy_mode_max,
  8273. };
  8274. /**
  8275. * @brief target -> host HTT channel change indication
  8276. * @details
  8277. * Specify when a channel change occurs.
  8278. * This allows the host to precisely determine which rx frames arrived
  8279. * on the old channel and which rx frames arrived on the new channel.
  8280. *
  8281. *|31 |7 0 |
  8282. *|-------------------------------------------+----------|
  8283. *| reserved | msg type |
  8284. *|------------------------------------------------------|
  8285. *| primary_chan_center_freq_mhz |
  8286. *|------------------------------------------------------|
  8287. *| contiguous_chan1_center_freq_mhz |
  8288. *|------------------------------------------------------|
  8289. *| contiguous_chan2_center_freq_mhz |
  8290. *|------------------------------------------------------|
  8291. *| phy_mode |
  8292. *|------------------------------------------------------|
  8293. *
  8294. * Header fields:
  8295. * - MSG_TYPE
  8296. * Bits 7:0
  8297. * Purpose: identifies this as a htt channel change indication message
  8298. * Value: 0x15
  8299. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  8300. * Bits 31:0
  8301. * Purpose: identify the (center of the) new 20 MHz primary channel
  8302. * Value: center frequency of the 20 MHz primary channel, in MHz units
  8303. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  8304. * Bits 31:0
  8305. * Purpose: identify the (center of the) contiguous frequency range
  8306. * comprising the new channel.
  8307. * For example, if the new channel is a 80 MHz channel extending
  8308. * 60 MHz beyond the primary channel, this field would be 30 larger
  8309. * than the primary channel center frequency field.
  8310. * Value: center frequency of the contiguous frequency range comprising
  8311. * the full channel in MHz units
  8312. * (80+80 channels also use the CONTIG_CHAN2 field)
  8313. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  8314. * Bits 31:0
  8315. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  8316. * within a VHT 80+80 channel.
  8317. * This field is only relevant for VHT 80+80 channels.
  8318. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  8319. * channel (arbitrary value for cases besides VHT 80+80)
  8320. * - PHY_MODE
  8321. * Bits 31:0
  8322. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  8323. * and band
  8324. * Value: htt_phy_mode enum value
  8325. */
  8326. PREPACK struct htt_chan_change_t
  8327. {
  8328. /* DWORD 0: flags and meta-data */
  8329. A_UINT32
  8330. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  8331. reserved1: 24;
  8332. A_UINT32 primary_chan_center_freq_mhz;
  8333. A_UINT32 contig_chan1_center_freq_mhz;
  8334. A_UINT32 contig_chan2_center_freq_mhz;
  8335. A_UINT32 phy_mode;
  8336. } POSTPACK;
  8337. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  8338. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  8339. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  8340. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  8341. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  8342. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  8343. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  8344. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  8345. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  8346. do { \
  8347. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  8348. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  8349. } while (0)
  8350. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  8351. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  8352. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  8353. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  8354. do { \
  8355. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  8356. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  8357. } while (0)
  8358. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  8359. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  8360. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  8361. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  8362. do { \
  8363. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  8364. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  8365. } while (0)
  8366. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  8367. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  8368. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  8369. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  8370. do { \
  8371. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  8372. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  8373. } while (0)
  8374. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  8375. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  8376. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  8377. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  8378. /**
  8379. * @brief rx offload packet error message
  8380. *
  8381. * @details
  8382. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  8383. * of target payload like mic err.
  8384. *
  8385. * |31 24|23 16|15 8|7 0|
  8386. * |----------------+----------------+----------------+----------------|
  8387. * | tid | vdev_id | msg_sub_type | msg_type |
  8388. * |-------------------------------------------------------------------|
  8389. * : (sub-type dependent content) :
  8390. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  8391. * Header fields:
  8392. * - msg_type
  8393. * Bits 7:0
  8394. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  8395. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  8396. * - msg_sub_type
  8397. * Bits 15:8
  8398. * Purpose: Identifies which type of rx error is reported by this message
  8399. * value: htt_rx_ofld_pkt_err_type
  8400. * - vdev_id
  8401. * Bits 23:16
  8402. * Purpose: Identifies which vdev received the erroneous rx frame
  8403. * value:
  8404. * - tid
  8405. * Bits 31:24
  8406. * Purpose: Identifies the traffic type of the rx frame
  8407. * value:
  8408. *
  8409. * - The payload fields used if the sub-type == MIC error are shown below.
  8410. * Note - MIC err is per MSDU, while PN is per MPDU.
  8411. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  8412. * with MIC err in A-MSDU case, so FW will send only one HTT message
  8413. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  8414. * instead of sending separate HTT messages for each wrong MSDU within
  8415. * the MPDU.
  8416. *
  8417. * |31 24|23 16|15 8|7 0|
  8418. * |----------------+----------------+----------------+----------------|
  8419. * | Rsvd | key_id | peer_id |
  8420. * |-------------------------------------------------------------------|
  8421. * | receiver MAC addr 31:0 |
  8422. * |-------------------------------------------------------------------|
  8423. * | Rsvd | receiver MAC addr 47:32 |
  8424. * |-------------------------------------------------------------------|
  8425. * | transmitter MAC addr 31:0 |
  8426. * |-------------------------------------------------------------------|
  8427. * | Rsvd | transmitter MAC addr 47:32 |
  8428. * |-------------------------------------------------------------------|
  8429. * | PN 31:0 |
  8430. * |-------------------------------------------------------------------|
  8431. * | Rsvd | PN 47:32 |
  8432. * |-------------------------------------------------------------------|
  8433. * - peer_id
  8434. * Bits 15:0
  8435. * Purpose: identifies which peer is frame is from
  8436. * value:
  8437. * - key_id
  8438. * Bits 23:16
  8439. * Purpose: identifies key_id of rx frame
  8440. * value:
  8441. * - RA_31_0 (receiver MAC addr 31:0)
  8442. * Bits 31:0
  8443. * Purpose: identifies by MAC address which vdev received the frame
  8444. * value: MAC address lower 4 bytes
  8445. * - RA_47_32 (receiver MAC addr 47:32)
  8446. * Bits 15:0
  8447. * Purpose: identifies by MAC address which vdev received the frame
  8448. * value: MAC address upper 2 bytes
  8449. * - TA_31_0 (transmitter MAC addr 31:0)
  8450. * Bits 31:0
  8451. * Purpose: identifies by MAC address which peer transmitted the frame
  8452. * value: MAC address lower 4 bytes
  8453. * - TA_47_32 (transmitter MAC addr 47:32)
  8454. * Bits 15:0
  8455. * Purpose: identifies by MAC address which peer transmitted the frame
  8456. * value: MAC address upper 2 bytes
  8457. * - PN_31_0
  8458. * Bits 31:0
  8459. * Purpose: Identifies pn of rx frame
  8460. * value: PN lower 4 bytes
  8461. * - PN_47_32
  8462. * Bits 15:0
  8463. * Purpose: Identifies pn of rx frame
  8464. * value:
  8465. * TKIP or CCMP: PN upper 2 bytes
  8466. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  8467. */
  8468. enum htt_rx_ofld_pkt_err_type {
  8469. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  8470. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  8471. };
  8472. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  8473. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  8474. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  8475. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  8476. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  8477. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  8478. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  8479. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  8480. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  8481. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  8482. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  8483. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  8484. do { \
  8485. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  8486. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  8487. } while (0)
  8488. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  8489. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  8490. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  8491. do { \
  8492. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  8493. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  8494. } while (0)
  8495. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  8496. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  8497. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  8498. do { \
  8499. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  8500. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  8501. } while (0)
  8502. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  8503. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  8504. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  8505. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  8506. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  8507. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  8508. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  8509. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  8510. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  8511. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  8512. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  8513. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  8514. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  8515. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  8516. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  8517. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  8518. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  8519. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  8520. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  8521. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  8522. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  8523. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  8524. do { \
  8525. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  8526. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  8527. } while (0)
  8528. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  8529. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  8530. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  8531. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  8532. do { \
  8533. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  8534. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  8535. } while (0)
  8536. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  8537. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  8538. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  8539. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  8540. do { \
  8541. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  8542. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  8543. } while (0)
  8544. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  8545. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  8546. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  8547. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  8548. do { \
  8549. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  8550. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  8551. } while (0)
  8552. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  8553. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  8554. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  8555. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  8556. do { \
  8557. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  8558. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  8559. } while (0)
  8560. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  8561. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  8562. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  8563. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  8564. do { \
  8565. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  8566. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  8567. } while (0)
  8568. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  8569. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  8570. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  8571. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  8572. do { \
  8573. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  8574. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  8575. } while (0)
  8576. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  8577. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  8578. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  8579. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  8580. do { \
  8581. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  8582. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  8583. } while (0)
  8584. /**
  8585. * @brief peer rate report message
  8586. *
  8587. * @details
  8588. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  8589. * justified rate of all the peers.
  8590. *
  8591. * |31 24|23 16|15 8|7 0|
  8592. * |----------------+----------------+----------------+----------------|
  8593. * | peer_count | | msg_type |
  8594. * |-------------------------------------------------------------------|
  8595. * : Payload (variant number of peer rate report) :
  8596. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  8597. * Header fields:
  8598. * - msg_type
  8599. * Bits 7:0
  8600. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  8601. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  8602. * - reserved
  8603. * Bits 15:8
  8604. * Purpose:
  8605. * value:
  8606. * - peer_count
  8607. * Bits 31:16
  8608. * Purpose: Specify how many peer rate report elements are present in the payload.
  8609. * value:
  8610. *
  8611. * Payload:
  8612. * There are variant number of peer rate report follow the first 32 bits.
  8613. * The peer rate report is defined as follows.
  8614. *
  8615. * |31 20|19 16|15 0|
  8616. * |-----------------------+---------+---------------------------------|-
  8617. * | reserved | phy | peer_id | \
  8618. * |-------------------------------------------------------------------| -> report #0
  8619. * | rate | /
  8620. * |-----------------------+---------+---------------------------------|-
  8621. * | reserved | phy | peer_id | \
  8622. * |-------------------------------------------------------------------| -> report #1
  8623. * | rate | /
  8624. * |-----------------------+---------+---------------------------------|-
  8625. * | reserved | phy | peer_id | \
  8626. * |-------------------------------------------------------------------| -> report #2
  8627. * | rate | /
  8628. * |-------------------------------------------------------------------|-
  8629. * : :
  8630. * : :
  8631. * : :
  8632. * :-------------------------------------------------------------------:
  8633. *
  8634. * - peer_id
  8635. * Bits 15:0
  8636. * Purpose: identify the peer
  8637. * value:
  8638. * - phy
  8639. * Bits 19:16
  8640. * Purpose: identify which phy is in use
  8641. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  8642. * Please see enum htt_peer_report_phy_type for detail.
  8643. * - reserved
  8644. * Bits 31:20
  8645. * Purpose:
  8646. * value:
  8647. * - rate
  8648. * Bits 31:0
  8649. * Purpose: represent the justified rate of the peer specified by peer_id
  8650. * value:
  8651. */
  8652. enum htt_peer_rate_report_phy_type {
  8653. HTT_PEER_RATE_REPORT_11B = 0,
  8654. HTT_PEER_RATE_REPORT_11A_G,
  8655. HTT_PEER_RATE_REPORT_11N,
  8656. HTT_PEER_RATE_REPORT_11AC,
  8657. };
  8658. #define HTT_PEER_RATE_REPORT_SIZE 8
  8659. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  8660. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  8661. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  8662. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  8663. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  8664. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  8665. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  8666. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  8667. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  8668. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  8669. do { \
  8670. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  8671. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  8672. } while (0)
  8673. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  8674. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  8675. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  8676. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  8677. do { \
  8678. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  8679. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  8680. } while (0)
  8681. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  8682. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  8683. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  8684. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  8685. do { \
  8686. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  8687. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  8688. } while (0)
  8689. /**
  8690. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_MAP Message
  8691. *
  8692. * @details
  8693. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  8694. * a flow of descriptors.
  8695. *
  8696. * This message is in TLV format and indicates the parameters to be setup a
  8697. * flow in the host. Each entry indicates that a particular flow ID is ready to
  8698. * receive descriptors from a specified pool.
  8699. *
  8700. * The message would appear as follows:
  8701. *
  8702. * |31 24|23 16|15 8|7 0|
  8703. * |----------------+----------------+----------------+----------------|
  8704. * header | reserved | num_flows | msg_type |
  8705. * |-------------------------------------------------------------------|
  8706. * | |
  8707. * : payload :
  8708. * | |
  8709. * |-------------------------------------------------------------------|
  8710. *
  8711. * The header field is one DWORD long and is interpreted as follows:
  8712. * b'0:7 - msg_type: This will be set to HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  8713. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  8714. * this message
  8715. * b'16-31 - reserved: These bits are reserved for future use
  8716. *
  8717. * Payload:
  8718. * The payload would contain multiple objects of the following structure. Each
  8719. * object represents a flow.
  8720. *
  8721. * |31 24|23 16|15 8|7 0|
  8722. * |----------------+----------------+----------------+----------------|
  8723. * header | reserved | num_flows | msg_type |
  8724. * |-------------------------------------------------------------------|
  8725. * payload0| flow_type |
  8726. * |-------------------------------------------------------------------|
  8727. * | flow_id |
  8728. * |-------------------------------------------------------------------|
  8729. * | reserved0 | flow_pool_id |
  8730. * |-------------------------------------------------------------------|
  8731. * | reserved1 | flow_pool_size |
  8732. * |-------------------------------------------------------------------|
  8733. * | reserved2 |
  8734. * |-------------------------------------------------------------------|
  8735. * payload1| flow_type |
  8736. * |-------------------------------------------------------------------|
  8737. * | flow_id |
  8738. * |-------------------------------------------------------------------|
  8739. * | reserved0 | flow_pool_id |
  8740. * |-------------------------------------------------------------------|
  8741. * | reserved1 | flow_pool_size |
  8742. * |-------------------------------------------------------------------|
  8743. * | reserved2 |
  8744. * |-------------------------------------------------------------------|
  8745. * | . |
  8746. * | . |
  8747. * | . |
  8748. * |-------------------------------------------------------------------|
  8749. *
  8750. * Each payload is 5 DWORDS long and is interpreted as follows:
  8751. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  8752. * this flow is associated. It can be VDEV, peer,
  8753. * or tid (AC). Based on enum htt_flow_type.
  8754. *
  8755. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  8756. * object. For flow_type vdev it is set to the
  8757. * vdevid, for peer it is peerid and for tid, it is
  8758. * tid_num.
  8759. *
  8760. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  8761. * in the host for this flow
  8762. * b'16:31 - reserved0: This field in reserved for the future. In case
  8763. * we have a hierarchical implementation (HCM) of
  8764. * pools, it can be used to indicate the ID of the
  8765. * parent-pool.
  8766. *
  8767. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  8768. * Descriptors for this flow will be
  8769. * allocated from this pool in the host.
  8770. * b'16:31 - reserved1: This field in reserved for the future. In case
  8771. * we have a hierarchical implementation of pools,
  8772. * it can be used to indicate the max number of
  8773. * descriptors in the pool. The b'0:15 can be used
  8774. * to indicate min number of descriptors in the
  8775. * HCM scheme.
  8776. *
  8777. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  8778. * we have a hierarchical implementation of pools,
  8779. * b'0:15 can be used to indicate the
  8780. * priority-based borrowing (PBB) threshold of
  8781. * the flow's pool. The b'16:31 are still left
  8782. * reserved.
  8783. */
  8784. enum htt_flow_type {
  8785. FLOW_TYPE_VDEV = 0,
  8786. /* Insert new flow types above this line */
  8787. };
  8788. PREPACK struct htt_flow_pool_map_payload_t {
  8789. A_UINT32 flow_type;
  8790. A_UINT32 flow_id;
  8791. A_UINT32 flow_pool_id:16,
  8792. reserved0:16;
  8793. A_UINT32 flow_pool_size:16,
  8794. reserved1:16;
  8795. A_UINT32 reserved2;
  8796. } POSTPACK;
  8797. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  8798. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  8799. (sizeof(struct htt_flow_pool_map_payload_t))
  8800. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  8801. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  8802. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  8803. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  8804. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  8805. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  8806. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  8807. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  8808. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  8809. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  8810. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  8811. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  8812. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  8813. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  8814. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  8815. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  8816. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  8817. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  8818. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  8819. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  8820. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  8821. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  8822. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  8823. do { \
  8824. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  8825. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  8826. } while (0)
  8827. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  8828. do { \
  8829. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  8830. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  8831. } while (0)
  8832. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  8833. do { \
  8834. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  8835. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  8836. } while (0)
  8837. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  8838. do { \
  8839. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  8840. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  8841. } while (0)
  8842. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  8843. do { \
  8844. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  8845. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  8846. } while (0)
  8847. /**
  8848. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP Message
  8849. *
  8850. * @details
  8851. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  8852. * down a flow of descriptors.
  8853. * This message indicates that for the flow (whose ID is provided) is wanting
  8854. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  8855. * pool of descriptors from where descriptors are being allocated for this
  8856. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  8857. * be unmapped by the host.
  8858. *
  8859. * The message would appear as follows:
  8860. *
  8861. * |31 24|23 16|15 8|7 0|
  8862. * |----------------+----------------+----------------+----------------|
  8863. * | reserved0 | msg_type |
  8864. * |-------------------------------------------------------------------|
  8865. * | flow_type |
  8866. * |-------------------------------------------------------------------|
  8867. * | flow_id |
  8868. * |-------------------------------------------------------------------|
  8869. * | reserved1 | flow_pool_id |
  8870. * |-------------------------------------------------------------------|
  8871. *
  8872. * The message is interpreted as follows:
  8873. * dword0 - b'0:7 - msg_type: This will be set to
  8874. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  8875. * b'8:31 - reserved0: Reserved for future use
  8876. *
  8877. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  8878. * this flow is associated. It can be VDEV, peer,
  8879. * or tid (AC). Based on enum htt_flow_type.
  8880. *
  8881. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  8882. * object. For flow_type vdev it is set to the
  8883. * vdevid, for peer it is peerid and for tid, it is
  8884. * tid_num.
  8885. *
  8886. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  8887. * used in the host for this flow
  8888. * b'16:31 - reserved0: This field in reserved for the future.
  8889. *
  8890. */
  8891. PREPACK struct htt_flow_pool_unmap_t {
  8892. A_UINT32 msg_type:8,
  8893. reserved0:24;
  8894. A_UINT32 flow_type;
  8895. A_UINT32 flow_id;
  8896. A_UINT32 flow_pool_id:16,
  8897. reserved1:16;
  8898. } POSTPACK;
  8899. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  8900. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  8901. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  8902. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  8903. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  8904. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  8905. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  8906. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  8907. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  8908. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  8909. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  8910. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  8911. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  8912. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  8913. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  8914. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  8915. do { \
  8916. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  8917. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  8918. } while (0)
  8919. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  8920. do { \
  8921. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  8922. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  8923. } while (0)
  8924. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  8925. do { \
  8926. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  8927. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  8928. } while (0)
  8929. /**
  8930. * @brief HTT_T2H_MSG_TYPE_SRING_SETUP_DONE Message
  8931. *
  8932. * @details
  8933. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  8934. * SRNG ring setup is done
  8935. *
  8936. * This message indicates whether the last setup operation is successful.
  8937. * It will be sent to host when host set respose_required bit in
  8938. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  8939. * The message would appear as follows:
  8940. *
  8941. * |31 24|23 16|15 8|7 0|
  8942. * |--------------- +----------------+----------------+----------------|
  8943. * | setup_status | ring_id | pdev_id | msg_type |
  8944. * |-------------------------------------------------------------------|
  8945. *
  8946. * The message is interpreted as follows:
  8947. * dword0 - b'0:7 - msg_type: This will be set to
  8948. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  8949. * b'8:15 - pdev_id:
  8950. * 0 (for rings at SOC/UMAC level),
  8951. * 1/2/3 mac id (for rings at LMAC level)
  8952. * b'16:23 - ring_id: Identify the ring which is set up
  8953. * More details can be got from enum htt_srng_ring_id
  8954. * b'24:31 - setup_status: Indicate status of setup operation
  8955. * Refer to htt_ring_setup_status
  8956. */
  8957. PREPACK struct htt_sring_setup_done_t {
  8958. A_UINT32 msg_type: 8,
  8959. pdev_id: 8,
  8960. ring_id: 8,
  8961. setup_status: 8;
  8962. } POSTPACK;
  8963. enum htt_ring_setup_status {
  8964. htt_ring_setup_status_ok = 0,
  8965. htt_ring_setup_status_error,
  8966. };
  8967. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  8968. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  8969. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  8970. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  8971. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  8972. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  8973. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  8974. do { \
  8975. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  8976. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  8977. } while (0)
  8978. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  8979. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  8980. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  8981. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  8982. HTT_SRING_SETUP_DONE_RING_ID_S)
  8983. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  8984. do { \
  8985. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  8986. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  8987. } while (0)
  8988. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  8989. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  8990. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  8991. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  8992. HTT_SRING_SETUP_DONE_STATUS_S)
  8993. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  8994. do { \
  8995. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  8996. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  8997. } while (0)
  8998. /**
  8999. * @brief HTT_T2H_MSG_TYPE_MAP_FLOW_INFO Message
  9000. *
  9001. * @details
  9002. * HTT TX map flow entry with tqm flow pointer
  9003. * Sent from firmware to host to add tqm flow pointer in corresponding
  9004. * flow search entry. Flow metadata is replayed back to host as part of this
  9005. * struct to enable host to find the specific flow search entry
  9006. *
  9007. * The message would appear as follows:
  9008. *
  9009. * |31 28|27 18|17 14|13 8|7 0|
  9010. * |-------+------------------------------------------+----------------|
  9011. * | rsvd0 | fse_hsh_idx | msg_type |
  9012. * |-------------------------------------------------------------------|
  9013. * | rsvd1 | tid | peer_id |
  9014. * |-------------------------------------------------------------------|
  9015. * | tqm_flow_pntr_lo |
  9016. * |-------------------------------------------------------------------|
  9017. * | tqm_flow_pntr_hi |
  9018. * |-------------------------------------------------------------------|
  9019. * | fse_meta_data |
  9020. * |-------------------------------------------------------------------|
  9021. *
  9022. * The message is interpreted as follows:
  9023. *
  9024. * dword0 - b'0:7 - msg_type: This will be set to
  9025. * HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  9026. *
  9027. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  9028. * for this flow entry
  9029. *
  9030. * dword0 - b'28:31 - rsvd0: Reserved for future use
  9031. *
  9032. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  9033. *
  9034. * dword1 - b'14:17 - tid
  9035. *
  9036. * dword1 - b'18:31 - rsvd1: Reserved for future use
  9037. *
  9038. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  9039. *
  9040. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  9041. *
  9042. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  9043. * given by host
  9044. */
  9045. PREPACK struct htt_tx_map_flow_info {
  9046. A_UINT32
  9047. msg_type: 8,
  9048. fse_hsh_idx: 20,
  9049. rsvd0: 4;
  9050. A_UINT32
  9051. peer_id: 14,
  9052. tid: 4,
  9053. rsvd1: 14;
  9054. A_UINT32 tqm_flow_pntr_lo;
  9055. A_UINT32 tqm_flow_pntr_hi;
  9056. struct htt_tx_flow_metadata fse_meta_data;
  9057. } POSTPACK;
  9058. /* DWORD 0 */
  9059. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  9060. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  9061. /* DWORD 1 */
  9062. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  9063. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  9064. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  9065. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  9066. /* DWORD 0 */
  9067. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  9068. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  9069. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  9070. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  9071. do { \
  9072. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  9073. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  9074. } while (0)
  9075. /* DWORD 1 */
  9076. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  9077. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  9078. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  9079. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  9080. do { \
  9081. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  9082. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  9083. } while (0)
  9084. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  9085. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  9086. HTT_TX_MAP_FLOW_INFO_TID_S)
  9087. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  9088. do { \
  9089. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  9090. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  9091. } while (0)
  9092. /*
  9093. * htt_dbg_ext_stats_status -
  9094. * present - The requested stats have been delivered in full.
  9095. * This indicates that either the stats information was contained
  9096. * in its entirety within this message, or else this message
  9097. * completes the delivery of the requested stats info that was
  9098. * partially delivered through earlier STATS_CONF messages.
  9099. * partial - The requested stats have been delivered in part.
  9100. * One or more subsequent STATS_CONF messages with the same
  9101. * cookie value will be sent to deliver the remainder of the
  9102. * information.
  9103. * error - The requested stats could not be delivered, for example due
  9104. * to a shortage of memory to construct a message holding the
  9105. * requested stats.
  9106. * invalid - The requested stat type is either not recognized, or the
  9107. * target is configured to not gather the stats type in question.
  9108. */
  9109. enum htt_dbg_ext_stats_status {
  9110. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  9111. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  9112. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  9113. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  9114. };
  9115. /**
  9116. * @brief target -> host ppdu stats upload
  9117. *
  9118. * @details
  9119. * The following field definitions describe the format of the HTT target
  9120. * to host ppdu stats indication message.
  9121. *
  9122. *
  9123. * |31 16|15 12|11 10|9 8|7 0 |
  9124. * |----------------------------------------------------------------------|
  9125. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  9126. * |----------------------------------------------------------------------|
  9127. * | ppdu_id |
  9128. * |----------------------------------------------------------------------|
  9129. * | Timestamp in us |
  9130. * |----------------------------------------------------------------------|
  9131. * | reserved |
  9132. * |----------------------------------------------------------------------|
  9133. * | type-specific stats info |
  9134. * | (see htt_ppdu_stats.h) |
  9135. * |----------------------------------------------------------------------|
  9136. * Header fields:
  9137. * - MSG_TYPE
  9138. * Bits 7:0
  9139. * Purpose: Identifies this is a PPDU STATS indication
  9140. * message.
  9141. * Value: 0x1d
  9142. * - mac_id
  9143. * Bits 9:8
  9144. * Purpose: mac_id of this ppdu_id
  9145. * Value: 0-3
  9146. * - pdev_id
  9147. * Bits 11:10
  9148. * Purpose: pdev_id of this ppdu_id
  9149. * Value: 0-3
  9150. * 0 (for rings at SOC level),
  9151. * 1/2/3 PDEV -> 0/1/2
  9152. * - payload_size
  9153. * Bits 31:16
  9154. * Purpose: total tlv size
  9155. * Value: payload_size in bytes
  9156. */
  9157. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  9158. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  9159. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  9160. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  9161. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  9162. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  9163. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  9164. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  9165. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  9166. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  9167. do { \
  9168. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  9169. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  9170. } while (0)
  9171. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  9172. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  9173. HTT_T2H_PPDU_STATS_MAC_ID_S)
  9174. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  9175. do { \
  9176. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  9177. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  9178. } while (0)
  9179. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  9180. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  9181. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  9182. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  9183. do { \
  9184. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  9185. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  9186. } while (0)
  9187. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  9188. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  9189. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  9190. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  9191. do { \
  9192. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  9193. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  9194. } while (0)
  9195. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  9196. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  9197. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  9198. /**
  9199. * @brief target -> host extended statistics upload
  9200. *
  9201. * @details
  9202. * The following field definitions describe the format of the HTT target
  9203. * to host stats upload confirmation message.
  9204. * The message contains a cookie echoed from the HTT host->target stats
  9205. * upload request, which identifies which request the confirmation is
  9206. * for, and a single stats can span over multiple HTT stats indication
  9207. * due to the HTT message size limitation so every HTT ext stats indication
  9208. * will have tag-length-value stats information elements.
  9209. * The tag-length header for each HTT stats IND message also includes a
  9210. * status field, to indicate whether the request for the stat type in
  9211. * question was fully met, partially met, unable to be met, or invalid
  9212. * (if the stat type in question is disabled in the target).
  9213. * A Done bit 1's indicate the end of the of stats info elements.
  9214. *
  9215. *
  9216. * |31 16|15 12|11|10 8|7 5|4 0|
  9217. * |--------------------------------------------------------------|
  9218. * | reserved | msg type |
  9219. * |--------------------------------------------------------------|
  9220. * | cookie LSBs |
  9221. * |--------------------------------------------------------------|
  9222. * | cookie MSBs |
  9223. * |--------------------------------------------------------------|
  9224. * | stats entry length | rsvd | D| S | stat type |
  9225. * |--------------------------------------------------------------|
  9226. * | type-specific stats info |
  9227. * | (see htt_stats.h) |
  9228. * |--------------------------------------------------------------|
  9229. * Header fields:
  9230. * - MSG_TYPE
  9231. * Bits 7:0
  9232. * Purpose: Identifies this is a extended statistics upload confirmation
  9233. * message.
  9234. * Value: 0x1c
  9235. * - COOKIE_LSBS
  9236. * Bits 31:0
  9237. * Purpose: Provide a mechanism to match a target->host stats confirmation
  9238. * message with its preceding host->target stats request message.
  9239. * Value: LSBs of the opaque cookie specified by the host-side requestor
  9240. * - COOKIE_MSBS
  9241. * Bits 31:0
  9242. * Purpose: Provide a mechanism to match a target->host stats confirmation
  9243. * message with its preceding host->target stats request message.
  9244. * Value: MSBs of the opaque cookie specified by the host-side requestor
  9245. *
  9246. * Stats Information Element tag-length header fields:
  9247. * - STAT_TYPE
  9248. * Bits 7:0
  9249. * Purpose: identifies the type of statistics info held in the
  9250. * following information element
  9251. * Value: htt_dbg_ext_stats_type
  9252. * - STATUS
  9253. * Bits 10:8
  9254. * Purpose: indicate whether the requested stats are present
  9255. * Value: htt_dbg_ext_stats_status
  9256. * - DONE
  9257. * Bits 11
  9258. * Purpose:
  9259. * Indicates the completion of the stats entry, this will be the last
  9260. * stats conf HTT segment for the requested stats type.
  9261. * Value:
  9262. * 0 -> the stats retrieval is ongoing
  9263. * 1 -> the stats retrieval is complete
  9264. * - LENGTH
  9265. * Bits 31:16
  9266. * Purpose: indicate the stats information size
  9267. * Value: This field specifies the number of bytes of stats information
  9268. * that follows the element tag-length header.
  9269. * It is expected but not required that this length is a multiple of
  9270. * 4 bytes.
  9271. */
  9272. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  9273. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  9274. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  9275. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  9276. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  9277. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  9278. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  9279. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  9280. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  9281. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  9282. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  9283. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  9284. do { \
  9285. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  9286. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  9287. } while (0)
  9288. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  9289. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  9290. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  9291. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  9292. do { \
  9293. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  9294. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  9295. } while (0)
  9296. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  9297. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  9298. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  9299. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  9300. do { \
  9301. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  9302. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  9303. } while (0)
  9304. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  9305. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  9306. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  9307. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  9308. do { \
  9309. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  9310. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  9311. } while (0)
  9312. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  9313. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  9314. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  9315. typedef enum {
  9316. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  9317. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  9318. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  9319. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  9320. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  9321. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  9322. /* Reserved from 128 - 255 for target internal use.*/
  9323. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  9324. } HTT_PEER_TYPE;
  9325. /** 2 word representation of MAC addr */
  9326. typedef struct {
  9327. /** upper 4 bytes of MAC address */
  9328. A_UINT32 mac_addr31to0;
  9329. /** lower 2 bytes of MAC address */
  9330. A_UINT32 mac_addr47to32;
  9331. } htt_mac_addr;
  9332. /** macro to convert MAC address from char array to HTT word format */
  9333. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  9334. (phtt_mac_addr)->mac_addr31to0 = \
  9335. (((c_macaddr)[0] << 0) | \
  9336. ((c_macaddr)[1] << 8) | \
  9337. ((c_macaddr)[2] << 16) | \
  9338. ((c_macaddr)[3] << 24)); \
  9339. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  9340. } while (0)
  9341. /**
  9342. * @brief target -> host monitor mac header indication message
  9343. *
  9344. * @details
  9345. * The following diagram shows the format of the monitor mac header message
  9346. * sent from the target to the host.
  9347. * This message is primarily sent when promiscuous rx mode is enabled.
  9348. * One message is sent per rx PPDU.
  9349. *
  9350. * |31 24|23 16|15 8|7 0|
  9351. * |-------------------------------------------------------------|
  9352. * | peer_id | reserved0 | msg_type |
  9353. * |-------------------------------------------------------------|
  9354. * | reserved1 | num_mpdu |
  9355. * |-------------------------------------------------------------|
  9356. * | struct hw_rx_desc |
  9357. * | (see wal_rx_desc.h) |
  9358. * |-------------------------------------------------------------|
  9359. * | struct ieee80211_frame_addr4 |
  9360. * | (see ieee80211_defs.h) |
  9361. * |-------------------------------------------------------------|
  9362. * | struct ieee80211_frame_addr4 |
  9363. * | (see ieee80211_defs.h) |
  9364. * |-------------------------------------------------------------|
  9365. * | ...... |
  9366. * |-------------------------------------------------------------|
  9367. *
  9368. * Header fields:
  9369. * - msg_type
  9370. * Bits 7:0
  9371. * Purpose: Identifies this is a monitor mac header indication message.
  9372. * Value: 0x20
  9373. * - peer_id
  9374. * Bits 31:16
  9375. * Purpose: Software peer id given by host during association,
  9376. * During promiscuous mode, the peer ID will be invalid (0xFF)
  9377. * for rx PPDUs received from unassociated peers.
  9378. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  9379. * - num_mpdu
  9380. * Bits 15:0
  9381. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  9382. * delivered within the message.
  9383. * Value: 1 to 32
  9384. * num_mpdu is limited to a maximum value of 32, due to buffer
  9385. * size limits. For PPDUs with more than 32 MPDUs, only the
  9386. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  9387. * the PPDU will be provided.
  9388. */
  9389. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  9390. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  9391. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  9392. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  9393. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  9394. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  9395. do { \
  9396. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  9397. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  9398. } while (0)
  9399. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  9400. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  9401. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  9402. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  9403. do { \
  9404. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  9405. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  9406. } while (0)
  9407. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  9408. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  9409. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  9410. #endif