htt.h 477 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543
  1. /*
  2. * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved.
  3. *
  4. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  5. *
  6. *
  7. * Permission to use, copy, modify, and/or distribute this software for
  8. * any purpose with or without fee is hereby granted, provided that the
  9. * above copyright notice and this permission notice appear in all
  10. * copies.
  11. *
  12. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  13. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  14. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  15. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  16. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  17. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  18. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  19. * PERFORMANCE OF THIS SOFTWARE.
  20. */
  21. /*
  22. * This file was originally distributed by Qualcomm Atheros, Inc.
  23. * under proprietary terms before Copyright ownership was assigned
  24. * to the Linux Foundation.
  25. */
  26. /**
  27. * @file htt.h
  28. *
  29. * @details the public header file of HTT layer
  30. */
  31. #ifndef _HTT_H_
  32. #define _HTT_H_
  33. #include <htt_deps.h>
  34. #include <htt_common.h>
  35. /*
  36. * Unless explicitly specified to use 64 bits to represent physical addresses
  37. * (or more precisely, bus addresses), default to 32 bits.
  38. */
  39. #ifndef HTT_PADDR64
  40. #define HTT_PADDR64 0
  41. #endif
  42. #ifndef offsetof
  43. #define offsetof(type, field) ((unsigned int)(&((type *)0)->field))
  44. #endif
  45. /*
  46. * HTT version history:
  47. * 1.0 initial numbered version
  48. * 1.1 modifications to STATS messages.
  49. * These modifications are not backwards compatible, but since the
  50. * STATS messages themselves are non-essential (they are for debugging),
  51. * the 1.1 version of the HTT message library as a whole is compatible
  52. * with the 1.0 version.
  53. * 1.2 reset mask IE added to STATS_REQ message
  54. * 1.3 stat config IE added to STATS_REQ message
  55. *----
  56. * 2.0 FW rx PPDU desc added to RX_IND message
  57. * 2.1 Enable msdu_ext/frag_desc banking change for WIFI2.0
  58. *----
  59. * 3.0 Remove HTT_H2T_MSG_TYPE_MGMT_TX message
  60. * 3.1 Added HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND message
  61. * 3.2 Added HTT_H2T_MSG_TYPE_WDI_IPA_CFG,
  62. * HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST messages
  63. * 3.3 Added HTT_H2T_MSG_TYPE_AGGR_CFG_EX message
  64. * 3.4 Added tx_compl_req flag in HTT tx descriptor
  65. * 3.5 Added flush and fail stats in rx_reorder stats structure
  66. * 3.6 Added frag flag in HTT RX INORDER PADDR IND header
  67. * 3.7 Made changes to support EOS Mac_core 3.0
  68. * 3.8 Added txq_group information element definition;
  69. * added optional txq_group suffix to TX_CREDIT_UPDATE_IND message
  70. * 3.9 Added HTT_T2H CHAN_CHANGE message;
  71. * Allow buffer addresses in bus-address format to be stored as
  72. * either 32 bits or 64 bits.
  73. * 3.10 Add optional TLV extensions to the VERSION_REQ and VERSION_CONF
  74. * messages to specify which HTT options to use.
  75. * Initial TLV options cover:
  76. * - whether to use 32 or 64 bits to represent LL bus addresses
  77. * - whether to use TX_COMPL_IND or TX_CREDIT_UPDATE_IND in HL systems
  78. * - how many tx queue groups to use
  79. * 3.11 Expand rx debug stats:
  80. * - Expand the rx_reorder_stats struct with stats about successful and
  81. * failed rx buffer allcoations.
  82. * - Add a new rx_remote_buffer_mgmt_stats struct with stats about
  83. * the supply, allocation, use, and recycling of rx buffers for the
  84. * "remote ring" of rx buffers in host member in LL systems.
  85. * Add RX_REMOTE_RING_BUFFER_INFO stats type for uploading these stats.
  86. * 3.12 Add "rx offload packet error" message with initial "MIC error" subtype
  87. * 3.13 Add constants + macros to support 64-bit address format for the
  88. * tx fragments descriptor, the rx ring buffer, and the rx ring
  89. * index shadow register.
  90. * 3.14 Add a method for the host to provide detailed per-frame tx specs:
  91. * - Add htt_tx_msdu_desc_ext_t struct def.
  92. * - Add TLV to specify whether the target supports the HTT tx MSDU
  93. * extension descriptor.
  94. * - Change a reserved bit in the HTT tx MSDU descriptor to an
  95. * "extension" bit, to specify whether a HTT tx MSDU extension
  96. * descriptor is present.
  97. * 3.15 Add HW rx desc info to per-MSDU info elems in RX_IN_ORD_PADDR_IND msg.
  98. * (This allows the host to obtain key information about the MSDU
  99. * from a memory location already in the cache, rather than taking a
  100. * cache miss for each MSDU by reading the HW rx descs.)
  101. * 3.16 Add htt_pkt_type_eth2 and define pkt_subtype flags to indicate
  102. * whether a copy-engine classification result is appended to TX_FRM.
  103. * 3.17 Add a version of the WDI_IPA_CFG message; add RX_RING2 to WDI_IPA_CFG
  104. * 3.18 Add a PEER_DEL tx completion indication status, for HL cleanup of
  105. * tx frames in the target after the peer has already been deleted.
  106. * 3.19 Add HTT_DBG_STATS_RX_RATE_INFO_V2 and HTT_DBG_STATS_TX_RATE_INFO_V2
  107. * 3.20 Expand rx_reorder_stats.
  108. * 3.21 Add optional rx channel spec to HL RX_IND.
  109. * 3.22 Expand rx_reorder_stats
  110. * (distinguish duplicates within vs. outside block ack window)
  111. * 3.23 Add HTT_T2H_MSG_TYPE_RATE_REPORT to report peer justified rate.
  112. * The justified rate is calculated by two steps. The first is to multiply
  113. * user-rate by (1 - PER) and the other is to smooth the step 1's result
  114. * by a low pass filter.
  115. * This change allows HL download scheduling to consider the WLAN rate
  116. * that will be used for transmitting the downloaded frames.
  117. * 3.24 Expand rx_reorder_stats
  118. * (add counter for decrypt / MIC errors)
  119. * 3.25 Expand rx_reorder_stats
  120. * (add counter of frames received into both local + remote rings)
  121. * 3.26 Add stats struct for counting rx of tx BF, MU, SU, and NDPA frames
  122. * (HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT, rx_txbf_musu_ndpa_pkts_stats)
  123. * 3.27 Add a new interface for flow-control. The following t2h messages have
  124. * been included: HTT_T2H_MSG_TYPE_FLOW_POOL_MAP and
  125. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  126. * 3.28 Add a new interface for ring interface change. The following two h2t
  127. * and one t2h messages have been included:
  128. * HTT_H2T_MSG_TYPE_SRING_SETUP, HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG,
  129. * and HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  130. * 3.29 Add definitions of htt_tx_msdu_desc_ext2_t descriptor and other
  131. * information elements passed from the host to a Lithium target,
  132. * Add definitions of the HTT_H2T ADD_WDS_ENTRY and DELETE_WDS_ENTRY
  133. * messages and the HTT_T2H MAP_FLOW_INFO message (for use with Lithium
  134. * targets).
  135. * 3.30 Add pktlog flag inside HTT_T2H RX_IN_ORD_PADDR_IND message
  136. * 3.31 Add HTT_H2T_MSG_TYPE_RFS_CONFIG
  137. * 3.32 Add HTT_WDI_IPA_OPCODE_SHARING_STATS, HTT_WDI_IPA_OPCODE_SET_QUOTA and
  138. * HTT_WDI_IPA_OPCODE_IND_QUOTA for getting quota and reporting WiFi
  139. * sharing stats
  140. * 3.33 Add HTT_TX_COMPL_IND_STAT_DROP and HTT_TX_COMPL_IND_STAT_HOST_INSPECT
  141. * 3.34 Add HW_PEER_ID field to PEER_MAP
  142. * 3.35 Revise bitfield defs of HTT_SRING_SETUP message
  143. * (changes are not backwards compatible, but HTT_SRING_SETUP message is
  144. * not yet in use)
  145. * 3.36 Add HTT_H2T_MSG_TYPE_EXT_STATS_REQ and HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  146. * 3.37 Add HTT_PEER_TYPE and htt_mac_addr defs
  147. * 3.38 Add holes_no_filled field to rx_reorder_stats
  148. * 3.39 Add host_inspected flag to htt_tx_tcl_vdev_metadata
  149. * 3.40 Add optional timestamps in the HTT tx completion
  150. * 3.41 Add optional tx power spec in the HTT tx completion (for DSRC use)
  151. * 3.42 Add PPDU_STATS_CFG + PPDU_STATS_IND
  152. * 3.43 Add HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR defs
  153. * 3.44 Add htt_tx_wbm_completion_v2
  154. * 3.45 Add host_tx_desc_pool flag in htt_tx_msdu_desc_ext2_t
  155. * 3.46 Add MAC ID and payload size fields to HTT_T2H_MSG_TYPE_PKTLOG header
  156. * 3.47 Add HTT_T2H PEER_MAP_V2 and PEER_UNMAP_V2
  157. * 3.48 Add pdev ID field to HTT_T2H_MSG_TYPE_PPDU_STATS_IND and
  158. * HTT_T2H_MSG_TYPE_PKTLOG
  159. * 3.49 Add HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND def
  160. * 3.50 Add learning_frame flag to htt_tx_msdu_desc_ext2_t
  161. * 3.51 Add SW peer ID and TID num to HTT TX WBM COMPLETION
  162. * 3.52 Add HTT_T2H FLOW_POOL_RESIZE msg def
  163. * 3.53 Update HTT_T2H FLOW_POOL_RESIZE msg def
  164. */
  165. #define HTT_CURRENT_VERSION_MAJOR 3
  166. #define HTT_CURRENT_VERSION_MINOR 53
  167. #define HTT_NUM_TX_FRAG_DESC 1024
  168. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  169. #define HTT_CHECK_SET_VAL(field, val) \
  170. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  171. /* macros to assist in sign-extending fields from HTT messages */
  172. #define HTT_SIGN_BIT_MASK(field) \
  173. ((field ## _M + (1 << field ## _S)) >> 1)
  174. #define HTT_SIGN_BIT(_val, field) \
  175. (_val & HTT_SIGN_BIT_MASK(field))
  176. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  177. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  178. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  179. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  180. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  181. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  182. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  183. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  184. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  185. /*
  186. * TEMPORARY:
  187. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  188. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  189. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  190. * updated.
  191. */
  192. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  193. /*
  194. * TEMPORARY:
  195. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  196. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  197. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  198. * updated.
  199. */
  200. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  201. /* HTT Access Category values */
  202. enum HTT_AC_WMM {
  203. /* WMM Access Categories */
  204. HTT_AC_WMM_BE = 0x0,
  205. HTT_AC_WMM_BK = 0x1,
  206. HTT_AC_WMM_VI = 0x2,
  207. HTT_AC_WMM_VO = 0x3,
  208. /* extension Access Categories */
  209. HTT_AC_EXT_NON_QOS = 0x4,
  210. HTT_AC_EXT_UCAST_MGMT = 0x5,
  211. HTT_AC_EXT_MCAST_DATA = 0x6,
  212. HTT_AC_EXT_MCAST_MGMT = 0x7,
  213. };
  214. enum HTT_AC_WMM_MASK {
  215. /* WMM Access Categories */
  216. HTT_AC_WMM_BE_MASK = (1 << HTT_AC_WMM_BE),
  217. HTT_AC_WMM_BK_MASK = (1 << HTT_AC_WMM_BK),
  218. HTT_AC_WMM_VI_MASK = (1 << HTT_AC_WMM_VI),
  219. HTT_AC_WMM_VO_MASK = (1 << HTT_AC_WMM_VO),
  220. /* extension Access Categories */
  221. HTT_AC_EXT_NON_QOS_MASK = (1 << HTT_AC_EXT_NON_QOS),
  222. HTT_AC_EXT_UCAST_MGMT_MASK = (1 << HTT_AC_EXT_UCAST_MGMT),
  223. HTT_AC_EXT_MCAST_DATA_MASK = (1 << HTT_AC_EXT_MCAST_DATA),
  224. HTT_AC_EXT_MCAST_MGMT_MASK = (1 << HTT_AC_EXT_MCAST_MGMT),
  225. };
  226. #define HTT_AC_MASK_WMM \
  227. (HTT_AC_WMM_BE_MASK | HTT_AC_WMM_BK_MASK | \
  228. HTT_AC_WMM_VI_MASK | HTT_AC_WMM_VO_MASK)
  229. #define HTT_AC_MASK_EXT \
  230. (HTT_AC_EXT_NON_QOS_MASK | HTT_AC_EXT_UCAST_MGMT_MASK | \
  231. HTT_AC_EXT_MCAST_DATA_MASK | HTT_AC_EXT_MCAST_MGMT_MASK)
  232. #define HTT_AC_MASK_ALL (HTT_AC_MASK_WMM | HTT_AC_MASK_EXT)
  233. /*
  234. * htt_dbg_stats_type -
  235. * bit positions for each stats type within a stats type bitmask
  236. * The bitmask contains 24 bits.
  237. */
  238. enum htt_dbg_stats_type {
  239. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  240. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  241. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  242. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  243. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  244. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  245. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  246. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  247. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  248. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  249. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  250. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  251. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  252. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  253. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  254. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  255. /* bits 16-23 currently reserved */
  256. /* keep this last */
  257. HTT_DBG_NUM_STATS
  258. };
  259. /*=== HTT option selection TLVs ===
  260. * Certain HTT messages have alternatives or options.
  261. * For such cases, the host and target need to agree on which option to use.
  262. * Option specification TLVs can be appended to the VERSION_REQ and
  263. * VERSION_CONF messages to select options other than the default.
  264. * These TLVs are entirely optional - if they are not provided, there is a
  265. * well-defined default for each option. If they are provided, they can be
  266. * provided in any order. Each TLV can be present or absent independent of
  267. * the presence / absence of other TLVs.
  268. *
  269. * The HTT option selection TLVs use the following format:
  270. * |31 16|15 8|7 0|
  271. * |---------------------------------+----------------+----------------|
  272. * | value (payload) | length | tag |
  273. * |-------------------------------------------------------------------|
  274. * The value portion need not be only 2 bytes; it can be extended by any
  275. * integer number of 4-byte units. The total length of the TLV, including
  276. * the tag and length fields, must be a multiple of 4 bytes. The length
  277. * field specifies the total TLV size in 4-byte units. Thus, the typical
  278. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  279. * field, would store 0x1 in its length field, to show that the TLV occupies
  280. * a single 4-byte unit.
  281. */
  282. /*--- TLV header format - applies to all HTT option TLVs ---*/
  283. enum HTT_OPTION_TLV_TAGS {
  284. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  285. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  286. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  287. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  288. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  289. };
  290. PREPACK struct htt_option_tlv_header_t {
  291. A_UINT8 tag;
  292. A_UINT8 length;
  293. } POSTPACK;
  294. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  295. #define HTT_OPTION_TLV_TAG_S 0
  296. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  297. #define HTT_OPTION_TLV_LENGTH_S 8
  298. /*
  299. * value0 - 16 bit value field stored in word0
  300. * The TLV's value field may be longer than 2 bytes, in which case
  301. * the remainder of the value is stored in word1, word2, etc.
  302. */
  303. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  304. #define HTT_OPTION_TLV_VALUE0_S 16
  305. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  306. do { \
  307. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  308. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  309. } while (0)
  310. #define HTT_OPTION_TLV_TAG_GET(word) \
  311. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  312. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  313. do { \
  314. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  315. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  316. } while (0)
  317. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  318. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  319. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  320. do { \
  321. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  322. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  323. } while (0)
  324. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  325. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  326. /*--- format of specific HTT option TLVs ---*/
  327. /*
  328. * HTT option TLV for specifying LL bus address size
  329. * Some chips require bus addresses used by the target to access buffers
  330. * within the host's memory to be 32 bits; others require bus addresses
  331. * used by the target to access buffers within the host's memory to be
  332. * 64 bits.
  333. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  334. * a suffix to the VERSION_CONF message to specify which bus address format
  335. * the target requires.
  336. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  337. * default to providing bus addresses to the target in 32-bit format.
  338. */
  339. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  340. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  341. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  342. };
  343. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  344. struct htt_option_tlv_header_t hdr;
  345. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  346. } POSTPACK;
  347. /*
  348. * HTT option TLV for specifying whether HL systems should indicate
  349. * over-the-air tx completion for individual frames, or should instead
  350. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  351. * requests an OTA tx completion for a particular tx frame.
  352. * This option does not apply to LL systems, where the TX_COMPL_IND
  353. * is mandatory.
  354. * This option is primarily intended for HL systems in which the tx frame
  355. * downloads over the host --> target bus are as slow as or slower than
  356. * the transmissions over the WLAN PHY. For cases where the bus is faster
  357. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  358. * and consquently will send one TX_COMPL_IND message that covers several
  359. * tx frames. For cases where the WLAN PHY is faster than the bus,
  360. * the target will end up transmitting very short A-MPDUs, and consequently
  361. * sending many TX_COMPL_IND messages, which each cover a very small number
  362. * of tx frames.
  363. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  364. * a suffix to the VERSION_REQ message to request whether the host desires to
  365. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  366. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  367. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  368. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  369. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  370. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  371. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  372. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  373. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  374. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  375. * TLV.
  376. */
  377. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  378. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  379. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  380. };
  381. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  382. struct htt_option_tlv_header_t hdr;
  383. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  384. } POSTPACK;
  385. /*
  386. * HTT option TLV for specifying how many tx queue groups the target
  387. * may establish.
  388. * This TLV specifies the maximum value the target may send in the
  389. * txq_group_id field of any TXQ_GROUP information elements sent by
  390. * the target to the host. This allows the host to pre-allocate an
  391. * appropriate number of tx queue group structs.
  392. *
  393. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  394. * a suffix to the VERSION_REQ message to specify whether the host supports
  395. * tx queue groups at all, and if so if there is any limit on the number of
  396. * tx queue groups that the host supports.
  397. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  398. * a suffix to the VERSION_CONF message. If the host has specified in the
  399. * VER_REQ message a limit on the number of tx queue groups the host can
  400. * supprt, the target shall limit its specification of the maximum tx groups
  401. * to be no larger than this host-specified limit.
  402. *
  403. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  404. * shall preallocate 4 tx queue group structs, and the target shall not
  405. * specify a txq_group_id larger than 3.
  406. */
  407. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  408. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  409. /*
  410. * values 1 through N specify the max number of tx queue groups
  411. * the sender supports
  412. */
  413. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  414. };
  415. /* TEMPORARY backwards-compatibility alias for a typo fix -
  416. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  417. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  418. * to support the old name (with the typo) until all references to the
  419. * old name are replaced with the new name.
  420. */
  421. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  422. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  423. struct htt_option_tlv_header_t hdr;
  424. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  425. } POSTPACK;
  426. /*
  427. * HTT option TLV for specifying whether the target supports an extended
  428. * version of the HTT tx descriptor. If the target provides this TLV
  429. * and specifies in the TLV that the target supports an extended version
  430. * of the HTT tx descriptor, the target must check the "extension" bit in
  431. * the HTT tx descriptor, and if the extension bit is set, to expect a
  432. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  433. * descriptor. Furthermore, the target must provide room for the HTT
  434. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  435. * This option is intended for systems where the host needs to explicitly
  436. * control the transmission parameters such as tx power for individual
  437. * tx frames.
  438. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  439. * as a suffix to the VERSION_CONF message to explicitly specify whether
  440. * the target supports the HTT tx MSDU extension descriptor.
  441. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  442. * by the host as lack of target support for the HTT tx MSDU extension
  443. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  444. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  445. * the HTT tx MSDU extension descriptor.
  446. * The host is not required to provide the HTT tx MSDU extension descriptor
  447. * just because the target supports it; the target must check the
  448. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  449. * extension descriptor is present.
  450. */
  451. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  452. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  453. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  454. };
  455. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  456. struct htt_option_tlv_header_t hdr;
  457. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  458. } POSTPACK;
  459. /*=== host -> target messages ===============================================*/
  460. enum htt_h2t_msg_type {
  461. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  462. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  463. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  464. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  465. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  466. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  467. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  468. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  469. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  470. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  471. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  472. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  473. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  474. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  475. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  476. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  477. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  478. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  479. /* keep this last */
  480. HTT_H2T_NUM_MSGS
  481. };
  482. /*
  483. * HTT host to target message type -
  484. * stored in bits 7:0 of the first word of the message
  485. */
  486. #define HTT_H2T_MSG_TYPE_M 0xff
  487. #define HTT_H2T_MSG_TYPE_S 0
  488. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  489. do { \
  490. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  491. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  492. } while (0)
  493. #define HTT_H2T_MSG_TYPE_GET(word) \
  494. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  495. /**
  496. * @brief host -> target version number request message definition
  497. *
  498. * |31 24|23 16|15 8|7 0|
  499. * |----------------+----------------+----------------+----------------|
  500. * | reserved | msg type |
  501. * |-------------------------------------------------------------------|
  502. * : option request TLV (optional) |
  503. * :...................................................................:
  504. *
  505. * The VER_REQ message may consist of a single 4-byte word, or may be
  506. * extended with TLVs that specify which HTT options the host is requesting
  507. * from the target.
  508. * The following option TLVs may be appended to the VER_REQ message:
  509. * - HL_SUPPRESS_TX_COMPL_IND
  510. * - HL_MAX_TX_QUEUE_GROUPS
  511. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  512. * may be appended to the VER_REQ message (but only one TLV of each type).
  513. *
  514. * Header fields:
  515. * - MSG_TYPE
  516. * Bits 7:0
  517. * Purpose: identifies this as a version number request message
  518. * Value: 0x0
  519. */
  520. #define HTT_VER_REQ_BYTES 4
  521. /* TBDXXX: figure out a reasonable number */
  522. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  523. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  524. /**
  525. * @brief HTT tx MSDU descriptor
  526. *
  527. * @details
  528. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  529. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  530. * the target firmware needs for the FW's tx processing, particularly
  531. * for creating the HW msdu descriptor.
  532. * The same HTT tx descriptor is used for HL and LL systems, though
  533. * a few fields within the tx descriptor are used only by LL or
  534. * only by HL.
  535. * The HTT tx descriptor is defined in two manners: by a struct with
  536. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  537. * definitions.
  538. * The target should use the struct def, for simplicitly and clarity,
  539. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  540. * neutral. Specifically, the host shall use the get/set macros built
  541. * around the mask + shift defs.
  542. */
  543. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  544. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  545. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  546. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  547. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  548. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  549. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  550. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  551. #define HTT_TX_VDEV_ID_WORD 0
  552. #define HTT_TX_VDEV_ID_MASK 0x3f
  553. #define HTT_TX_VDEV_ID_SHIFT 16
  554. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  555. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  556. #define HTT_TX_MSDU_LEN_DWORD 1
  557. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  558. /*
  559. * HTT_VAR_PADDR macros
  560. * Allow physical / bus addresses to be either a single 32-bit value,
  561. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  562. */
  563. #define HTT_VAR_PADDR32(var_name) \
  564. A_UINT32 var_name
  565. #define HTT_VAR_PADDR64_LE(var_name) \
  566. struct { \
  567. /* little-endian: lo precedes hi */ \
  568. A_UINT32 lo; \
  569. A_UINT32 hi; \
  570. } var_name
  571. /*
  572. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  573. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  574. * addresses are stored in a XXX-bit field.
  575. * This macro is used to define both htt_tx_msdu_desc32_t and
  576. * htt_tx_msdu_desc64_t structs.
  577. */
  578. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  579. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  580. { \
  581. /* DWORD 0: flags and meta-data */ \
  582. A_UINT32 \
  583. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  584. \
  585. /* pkt_subtype - \
  586. * Detailed specification of the tx frame contents, extending the \
  587. * general specification provided by pkt_type. \
  588. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  589. * pkt_type | pkt_subtype \
  590. * ============================================================== \
  591. * 802.3 | bit 0:3 - Reserved \
  592. * | bit 4: 0x0 - Copy-Engine Classification Results \
  593. * | not appended to the HTT message \
  594. * | 0x1 - Copy-Engine Classification Results \
  595. * | appended to the HTT message in the \
  596. * | format: \
  597. * | [HTT tx desc, frame header, \
  598. * | CE classification results] \
  599. * | The CE classification results begin \
  600. * | at the next 4-byte boundary after \
  601. * | the frame header. \
  602. * ------------+------------------------------------------------- \
  603. * Eth2 | bit 0:3 - Reserved \
  604. * | bit 4: 0x0 - Copy-Engine Classification Results \
  605. * | not appended to the HTT message \
  606. * | 0x1 - Copy-Engine Classification Results \
  607. * | appended to the HTT message. \
  608. * | See the above specification of the \
  609. * | CE classification results location. \
  610. * ------------+------------------------------------------------- \
  611. * native WiFi | bit 0:3 - Reserved \
  612. * | bit 4: 0x0 - Copy-Engine Classification Results \
  613. * | not appended to the HTT message \
  614. * | 0x1 - Copy-Engine Classification Results \
  615. * | appended to the HTT message. \
  616. * | See the above specification of the \
  617. * | CE classification results location. \
  618. * ------------+------------------------------------------------- \
  619. * mgmt | 0x0 - 802.11 MAC header absent \
  620. * | 0x1 - 802.11 MAC header present \
  621. * ------------+------------------------------------------------- \
  622. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  623. * | 0x1 - 802.11 MAC header present \
  624. * | bit 1: 0x0 - allow aggregation \
  625. * | 0x1 - don't allow aggregation \
  626. * | bit 2: 0x0 - perform encryption \
  627. * | 0x1 - don't perform encryption \
  628. * | bit 3: 0x0 - perform tx classification / queuing \
  629. * | 0x1 - don't perform tx classification; \
  630. * | insert the frame into the "misc" \
  631. * | tx queue \
  632. * | bit 4: 0x0 - Copy-Engine Classification Results \
  633. * | not appended to the HTT message \
  634. * | 0x1 - Copy-Engine Classification Results \
  635. * | appended to the HTT message. \
  636. * | See the above specification of the \
  637. * | CE classification results location. \
  638. */ \
  639. pkt_subtype: 5, \
  640. \
  641. /* pkt_type - \
  642. * General specification of the tx frame contents. \
  643. * The htt_pkt_type enum should be used to specify and check the \
  644. * value of this field. \
  645. */ \
  646. pkt_type: 3, \
  647. \
  648. /* vdev_id - \
  649. * ID for the vdev that is sending this tx frame. \
  650. * For certain non-standard packet types, e.g. pkt_type == raw \
  651. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  652. * This field is used primarily for determining where to queue \
  653. * broadcast and multicast frames. \
  654. */ \
  655. vdev_id: 6, \
  656. /* ext_tid - \
  657. * The extended traffic ID. \
  658. * If the TID is unknown, the extended TID is set to \
  659. * HTT_TX_EXT_TID_INVALID. \
  660. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  661. * value of the QoS TID. \
  662. * If the tx frame is non-QoS data, then the extended TID is set to \
  663. * HTT_TX_EXT_TID_NON_QOS. \
  664. * If the tx frame is multicast or broadcast, then the extended TID \
  665. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  666. */ \
  667. ext_tid: 5, \
  668. \
  669. /* postponed - \
  670. * This flag indicates whether the tx frame has been downloaded to \
  671. * the target before but discarded by the target, and now is being \
  672. * downloaded again; or if this is a new frame that is being \
  673. * downloaded for the first time. \
  674. * This flag allows the target to determine the correct order for \
  675. * transmitting new vs. old frames. \
  676. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  677. * This flag only applies to HL systems, since in LL systems, \
  678. * the tx flow control is handled entirely within the target. \
  679. */ \
  680. postponed: 1, \
  681. \
  682. /* extension - \
  683. * This flag indicates whether a HTT tx MSDU extension descriptor \
  684. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  685. * \
  686. * 0x0 - no extension MSDU descriptor is present \
  687. * 0x1 - an extension MSDU descriptor immediately follows the \
  688. * regular MSDU descriptor \
  689. */ \
  690. extension: 1, \
  691. \
  692. /* cksum_offload - \
  693. * This flag indicates whether checksum offload is enabled or not \
  694. * for this frame. Target FW use this flag to turn on HW checksumming \
  695. * 0x0 - No checksum offload \
  696. * 0x1 - L3 header checksum only \
  697. * 0x2 - L4 checksum only \
  698. * 0x3 - L3 header checksum + L4 checksum \
  699. */ \
  700. cksum_offload: 2, \
  701. \
  702. /* tx_comp_req - \
  703. * This flag indicates whether Tx Completion \
  704. * from fw is required or not. \
  705. * This flag is only relevant if tx completion is not \
  706. * universally enabled. \
  707. * For all LL systems, tx completion is mandatory, \
  708. * so this flag will be irrelevant. \
  709. * For HL systems tx completion is optional, but HL systems in which \
  710. * the bus throughput exceeds the WLAN throughput will \
  711. * probably want to always use tx completion, and thus \
  712. * would not check this flag. \
  713. * This flag is required when tx completions are not used universally, \
  714. * but are still required for certain tx frames for which \
  715. * an OTA delivery acknowledgment is needed by the host. \
  716. * In practice, this would be for HL systems in which the \
  717. * bus throughput is less than the WLAN throughput. \
  718. * \
  719. * 0x0 - Tx Completion Indication from Fw not required \
  720. * 0x1 - Tx Completion Indication from Fw is required \
  721. */ \
  722. tx_compl_req: 1; \
  723. \
  724. \
  725. /* DWORD 1: MSDU length and ID */ \
  726. A_UINT32 \
  727. len: 16, /* MSDU length, in bytes */ \
  728. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  729. * and this id is used to calculate fragmentation \
  730. * descriptor pointer inside the target based on \
  731. * the base address, configured inside the target. \
  732. */ \
  733. \
  734. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  735. /* frags_desc_ptr - \
  736. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  737. * where the tx frame's fragments reside in memory. \
  738. * This field only applies to LL systems, since in HL systems the \
  739. * (degenerate single-fragment) fragmentation descriptor is created \
  740. * within the target. \
  741. */ \
  742. _paddr__frags_desc_ptr_; \
  743. \
  744. /* DWORD 3 (or 4): peerid, chanfreq */ \
  745. /* \
  746. * Peer ID : Target can use this value to know which peer-id packet \
  747. * destined to. \
  748. * It's intended to be specified by host in case of NAWDS. \
  749. */ \
  750. A_UINT16 peerid; \
  751. \
  752. /* \
  753. * Channel frequency: This identifies the desired channel \
  754. * frequency (in mhz) for tx frames. This is used by FW to help \
  755. * determine when it is safe to transmit or drop frames for \
  756. * off-channel operation. \
  757. * The default value of zero indicates to FW that the corresponding \
  758. * VDEV's home channel (if there is one) is the desired channel \
  759. * frequency. \
  760. */ \
  761. A_UINT16 chanfreq; \
  762. \
  763. /* Reason reserved is commented is increasing the htt structure size \
  764. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  765. * A_UINT32 reserved_dword3_bits0_31; \
  766. */ \
  767. } POSTPACK
  768. /* define a htt_tx_msdu_desc32_t type */
  769. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  770. /* define a htt_tx_msdu_desc64_t type */
  771. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  772. /*
  773. * Make htt_tx_msdu_desc_t be an alias for either
  774. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  775. */
  776. #if HTT_PADDR64
  777. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  778. #else
  779. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  780. #endif
  781. /* decriptor information for Management frame*/
  782. /*
  783. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  784. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  785. */
  786. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  787. extern A_UINT32 mgmt_hdr_len;
  788. PREPACK struct htt_mgmt_tx_desc_t {
  789. A_UINT32 msg_type;
  790. #if HTT_PADDR64
  791. A_UINT64 frag_paddr; /* DMAble address of the data */
  792. #else
  793. A_UINT32 frag_paddr; /* DMAble address of the data */
  794. #endif
  795. A_UINT32 desc_id; /* returned to host during completion
  796. * to free the meory*/
  797. A_UINT32 len; /* Fragment length */
  798. A_UINT32 vdev_id; /* virtual device ID*/
  799. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  800. } POSTPACK;
  801. PREPACK struct htt_mgmt_tx_compl_ind {
  802. A_UINT32 desc_id;
  803. A_UINT32 status;
  804. } POSTPACK;
  805. /*
  806. * This SDU header size comes from the summation of the following:
  807. * 1. Max of:
  808. * a. Native WiFi header, for native WiFi frames: 24 bytes
  809. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  810. * b. 802.11 header, for raw frames: 36 bytes
  811. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  812. * QoS header, HT header)
  813. * c. 802.3 header, for ethernet frames: 14 bytes
  814. * (destination address, source address, ethertype / length)
  815. * 2. Max of:
  816. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  817. * b. IPv6 header, up through the Traffic Class: 2 bytes
  818. * 3. 802.1Q VLAN header: 4 bytes
  819. * 4. LLC/SNAP header: 8 bytes
  820. */
  821. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  822. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  823. #define HTT_TX_HDR_SIZE_ETHERNET 14
  824. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  825. A_COMPILE_TIME_ASSERT(
  826. htt_encap_hdr_size_max_check_nwifi,
  827. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  828. A_COMPILE_TIME_ASSERT(
  829. htt_encap_hdr_size_max_check_enet,
  830. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  831. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  832. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  833. #define HTT_TX_HDR_SIZE_802_1Q 4
  834. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  835. #define HTT_COMMON_TX_FRM_HDR_LEN \
  836. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  837. HTT_TX_HDR_SIZE_802_1Q + \
  838. HTT_TX_HDR_SIZE_LLC_SNAP)
  839. #define HTT_HL_TX_FRM_HDR_LEN \
  840. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  841. #define HTT_LL_TX_FRM_HDR_LEN \
  842. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  843. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  844. /* dword 0 */
  845. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  846. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  847. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  848. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  849. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  850. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  851. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  852. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  853. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  854. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  855. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  856. #define HTT_TX_DESC_PKT_TYPE_S 13
  857. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  858. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  859. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  860. #define HTT_TX_DESC_VDEV_ID_S 16
  861. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  862. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  863. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  864. #define HTT_TX_DESC_EXT_TID_S 22
  865. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  866. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  867. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  868. #define HTT_TX_DESC_POSTPONED_S 27
  869. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  870. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  871. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  872. #define HTT_TX_DESC_EXTENSION_S 28
  873. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  874. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  875. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  876. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  877. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  878. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  879. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  880. #define HTT_TX_DESC_TX_COMP_S 31
  881. /* dword 1 */
  882. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  883. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  884. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  885. #define HTT_TX_DESC_FRM_LEN_S 0
  886. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  887. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  888. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  889. #define HTT_TX_DESC_FRM_ID_S 16
  890. /* dword 2 */
  891. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  892. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  893. /* for systems using 64-bit format for bus addresses */
  894. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  895. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  896. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  897. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  898. /* for systems using 32-bit format for bus addresses */
  899. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  900. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  901. /* dword 3 */
  902. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  903. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  904. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  905. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  906. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  907. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  908. #if HTT_PADDR64
  909. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  910. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  911. #else
  912. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  913. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  914. #endif
  915. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  916. #define HTT_TX_DESC_PEER_ID_S 0
  917. /*
  918. * TEMPORARY:
  919. * The original definitions for the PEER_ID fields contained typos
  920. * (with _DESC_PADDR appended to this PEER_ID field name).
  921. * Retain deprecated original names for PEER_ID fields until all code that
  922. * refers to them has been updated.
  923. */
  924. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  925. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  926. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  927. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  928. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  929. HTT_TX_DESC_PEER_ID_M
  930. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  931. HTT_TX_DESC_PEER_ID_S
  932. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  933. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  934. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  935. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  936. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  937. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  938. #if HTT_PADDR64
  939. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  940. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  941. #else
  942. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  943. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  944. #endif
  945. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  946. #define HTT_TX_DESC_CHAN_FREQ_S 16
  947. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  948. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  949. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  950. do { \
  951. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  952. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  953. } while (0)
  954. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  955. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  956. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  957. do { \
  958. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  959. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  960. } while (0)
  961. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  962. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  963. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  964. do { \
  965. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  966. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  967. } while (0)
  968. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  969. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  970. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  971. do { \
  972. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  973. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  974. } while (0)
  975. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  976. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  977. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  978. do { \
  979. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  980. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  981. } while (0)
  982. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  983. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  984. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  985. do { \
  986. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  987. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  988. } while (0)
  989. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  990. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  991. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  992. do { \
  993. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  994. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  995. } while (0)
  996. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  997. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  998. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  999. do { \
  1000. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1001. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1002. } while (0)
  1003. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1004. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1005. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1006. do { \
  1007. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1008. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1009. } while (0)
  1010. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1011. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1012. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1013. do { \
  1014. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1015. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1016. } while (0)
  1017. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1018. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1019. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1020. do { \
  1021. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1022. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1023. } while (0)
  1024. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1025. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1026. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1027. do { \
  1028. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1029. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1030. } while (0)
  1031. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1032. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1033. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1034. do { \
  1035. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1036. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1037. } while (0)
  1038. /* enums used in the HTT tx MSDU extension descriptor */
  1039. enum {
  1040. htt_tx_guard_interval_regular = 0,
  1041. htt_tx_guard_interval_short = 1,
  1042. };
  1043. enum {
  1044. htt_tx_preamble_type_ofdm = 0,
  1045. htt_tx_preamble_type_cck = 1,
  1046. htt_tx_preamble_type_ht = 2,
  1047. htt_tx_preamble_type_vht = 3,
  1048. };
  1049. enum {
  1050. htt_tx_bandwidth_5MHz = 0,
  1051. htt_tx_bandwidth_10MHz = 1,
  1052. htt_tx_bandwidth_20MHz = 2,
  1053. htt_tx_bandwidth_40MHz = 3,
  1054. htt_tx_bandwidth_80MHz = 4,
  1055. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1056. };
  1057. /**
  1058. * @brief HTT tx MSDU extension descriptor
  1059. * @details
  1060. * If the target supports HTT tx MSDU extension descriptors, the host has
  1061. * the option of appending the following struct following the regular
  1062. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1063. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1064. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1065. * tx specs for each frame.
  1066. */
  1067. PREPACK struct htt_tx_msdu_desc_ext_t {
  1068. /* DWORD 0: flags */
  1069. A_UINT32
  1070. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1071. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1072. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1073. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1074. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1075. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1076. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1077. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1078. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1079. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1080. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1081. /* DWORD 1: tx power, tx rate, tx BW */
  1082. A_UINT32
  1083. /* pwr -
  1084. * Specify what power the tx frame needs to be transmitted at.
  1085. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1086. * The value needs to be appropriately sign-extended when extracting
  1087. * the value from the message and storing it in a variable that is
  1088. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1089. * automatically handles this sign-extension.)
  1090. * If the transmission uses multiple tx chains, this power spec is
  1091. * the total transmit power, assuming incoherent combination of
  1092. * per-chain power to produce the total power.
  1093. */
  1094. pwr: 8,
  1095. /* mcs_mask -
  1096. * Specify the allowable values for MCS index (modulation and coding)
  1097. * to use for transmitting the frame.
  1098. *
  1099. * For HT / VHT preamble types, this mask directly corresponds to
  1100. * the HT or VHT MCS indices that are allowed. For each bit N set
  1101. * within the mask, MCS index N is allowed for transmitting the frame.
  1102. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1103. * rates versus OFDM rates, so the host has the option of specifying
  1104. * that the target must transmit the frame with CCK or OFDM rates
  1105. * (not HT or VHT), but leaving the decision to the target whether
  1106. * to use CCK or OFDM.
  1107. *
  1108. * For CCK and OFDM, the bits within this mask are interpreted as
  1109. * follows:
  1110. * bit 0 -> CCK 1 Mbps rate is allowed
  1111. * bit 1 -> CCK 2 Mbps rate is allowed
  1112. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1113. * bit 3 -> CCK 11 Mbps rate is allowed
  1114. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1115. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1116. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1117. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1118. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1119. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1120. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1121. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1122. *
  1123. * The MCS index specification needs to be compatible with the
  1124. * bandwidth mask specification. For example, a MCS index == 9
  1125. * specification is inconsistent with a preamble type == VHT,
  1126. * Nss == 1, and channel bandwidth == 20 MHz.
  1127. *
  1128. * Furthermore, the host has only a limited ability to specify to
  1129. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1130. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1131. */
  1132. mcs_mask: 12,
  1133. /* nss_mask -
  1134. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1135. * Each bit in this mask corresponds to a Nss value:
  1136. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1137. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1138. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1139. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1140. * The values in the Nss mask must be suitable for the recipient, e.g.
  1141. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1142. * recipient which only supports 2x2 MIMO.
  1143. */
  1144. nss_mask: 4,
  1145. /* guard_interval -
  1146. * Specify a htt_tx_guard_interval enum value to indicate whether
  1147. * the transmission should use a regular guard interval or a
  1148. * short guard interval.
  1149. */
  1150. guard_interval: 1,
  1151. /* preamble_type_mask -
  1152. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1153. * may choose from for transmitting this frame.
  1154. * The bits in this mask correspond to the values in the
  1155. * htt_tx_preamble_type enum. For example, to allow the target
  1156. * to transmit the frame as either CCK or OFDM, this field would
  1157. * be set to
  1158. * (1 << htt_tx_preamble_type_ofdm) |
  1159. * (1 << htt_tx_preamble_type_cck)
  1160. */
  1161. preamble_type_mask: 4,
  1162. reserved1_31_29: 3; /* unused, set to 0x0 */
  1163. /* DWORD 2: tx chain mask, tx retries */
  1164. A_UINT32
  1165. /* chain_mask - specify which chains to transmit from */
  1166. chain_mask: 4,
  1167. /* retry_limit -
  1168. * Specify the maximum number of transmissions, including the
  1169. * initial transmission, to attempt before giving up if no ack
  1170. * is received.
  1171. * If the tx rate is specified, then all retries shall use the
  1172. * same rate as the initial transmission.
  1173. * If no tx rate is specified, the target can choose whether to
  1174. * retain the original rate during the retransmissions, or to
  1175. * fall back to a more robust rate.
  1176. */
  1177. retry_limit: 4,
  1178. /* bandwidth_mask -
  1179. * Specify what channel widths may be used for the transmission.
  1180. * A value of zero indicates "don't care" - the target may choose
  1181. * the transmission bandwidth.
  1182. * The bits within this mask correspond to the htt_tx_bandwidth
  1183. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1184. * The bandwidth_mask must be consistent with the preamble_type_mask
  1185. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1186. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1187. */
  1188. bandwidth_mask: 6,
  1189. reserved2_31_14: 18; /* unused, set to 0x0 */
  1190. /* DWORD 3: tx expiry time (TSF) LSBs */
  1191. A_UINT32 expire_tsf_lo;
  1192. /* DWORD 4: tx expiry time (TSF) MSBs */
  1193. A_UINT32 expire_tsf_hi;
  1194. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1195. } POSTPACK;
  1196. /* DWORD 0 */
  1197. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1198. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1199. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1200. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1201. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1202. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1203. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1204. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1205. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1206. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1207. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1208. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1209. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1210. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1211. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1212. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1213. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1214. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1215. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1216. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1217. /* DWORD 1 */
  1218. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1219. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1220. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1221. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1222. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1223. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1224. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1225. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1226. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1227. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1228. /* DWORD 2 */
  1229. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1230. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1231. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1232. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1233. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1234. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1235. /* DWORD 0 */
  1236. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1237. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1238. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1239. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1240. do { \
  1241. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1242. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1243. } while (0)
  1244. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1245. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1246. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1247. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1248. do { \
  1249. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1250. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1251. } while (0)
  1252. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1253. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1254. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1255. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1256. do { \
  1257. HTT_CHECK_SET_VAL( \
  1258. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1259. ((_var) |= ((_val) \
  1260. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1261. } while (0)
  1262. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1263. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1264. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1265. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1266. do { \
  1267. HTT_CHECK_SET_VAL( \
  1268. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1269. ((_var) |= ((_val) \
  1270. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1271. } while (0)
  1272. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1273. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1274. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1275. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1276. do { \
  1277. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1278. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1279. } while (0)
  1280. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1281. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1282. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1283. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1284. do { \
  1285. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1286. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1287. } while (0)
  1288. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1289. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1290. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1291. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1292. do { \
  1293. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1294. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1295. } while (0)
  1296. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1297. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1298. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1299. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1300. do { \
  1301. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1302. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1303. } while (0)
  1304. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1305. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1306. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1307. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1308. do { \
  1309. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1310. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1311. } while (0)
  1312. /* DWORD 1 */
  1313. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1314. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1315. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1316. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1317. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1318. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1319. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1320. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1321. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1322. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1323. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1324. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1325. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1326. do { \
  1327. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1328. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1329. } while (0)
  1330. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1331. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1332. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1333. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1334. do { \
  1335. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1336. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1337. } while (0)
  1338. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1339. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1340. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1341. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1342. do { \
  1343. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1344. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1345. } while (0)
  1346. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1347. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1348. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1349. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1350. do { \
  1351. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1352. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1353. } while (0)
  1354. /* DWORD 2 */
  1355. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1356. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1357. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1358. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1359. do { \
  1360. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1361. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1362. } while (0)
  1363. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1364. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1365. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1366. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1367. do { \
  1368. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1369. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1370. } while (0)
  1371. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1372. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1373. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1374. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1375. do { \
  1376. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1377. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1378. } while (0)
  1379. typedef enum {
  1380. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1381. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1382. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1383. } htt_11ax_ltf_subtype_t;
  1384. typedef enum {
  1385. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1386. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1387. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1388. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1389. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1390. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1391. } htt_tx_ext2_preamble_type_t;
  1392. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1393. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1394. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1395. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1396. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1397. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1398. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1399. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1400. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1401. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1402. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1403. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1404. /**
  1405. * @brief HTT tx MSDU extension descriptor v2
  1406. * @details
  1407. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1408. * is received as tcl_exit_base->host_meta_info in firmware.
  1409. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1410. * are already part of tcl_exit_base.
  1411. */
  1412. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1413. /* DWORD 0: flags */
  1414. A_UINT32
  1415. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1416. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1417. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1418. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1419. valid_retries : 1, /* if set, tx retries spec is valid */
  1420. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1421. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1422. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1423. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1424. valid_key_flags : 1, /* if set, key flags is valid */
  1425. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1426. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1427. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1428. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1429. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1430. 1 = ENCRYPT,
  1431. 2 ~ 3 - Reserved */
  1432. /* retry_limit -
  1433. * Specify the maximum number of transmissions, including the
  1434. * initial transmission, to attempt before giving up if no ack
  1435. * is received.
  1436. * If the tx rate is specified, then all retries shall use the
  1437. * same rate as the initial transmission.
  1438. * If no tx rate is specified, the target can choose whether to
  1439. * retain the original rate during the retransmissions, or to
  1440. * fall back to a more robust rate.
  1441. */
  1442. retry_limit : 4,
  1443. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1444. * Valid only for 11ax preamble types HE_SU
  1445. * and HE_EXT_SU
  1446. */
  1447. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1448. * Valid only for 11ax preamble types HE_SU
  1449. * and HE_EXT_SU
  1450. */
  1451. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1452. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1453. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1454. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1455. */
  1456. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1457. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1458. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1459. * Use cases:
  1460. * Any time firmware uses TQM-BYPASS for Data
  1461. * TID, firmware expect host to set this bit.
  1462. */
  1463. /* DWORD 1: tx power, tx rate */
  1464. A_UINT32
  1465. power : 8, /* unit of the power field is 0.5 dbm
  1466. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1467. * signed value ranging from -64dbm to 63.5 dbm
  1468. */
  1469. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1470. * Setting more than one MCS isn't currently
  1471. * supported by the target (but is supported
  1472. * in the interface in case in the future
  1473. * the target supports specifications of
  1474. * a limited set of MCS values.
  1475. */
  1476. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1477. * Setting more than one Nss isn't currently
  1478. * supported by the target (but is supported
  1479. * in the interface in case in the future
  1480. * the target supports specifications of
  1481. * a limited set of Nss values.
  1482. */
  1483. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1484. update_peer_cache : 1; /* When set these custom values will be
  1485. * used for all packets, until the next
  1486. * update via this ext header.
  1487. * This is to make sure not all packets
  1488. * need to include this header.
  1489. */
  1490. /* DWORD 2: tx chain mask, tx retries */
  1491. A_UINT32
  1492. /* chain_mask - specify which chains to transmit from */
  1493. chain_mask : 8,
  1494. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1495. * TODO: Update Enum values for key_flags
  1496. */
  1497. /*
  1498. * Channel frequency: This identifies the desired channel
  1499. * frequency (in MHz) for tx frames. This is used by FW to help
  1500. * determine when it is safe to transmit or drop frames for
  1501. * off-channel operation.
  1502. * The default value of zero indicates to FW that the corresponding
  1503. * VDEV's home channel (if there is one) is the desired channel
  1504. * frequency.
  1505. */
  1506. chanfreq : 16;
  1507. /* DWORD 3: tx expiry time (TSF) LSBs */
  1508. A_UINT32 expire_tsf_lo;
  1509. /* DWORD 4: tx expiry time (TSF) MSBs */
  1510. A_UINT32 expire_tsf_hi;
  1511. /* DWORD 5: reserved
  1512. * This structure can be expanded further up to 60 bytes
  1513. * by adding further DWORDs as needed.
  1514. */
  1515. A_UINT32
  1516. /* learning_frame
  1517. * When this flag is set, this frame will be dropped by FW
  1518. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1519. */
  1520. learning_frame : 1,
  1521. rsvd0 : 31;
  1522. } POSTPACK;
  1523. /* DWORD 0 */
  1524. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1525. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1526. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1527. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1528. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1529. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1530. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1531. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1532. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1533. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1534. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1535. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1536. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1537. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1538. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1539. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1540. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1541. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1542. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1543. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1544. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1545. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1546. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1547. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1548. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1549. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1550. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1551. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1552. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1553. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1554. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1555. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1556. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1557. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1558. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1559. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1560. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1561. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1562. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1563. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1564. /* DWORD 1 */
  1565. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1566. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1567. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1568. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1569. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1570. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1571. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1572. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1573. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1574. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1575. /* DWORD 2 */
  1576. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1577. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1578. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1579. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1580. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1581. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1582. /* DWORD 5 */
  1583. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1584. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1585. /* DWORD 0 */
  1586. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1587. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1588. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1589. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1590. do { \
  1591. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1592. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1593. } while (0)
  1594. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1595. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1596. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1597. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1598. do { \
  1599. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1600. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1601. } while (0)
  1602. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1603. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1604. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1605. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1606. do { \
  1607. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1608. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1609. } while (0)
  1610. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1611. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1612. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1613. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1614. do { \
  1615. HTT_CHECK_SET_VAL( \
  1616. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1617. ((_var) |= ((_val) \
  1618. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1619. } while (0)
  1620. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1621. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1622. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1623. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1624. do { \
  1625. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1626. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1627. } while (0)
  1628. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1629. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1630. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1631. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1632. do { \
  1633. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1634. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1635. } while (0)
  1636. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1637. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1638. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1639. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1640. do { \
  1641. HTT_CHECK_SET_VAL( \
  1642. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1643. ((_var) |= ((_val) \
  1644. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1645. } while (0)
  1646. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1647. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1648. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1649. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1650. do { \
  1651. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1652. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1653. } while (0)
  1654. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1655. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1656. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1657. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1658. do { \
  1659. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1660. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1661. } while (0)
  1662. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1663. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1664. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1665. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1666. do { \
  1667. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1668. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1669. } while (0)
  1670. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1671. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1672. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1673. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1674. do { \
  1675. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1676. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1677. } while (0)
  1678. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1679. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1680. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1681. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1682. do { \
  1683. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1684. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1685. } while (0)
  1686. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1687. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1688. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1689. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1690. do { \
  1691. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1692. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1693. } while (0)
  1694. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1695. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1696. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1697. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1698. do { \
  1699. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1700. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1701. } while (0)
  1702. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1703. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1704. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1705. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1706. do { \
  1707. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1708. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1709. } while (0)
  1710. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1711. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1712. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1713. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1714. do { \
  1715. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  1716. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  1717. } while (0)
  1718. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1719. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1720. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1721. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1722. do { \
  1723. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  1724. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  1725. } while (0)
  1726. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1727. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1728. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1729. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1730. do { \
  1731. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  1732. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1733. } while (0)
  1734. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1735. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1736. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1737. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1738. do { \
  1739. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1740. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  1741. } while (0)
  1742. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1743. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1744. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1745. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1746. do { \
  1747. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  1748. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1749. } while (0)
  1750. /* DWORD 1 */
  1751. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1752. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1753. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1754. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1755. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1756. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1757. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1758. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1759. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  1760. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  1761. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  1762. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  1763. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  1764. do { \
  1765. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  1766. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  1767. } while (0)
  1768. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  1769. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  1770. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  1771. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  1772. do { \
  1773. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  1774. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  1775. } while (0)
  1776. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  1777. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  1778. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  1779. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  1780. do { \
  1781. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  1782. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  1783. } while (0)
  1784. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  1785. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  1786. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  1787. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  1788. do { \
  1789. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  1790. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  1791. } while (0)
  1792. /* DWORD 2 */
  1793. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  1794. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  1795. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  1796. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  1797. do { \
  1798. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  1799. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  1800. } while (0)
  1801. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  1802. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  1803. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  1804. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  1805. do { \
  1806. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  1807. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  1808. } while (0)
  1809. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  1810. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  1811. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  1812. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  1813. do { \
  1814. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  1815. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  1816. } while (0)
  1817. /* DWORD 5 */
  1818. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  1819. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  1820. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  1821. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  1822. do { \
  1823. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  1824. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  1825. } while (0)
  1826. typedef enum {
  1827. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  1828. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  1829. } htt_tcl_metadata_type;
  1830. /**
  1831. * @brief HTT TCL command number format
  1832. * @details
  1833. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  1834. * available to firmware as tcl_exit_base->tcl_status_number.
  1835. * For regular / multicast packets host will send vdev and mac id and for
  1836. * NAWDS packets, host will send peer id.
  1837. * A_UINT32 is used to avoid endianness conversion problems.
  1838. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  1839. */
  1840. typedef struct {
  1841. A_UINT32
  1842. type: 1, /* vdev_id based or peer_id based */
  1843. rsvd: 31;
  1844. } htt_tx_tcl_vdev_or_peer_t;
  1845. typedef struct {
  1846. A_UINT32
  1847. type: 1, /* vdev_id based or peer_id based */
  1848. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1849. vdev_id: 8,
  1850. pdev_id: 2,
  1851. host_inspected:1,
  1852. rsvd: 19;
  1853. } htt_tx_tcl_vdev_metadata;
  1854. typedef struct {
  1855. A_UINT32
  1856. type: 1, /* vdev_id based or peer_id based */
  1857. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1858. peer_id: 14,
  1859. rsvd: 16;
  1860. } htt_tx_tcl_peer_metadata;
  1861. PREPACK struct htt_tx_tcl_metadata {
  1862. union {
  1863. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  1864. htt_tx_tcl_vdev_metadata vdev_meta;
  1865. htt_tx_tcl_peer_metadata peer_meta;
  1866. };
  1867. } POSTPACK;
  1868. /* DWORD 0 */
  1869. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  1870. #define HTT_TX_TCL_METADATA_TYPE_S 0
  1871. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  1872. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  1873. /* VDEV metadata */
  1874. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  1875. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  1876. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  1877. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  1878. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  1879. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  1880. /* PEER metadata */
  1881. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  1882. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  1883. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  1884. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  1885. HTT_TX_TCL_METADATA_TYPE_S)
  1886. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  1887. do { \
  1888. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  1889. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  1890. } while (0)
  1891. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  1892. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  1893. HTT_TX_TCL_METADATA_VALID_HTT_S)
  1894. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  1895. do { \
  1896. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  1897. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  1898. } while (0)
  1899. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  1900. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  1901. HTT_TX_TCL_METADATA_VDEV_ID_S)
  1902. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  1903. do { \
  1904. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  1905. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  1906. } while (0)
  1907. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  1908. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  1909. HTT_TX_TCL_METADATA_PDEV_ID_S)
  1910. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  1911. do { \
  1912. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  1913. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  1914. } while (0)
  1915. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  1916. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  1917. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  1918. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  1919. do { \
  1920. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  1921. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  1922. } while (0)
  1923. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  1924. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  1925. HTT_TX_TCL_METADATA_PEER_ID_S)
  1926. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  1927. do { \
  1928. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  1929. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  1930. } while (0)
  1931. typedef enum {
  1932. HTT_TX_FW2WBM_TX_STATUS_OK,
  1933. HTT_TX_FW2WBM_TX_STATUS_DROP,
  1934. HTT_TX_FW2WBM_TX_STATUS_TTL,
  1935. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  1936. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  1937. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  1938. HTT_TX_FW2WBM_TX_STATUS_MAX
  1939. } htt_tx_fw2wbm_tx_status_t;
  1940. typedef enum {
  1941. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  1942. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  1943. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  1944. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  1945. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  1946. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  1947. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  1948. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  1949. } htt_tx_fw2wbm_reinject_reason_t;
  1950. /**
  1951. * @brief HTT TX WBM Completion from firmware to host
  1952. * @details
  1953. * This structure is passed from firmware to host overlayed on wbm_release_ring
  1954. * DWORD 3 and 4 for software based completions (Exception frames and
  1955. * TQM bypass frames)
  1956. * For software based completions, wbm_release_ring->release_source_module will
  1957. * be set to release_source_fw
  1958. */
  1959. PREPACK struct htt_tx_wbm_completion {
  1960. A_UINT32
  1961. sch_cmd_id: 24,
  1962. exception_frame: 1, /* If set, this packet was queued via exception path */
  1963. rsvd0_31_25: 7;
  1964. A_UINT32
  1965. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  1966. * reception of an ACK or BA, this field indicates
  1967. * the RSSI of the received ACK or BA frame.
  1968. * When the frame is removed as result of a direct
  1969. * remove command from the SW, this field is set
  1970. * to 0x0 (which is never a valid value when real
  1971. * RSSI is available).
  1972. * Units: dB w.r.t noise floor
  1973. */
  1974. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  1975. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  1976. rsvd1_31_16: 16;
  1977. } POSTPACK;
  1978. /* DWORD 0 */
  1979. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  1980. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  1981. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  1982. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  1983. /* DWORD 1 */
  1984. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  1985. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  1986. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  1987. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  1988. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  1989. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  1990. /* DWORD 0 */
  1991. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  1992. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  1993. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  1994. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  1995. do { \
  1996. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  1997. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  1998. } while (0)
  1999. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2000. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2001. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2002. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2003. do { \
  2004. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2005. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2006. } while (0)
  2007. /* DWORD 1 */
  2008. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2009. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2010. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2011. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2012. do { \
  2013. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2014. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2015. } while (0)
  2016. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2017. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2018. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2019. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2020. do { \
  2021. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2022. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2023. } while (0)
  2024. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2025. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2026. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2027. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2028. do { \
  2029. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2030. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2031. } while (0)
  2032. /**
  2033. * @brief HTT TX WBM Completion from firmware to host
  2034. * @details
  2035. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2036. * (WBM) offload HW.
  2037. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2038. * For software based completions, release_source_module will
  2039. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2040. * struct wbm_release_ring and then switch to this after looking at
  2041. * release_source_module.
  2042. */
  2043. PREPACK struct htt_tx_wbm_completion_v2 {
  2044. A_UINT32
  2045. used_by_hw0; /* Refer to struct wbm_release_ring */
  2046. A_UINT32
  2047. used_by_hw1; /* Refer to struct wbm_release_ring */
  2048. A_UINT32
  2049. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2050. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2051. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2052. exception_frame: 1,
  2053. rsvd0: 12, /* For future use */
  2054. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2055. rsvd1: 1; /* For future use */
  2056. A_UINT32
  2057. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2058. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2059. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2060. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2061. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2062. */
  2063. A_UINT32
  2064. data1: 32;
  2065. A_UINT32
  2066. data2: 32;
  2067. A_UINT32
  2068. used_by_hw3; /* Refer to struct wbm_release_ring */
  2069. } POSTPACK;
  2070. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2071. /* DWORD 3 */
  2072. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2073. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2074. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2075. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2076. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2077. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2078. /* DWORD 3 */
  2079. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2080. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2081. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2082. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2083. do { \
  2084. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2085. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2086. } while (0)
  2087. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2088. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2089. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2090. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2091. do { \
  2092. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2093. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2094. } while (0)
  2095. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2096. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2097. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2098. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2099. do { \
  2100. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2101. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2102. } while (0)
  2103. /**
  2104. * @brief HTT TX WBM transmit status from firmware to host
  2105. * @details
  2106. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2107. * (WBM) offload HW.
  2108. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2109. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2110. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2111. */
  2112. PREPACK struct htt_tx_wbm_transmit_status {
  2113. A_UINT32
  2114. sch_cmd_id: 24,
  2115. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2116. * reception of an ACK or BA, this field indicates
  2117. * the RSSI of the received ACK or BA frame.
  2118. * When the frame is removed as result of a direct
  2119. * remove command from the SW, this field is set
  2120. * to 0x0 (which is never a valid value when real
  2121. * RSSI is available).
  2122. * Units: dB w.r.t noise floor
  2123. */
  2124. A_UINT32
  2125. sw_peer_id: 16,
  2126. tid_num: 5,
  2127. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2128. * and tid_num fields contain valid data.
  2129. * If this "valid" flag is not set, the
  2130. * sw_peer_id and tid_num fields must be ignored.
  2131. */
  2132. reserved0: 10;
  2133. A_UINT32
  2134. reserved1: 32;
  2135. } POSTPACK;
  2136. /* DWORD 4 */
  2137. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2138. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2139. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2140. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2141. /* DWORD 5 */
  2142. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2143. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2144. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2145. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2146. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2147. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2148. /* DWORD 4 */
  2149. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2150. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2151. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2152. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2153. do { \
  2154. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2155. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2156. } while (0)
  2157. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2158. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2159. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2160. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2161. do { \
  2162. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2163. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2164. } while (0)
  2165. /* DWORD 5 */
  2166. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2167. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2168. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2169. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2170. do { \
  2171. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2172. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2173. } while (0)
  2174. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2175. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2176. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2177. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2178. do { \
  2179. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2180. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2181. } while (0)
  2182. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2183. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2184. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2185. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2186. do { \
  2187. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2188. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2189. } while (0)
  2190. /**
  2191. * @brief HTT TX WBM reinject status from firmware to host
  2192. * @details
  2193. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2194. * (WBM) offload HW.
  2195. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2196. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2197. */
  2198. PREPACK struct htt_tx_wbm_reinject_status {
  2199. A_UINT32
  2200. reserved0: 32;
  2201. A_UINT32
  2202. reserved1: 32;
  2203. A_UINT32
  2204. reserved2: 32;
  2205. } POSTPACK;
  2206. /**
  2207. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2208. * @details
  2209. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2210. * (WBM) offload HW.
  2211. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2212. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2213. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2214. * STA side.
  2215. */
  2216. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2217. A_UINT32
  2218. mec_sa_addr_31_0;
  2219. A_UINT32
  2220. mec_sa_addr_47_32: 16,
  2221. sa_ast_index: 16;
  2222. A_UINT32
  2223. vdev_id: 8,
  2224. reserved0: 24;
  2225. } POSTPACK;
  2226. /* DWORD 4 - mec_sa_addr_31_0 */
  2227. /* DWORD 5 */
  2228. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2229. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2230. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2231. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2232. /* DWORD 6 */
  2233. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2234. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2235. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2236. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2237. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2238. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2239. do { \
  2240. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2241. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2242. } while (0)
  2243. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2244. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2245. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2246. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2247. do { \
  2248. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2249. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2250. } while (0)
  2251. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2252. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2253. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2254. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2255. do { \
  2256. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2257. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2258. } while (0)
  2259. typedef enum {
  2260. TX_FLOW_PRIORITY_BE,
  2261. TX_FLOW_PRIORITY_HIGH,
  2262. TX_FLOW_PRIORITY_LOW,
  2263. } htt_tx_flow_priority_t;
  2264. typedef enum {
  2265. TX_FLOW_LATENCY_SENSITIVE,
  2266. TX_FLOW_LATENCY_INSENSITIVE,
  2267. } htt_tx_flow_latency_t;
  2268. typedef enum {
  2269. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2270. TX_FLOW_INTERACTIVE_TRAFFIC,
  2271. TX_FLOW_PERIODIC_TRAFFIC,
  2272. TX_FLOW_BURSTY_TRAFFIC,
  2273. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2274. } htt_tx_flow_traffic_pattern_t;
  2275. /**
  2276. * @brief HTT TX Flow search metadata format
  2277. * @details
  2278. * Host will set this metadata in flow table's flow search entry along with
  2279. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2280. * firmware and TQM ring if the flow search entry wins.
  2281. * This metadata is available to firmware in that first MSDU's
  2282. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2283. * to one of the available flows for specific tid and returns the tqm flow
  2284. * pointer as part of htt_tx_map_flow_info message.
  2285. */
  2286. PREPACK struct htt_tx_flow_metadata {
  2287. A_UINT32
  2288. rsvd0_1_0: 2,
  2289. tid: 4,
  2290. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2291. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2292. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2293. * Else choose final tid based on latency, priority.
  2294. */
  2295. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2296. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2297. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2298. } POSTPACK;
  2299. /* DWORD 0 */
  2300. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2301. #define HTT_TX_FLOW_METADATA_TID_S 2
  2302. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2303. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2304. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2305. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2306. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2307. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2308. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2309. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2310. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2311. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2312. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2313. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2314. /* DWORD 0 */
  2315. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2316. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2317. HTT_TX_FLOW_METADATA_TID_S)
  2318. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2319. do { \
  2320. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2321. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2322. } while (0)
  2323. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2324. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2325. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2326. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2327. do { \
  2328. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2329. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2330. } while (0)
  2331. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2332. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2333. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2334. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2335. do { \
  2336. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2337. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2338. } while (0)
  2339. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2340. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2341. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2342. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2343. do { \
  2344. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2345. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2346. } while (0)
  2347. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2348. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2349. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2350. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2351. do { \
  2352. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2353. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2354. } while (0)
  2355. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2356. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2357. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2358. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2359. do { \
  2360. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2361. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2362. } while (0)
  2363. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2364. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2365. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2366. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2367. do { \
  2368. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2369. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2370. } while (0)
  2371. /**
  2372. * @brief Used in HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY and HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY messages
  2373. *
  2374. * @details
  2375. * HTT wds entry from source port learning
  2376. * Host will learn wds entries from rx and send this message to firmware
  2377. * to enable firmware to configure/delete AST entries for wds clients.
  2378. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2379. * and when SA's entry is deleted, firmware removes this AST entry
  2380. *
  2381. * The message would appear as follows:
  2382. *
  2383. * |31 30|29 |17 16|15 8|7 0|
  2384. * |----------------+----------------+----------------+----------------|
  2385. * | rsvd0 |PDVID| vdev_id | msg_type |
  2386. * |-------------------------------------------------------------------|
  2387. * | sa_addr_31_0 |
  2388. * |-------------------------------------------------------------------|
  2389. * | | ta_peer_id | sa_addr_47_32 |
  2390. * |-------------------------------------------------------------------|
  2391. * Where PDVID = pdev_id
  2392. *
  2393. * The message is interpreted as follows:
  2394. *
  2395. * dword0 - b'0:7 - msg_type: This will be set to
  2396. * HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY or
  2397. * HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2398. *
  2399. * dword0 - b'8:15 - vdev_id
  2400. *
  2401. * dword0 - b'16:17 - pdev_id
  2402. *
  2403. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2404. *
  2405. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2406. *
  2407. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2408. *
  2409. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2410. */
  2411. PREPACK struct htt_wds_entry {
  2412. A_UINT32
  2413. msg_type: 8,
  2414. vdev_id: 8,
  2415. pdev_id: 2,
  2416. rsvd0: 14;
  2417. A_UINT32 sa_addr_31_0;
  2418. A_UINT32
  2419. sa_addr_47_32: 16,
  2420. ta_peer_id: 14,
  2421. rsvd2: 2;
  2422. } POSTPACK;
  2423. /* DWORD 0 */
  2424. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2425. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2426. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2427. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2428. /* DWORD 2 */
  2429. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2430. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2431. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2432. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2433. /* DWORD 0 */
  2434. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2435. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2436. HTT_WDS_ENTRY_VDEV_ID_S)
  2437. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2438. do { \
  2439. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2440. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2441. } while (0)
  2442. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2443. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2444. HTT_WDS_ENTRY_PDEV_ID_S)
  2445. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2446. do { \
  2447. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2448. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2449. } while (0)
  2450. /* DWORD 2 */
  2451. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2452. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2453. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2454. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2455. do { \
  2456. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2457. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2458. } while (0)
  2459. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2460. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2461. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2462. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2463. do { \
  2464. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2465. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2466. } while (0)
  2467. /**
  2468. * @brief MAC DMA rx ring setup specification
  2469. * @details
  2470. * To allow for dynamic rx ring reconfiguration and to avoid race
  2471. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2472. * it uses. Instead, it sends this message to the target, indicating how
  2473. * the rx ring used by the host should be set up and maintained.
  2474. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2475. * specifications.
  2476. *
  2477. * |31 16|15 8|7 0|
  2478. * |---------------------------------------------------------------|
  2479. * header: | reserved | num rings | msg type |
  2480. * |---------------------------------------------------------------|
  2481. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2482. #if HTT_PADDR64
  2483. * | FW_IDX shadow register physical address (bits 63:32) |
  2484. #endif
  2485. * |---------------------------------------------------------------|
  2486. * | rx ring base physical address (bits 31:0) |
  2487. #if HTT_PADDR64
  2488. * | rx ring base physical address (bits 63:32) |
  2489. #endif
  2490. * |---------------------------------------------------------------|
  2491. * | rx ring buffer size | rx ring length |
  2492. * |---------------------------------------------------------------|
  2493. * | FW_IDX initial value | enabled flags |
  2494. * |---------------------------------------------------------------|
  2495. * | MSDU payload offset | 802.11 header offset |
  2496. * |---------------------------------------------------------------|
  2497. * | PPDU end offset | PPDU start offset |
  2498. * |---------------------------------------------------------------|
  2499. * | MPDU end offset | MPDU start offset |
  2500. * |---------------------------------------------------------------|
  2501. * | MSDU end offset | MSDU start offset |
  2502. * |---------------------------------------------------------------|
  2503. * | frag info offset | rx attention offset |
  2504. * |---------------------------------------------------------------|
  2505. * payload 2, if present, has the same format as payload 1
  2506. * Header fields:
  2507. * - MSG_TYPE
  2508. * Bits 7:0
  2509. * Purpose: identifies this as an rx ring configuration message
  2510. * Value: 0x2
  2511. * - NUM_RINGS
  2512. * Bits 15:8
  2513. * Purpose: indicates whether the host is setting up one rx ring or two
  2514. * Value: 1 or 2
  2515. * Payload:
  2516. * for systems using 64-bit format for bus addresses:
  2517. * - IDX_SHADOW_REG_PADDR_LO
  2518. * Bits 31:0
  2519. * Value: lower 4 bytes of physical address of the host's
  2520. * FW_IDX shadow register
  2521. * - IDX_SHADOW_REG_PADDR_HI
  2522. * Bits 31:0
  2523. * Value: upper 4 bytes of physical address of the host's
  2524. * FW_IDX shadow register
  2525. * - RING_BASE_PADDR_LO
  2526. * Bits 31:0
  2527. * Value: lower 4 bytes of physical address of the host's rx ring
  2528. * - RING_BASE_PADDR_HI
  2529. * Bits 31:0
  2530. * Value: uppper 4 bytes of physical address of the host's rx ring
  2531. * for systems using 32-bit format for bus addresses:
  2532. * - IDX_SHADOW_REG_PADDR
  2533. * Bits 31:0
  2534. * Value: physical address of the host's FW_IDX shadow register
  2535. * - RING_BASE_PADDR
  2536. * Bits 31:0
  2537. * Value: physical address of the host's rx ring
  2538. * - RING_LEN
  2539. * Bits 15:0
  2540. * Value: number of elements in the rx ring
  2541. * - RING_BUF_SZ
  2542. * Bits 31:16
  2543. * Value: size of the buffers referenced by the rx ring, in byte units
  2544. * - ENABLED_FLAGS
  2545. * Bits 15:0
  2546. * Value: 1-bit flags to show whether different rx fields are enabled
  2547. * bit 0: 802.11 header enabled (1) or disabled (0)
  2548. * bit 1: MSDU payload enabled (1) or disabled (0)
  2549. * bit 2: PPDU start enabled (1) or disabled (0)
  2550. * bit 3: PPDU end enabled (1) or disabled (0)
  2551. * bit 4: MPDU start enabled (1) or disabled (0)
  2552. * bit 5: MPDU end enabled (1) or disabled (0)
  2553. * bit 6: MSDU start enabled (1) or disabled (0)
  2554. * bit 7: MSDU end enabled (1) or disabled (0)
  2555. * bit 8: rx attention enabled (1) or disabled (0)
  2556. * bit 9: frag info enabled (1) or disabled (0)
  2557. * bit 10: unicast rx enabled (1) or disabled (0)
  2558. * bit 11: multicast rx enabled (1) or disabled (0)
  2559. * bit 12: ctrl rx enabled (1) or disabled (0)
  2560. * bit 13: mgmt rx enabled (1) or disabled (0)
  2561. * bit 14: null rx enabled (1) or disabled (0)
  2562. * bit 15: phy data rx enabled (1) or disabled (0)
  2563. * - IDX_INIT_VAL
  2564. * Bits 31:16
  2565. * Purpose: Specify the initial value for the FW_IDX.
  2566. * Value: the number of buffers initially present in the host's rx ring
  2567. * - OFFSET_802_11_HDR
  2568. * Bits 15:0
  2569. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2570. * - OFFSET_MSDU_PAYLOAD
  2571. * Bits 31:16
  2572. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2573. * - OFFSET_PPDU_START
  2574. * Bits 15:0
  2575. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2576. * - OFFSET_PPDU_END
  2577. * Bits 31:16
  2578. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2579. * - OFFSET_MPDU_START
  2580. * Bits 15:0
  2581. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2582. * - OFFSET_MPDU_END
  2583. * Bits 31:16
  2584. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2585. * - OFFSET_MSDU_START
  2586. * Bits 15:0
  2587. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2588. * - OFFSET_MSDU_END
  2589. * Bits 31:16
  2590. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2591. * - OFFSET_RX_ATTN
  2592. * Bits 15:0
  2593. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2594. * - OFFSET_FRAG_INFO
  2595. * Bits 31:16
  2596. * Value: offset in QUAD-bytes of frag info table
  2597. */
  2598. /* header fields */
  2599. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2600. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2601. /* payload fields */
  2602. /* for systems using a 64-bit format for bus addresses */
  2603. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2604. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2605. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2606. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2607. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2608. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2609. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2610. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2611. /* for systems using a 32-bit format for bus addresses */
  2612. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2613. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2614. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2615. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2616. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2617. #define HTT_RX_RING_CFG_LEN_S 0
  2618. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2619. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2620. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2621. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2622. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2623. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2624. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2625. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2626. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2627. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2628. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2629. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2630. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2631. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2632. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2633. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2634. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2635. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2636. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2637. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2638. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2639. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2640. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2641. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2642. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2643. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2644. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2645. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2646. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2647. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2648. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2649. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2650. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2651. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2652. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2653. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2654. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2655. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2656. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2657. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2658. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2659. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2660. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2661. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2662. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2663. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2664. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2665. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2666. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2667. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2668. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2669. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2670. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2671. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2672. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2673. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2674. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2675. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2676. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2677. #if HTT_PADDR64
  2678. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2679. #else
  2680. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2681. #endif
  2682. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2683. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2684. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2685. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2686. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2687. do { \
  2688. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2689. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2690. } while (0)
  2691. /* degenerate case for 32-bit fields */
  2692. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  2693. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  2694. ((_var) = (_val))
  2695. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  2696. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  2697. ((_var) = (_val))
  2698. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  2699. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  2700. ((_var) = (_val))
  2701. /* degenerate case for 32-bit fields */
  2702. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  2703. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  2704. ((_var) = (_val))
  2705. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  2706. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  2707. ((_var) = (_val))
  2708. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  2709. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  2710. ((_var) = (_val))
  2711. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  2712. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  2713. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  2714. do { \
  2715. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  2716. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  2717. } while (0)
  2718. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  2719. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  2720. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  2721. do { \
  2722. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  2723. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  2724. } while (0)
  2725. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  2726. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  2727. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  2728. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  2729. do { \
  2730. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  2731. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  2732. } while (0)
  2733. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  2734. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  2735. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  2736. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  2737. do { \
  2738. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  2739. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  2740. } while (0)
  2741. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  2742. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  2743. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  2744. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  2745. do { \
  2746. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  2747. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  2748. } while (0)
  2749. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  2750. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  2751. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  2752. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  2753. do { \
  2754. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  2755. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  2756. } while (0)
  2757. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  2758. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  2759. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  2760. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  2761. do { \
  2762. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  2763. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  2764. } while (0)
  2765. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  2766. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  2767. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  2768. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  2769. do { \
  2770. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  2771. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  2772. } while (0)
  2773. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  2774. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  2775. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  2776. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  2777. do { \
  2778. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  2779. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  2780. } while (0)
  2781. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  2782. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  2783. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  2784. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  2785. do { \
  2786. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  2787. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  2788. } while (0)
  2789. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  2790. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  2791. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  2792. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  2793. do { \
  2794. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  2795. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  2796. } while (0)
  2797. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  2798. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  2799. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  2800. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  2801. do { \
  2802. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  2803. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  2804. } while (0)
  2805. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  2806. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  2807. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  2808. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  2809. do { \
  2810. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  2811. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  2812. } while (0)
  2813. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  2814. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  2815. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  2816. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  2817. do { \
  2818. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  2819. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  2820. } while (0)
  2821. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  2822. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  2823. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  2824. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  2825. do { \
  2826. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  2827. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  2828. } while (0)
  2829. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  2830. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  2831. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  2832. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  2833. do { \
  2834. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  2835. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  2836. } while (0)
  2837. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  2838. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  2839. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  2840. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  2841. do { \
  2842. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  2843. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  2844. } while (0)
  2845. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  2846. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  2847. HTT_RX_RING_CFG_ENABLED_NULL_S)
  2848. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  2849. do { \
  2850. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  2851. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  2852. } while (0)
  2853. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  2854. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  2855. HTT_RX_RING_CFG_ENABLED_PHY_S)
  2856. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  2857. do { \
  2858. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  2859. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  2860. } while (0)
  2861. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  2862. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  2863. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  2864. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  2865. do { \
  2866. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  2867. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  2868. } while (0)
  2869. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  2870. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  2871. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  2872. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  2873. do { \
  2874. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  2875. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  2876. } while (0)
  2877. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  2878. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  2879. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  2880. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  2881. do { \
  2882. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  2883. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  2884. } while (0)
  2885. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  2886. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  2887. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  2888. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  2889. do { \
  2890. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  2891. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  2892. } while (0)
  2893. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  2894. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  2895. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  2896. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  2897. do { \
  2898. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  2899. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  2900. } while (0)
  2901. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  2902. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  2903. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  2904. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  2905. do { \
  2906. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  2907. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  2908. } while (0)
  2909. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  2910. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  2911. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  2912. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  2913. do { \
  2914. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  2915. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  2916. } while (0)
  2917. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  2918. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  2919. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  2920. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  2921. do { \
  2922. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  2923. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  2924. } while (0)
  2925. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  2926. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  2927. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  2928. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  2929. do { \
  2930. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  2931. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  2932. } while (0)
  2933. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  2934. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  2935. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  2936. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  2937. do { \
  2938. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  2939. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  2940. } while (0)
  2941. /**
  2942. * @brief host -> target FW statistics retrieve
  2943. *
  2944. * @details
  2945. * The following field definitions describe the format of the HTT host
  2946. * to target FW stats retrieve message. The message specifies the type of
  2947. * stats host wants to retrieve.
  2948. *
  2949. * |31 24|23 16|15 8|7 0|
  2950. * |-----------------------------------------------------------|
  2951. * | stats types request bitmask | msg type |
  2952. * |-----------------------------------------------------------|
  2953. * | stats types reset bitmask | reserved |
  2954. * |-----------------------------------------------------------|
  2955. * | stats type | config value |
  2956. * |-----------------------------------------------------------|
  2957. * | cookie LSBs |
  2958. * |-----------------------------------------------------------|
  2959. * | cookie MSBs |
  2960. * |-----------------------------------------------------------|
  2961. * Header fields:
  2962. * - MSG_TYPE
  2963. * Bits 7:0
  2964. * Purpose: identifies this is a stats upload request message
  2965. * Value: 0x3
  2966. * - UPLOAD_TYPES
  2967. * Bits 31:8
  2968. * Purpose: identifies which types of FW statistics to upload
  2969. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  2970. * - RESET_TYPES
  2971. * Bits 31:8
  2972. * Purpose: identifies which types of FW statistics to reset
  2973. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  2974. * - CFG_VAL
  2975. * Bits 23:0
  2976. * Purpose: give an opaque configuration value to the specified stats type
  2977. * Value: stats-type specific configuration value
  2978. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  2979. * bits 7:0 - how many per-MPDU byte counts to include in a record
  2980. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  2981. * bits 23:16 - how many per-MSDU byte counts to include in a record
  2982. * - CFG_STAT_TYPE
  2983. * Bits 31:24
  2984. * Purpose: specify which stats type (if any) the config value applies to
  2985. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  2986. * a valid configuration specification
  2987. * - COOKIE_LSBS
  2988. * Bits 31:0
  2989. * Purpose: Provide a mechanism to match a target->host stats confirmation
  2990. * message with its preceding host->target stats request message.
  2991. * Value: LSBs of the opaque cookie specified by the host-side requestor
  2992. * - COOKIE_MSBS
  2993. * Bits 31:0
  2994. * Purpose: Provide a mechanism to match a target->host stats confirmation
  2995. * message with its preceding host->target stats request message.
  2996. * Value: MSBs of the opaque cookie specified by the host-side requestor
  2997. */
  2998. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  2999. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3000. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3001. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3002. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3003. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3004. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3005. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3006. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3007. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3008. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3009. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3010. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3011. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3012. do { \
  3013. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3014. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3015. } while (0)
  3016. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3017. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3018. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3019. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3020. do { \
  3021. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3022. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3023. } while (0)
  3024. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3025. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3026. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3027. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3028. do { \
  3029. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3030. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3031. } while (0)
  3032. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3033. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3034. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3035. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3036. do { \
  3037. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3038. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3039. } while (0)
  3040. /**
  3041. * @brief host -> target HTT out-of-band sync request
  3042. *
  3043. * @details
  3044. * The HTT SYNC tells the target to suspend processing of subsequent
  3045. * HTT host-to-target messages until some other target agent locally
  3046. * informs the target HTT FW that the current sync counter is equal to
  3047. * or greater than (in a modulo sense) the sync counter specified in
  3048. * the SYNC message.
  3049. * This allows other host-target components to synchronize their operation
  3050. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3051. * security key has been downloaded to and activated by the target.
  3052. * In the absence of any explicit synchronization counter value
  3053. * specification, the target HTT FW will use zero as the default current
  3054. * sync value.
  3055. *
  3056. * |31 24|23 16|15 8|7 0|
  3057. * |-----------------------------------------------------------|
  3058. * | reserved | sync count | msg type |
  3059. * |-----------------------------------------------------------|
  3060. * Header fields:
  3061. * - MSG_TYPE
  3062. * Bits 7:0
  3063. * Purpose: identifies this as a sync message
  3064. * Value: 0x4
  3065. * - SYNC_COUNT
  3066. * Bits 15:8
  3067. * Purpose: specifies what sync value the HTT FW will wait for from
  3068. * an out-of-band specification to resume its operation
  3069. * Value: in-band sync counter value to compare against the out-of-band
  3070. * counter spec.
  3071. * The HTT target FW will suspend its host->target message processing
  3072. * as long as
  3073. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3074. */
  3075. #define HTT_H2T_SYNC_MSG_SZ 4
  3076. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3077. #define HTT_H2T_SYNC_COUNT_S 8
  3078. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3079. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3080. HTT_H2T_SYNC_COUNT_S)
  3081. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3082. do { \
  3083. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3084. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3085. } while (0)
  3086. /**
  3087. * @brief HTT aggregation configuration
  3088. */
  3089. #define HTT_AGGR_CFG_MSG_SZ 4
  3090. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3091. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3092. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3093. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3094. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3095. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3096. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3097. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3098. do { \
  3099. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3100. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3101. } while (0)
  3102. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3103. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3104. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3105. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3106. do { \
  3107. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3108. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3109. } while (0)
  3110. /**
  3111. * @brief host -> target HTT configure max amsdu info per vdev
  3112. *
  3113. * @details
  3114. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3115. *
  3116. * |31 21|20 16|15 8|7 0|
  3117. * |-----------------------------------------------------------|
  3118. * | reserved | vdev id | max amsdu | msg type |
  3119. * |-----------------------------------------------------------|
  3120. * Header fields:
  3121. * - MSG_TYPE
  3122. * Bits 7:0
  3123. * Purpose: identifies this as a aggr cfg ex message
  3124. * Value: 0xa
  3125. * - MAX_NUM_AMSDU_SUBFRM
  3126. * Bits 15:8
  3127. * Purpose: max MSDUs per A-MSDU
  3128. * - VDEV_ID
  3129. * Bits 20:16
  3130. * Purpose: ID of the vdev to which this limit is applied
  3131. */
  3132. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3133. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3134. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3135. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3136. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3137. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3138. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3139. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3140. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3141. do { \
  3142. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3143. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3144. } while (0)
  3145. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3146. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3147. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3148. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3149. do { \
  3150. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3151. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3152. } while (0)
  3153. /**
  3154. * @brief HTT WDI_IPA Config Message
  3155. *
  3156. * @details
  3157. * The HTT WDI_IPA config message is created/sent by host at driver
  3158. * init time. It contains information about data structures used on
  3159. * WDI_IPA TX and RX path.
  3160. * TX CE ring is used for pushing packet metadata from IPA uC
  3161. * to WLAN FW
  3162. * TX Completion ring is used for generating TX completions from
  3163. * WLAN FW to IPA uC
  3164. * RX Indication ring is used for indicating RX packets from FW
  3165. * to IPA uC
  3166. * RX Ring2 is used as either completion ring or as second
  3167. * indication ring. when Ring2 is used as completion ring, IPA uC
  3168. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3169. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3170. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3171. * indicated in RX Indication ring. Please see WDI_IPA specification
  3172. * for more details.
  3173. * |31 24|23 16|15 8|7 0|
  3174. * |----------------+----------------+----------------+----------------|
  3175. * | tx pkt pool size | Rsvd | msg_type |
  3176. * |-------------------------------------------------------------------|
  3177. * | tx comp ring base (bits 31:0) |
  3178. #if HTT_PADDR64
  3179. * | tx comp ring base (bits 63:32) |
  3180. #endif
  3181. * |-------------------------------------------------------------------|
  3182. * | tx comp ring size |
  3183. * |-------------------------------------------------------------------|
  3184. * | tx comp WR_IDX physical address (bits 31:0) |
  3185. #if HTT_PADDR64
  3186. * | tx comp WR_IDX physical address (bits 63:32) |
  3187. #endif
  3188. * |-------------------------------------------------------------------|
  3189. * | tx CE WR_IDX physical address (bits 31:0) |
  3190. #if HTT_PADDR64
  3191. * | tx CE WR_IDX physical address (bits 63:32) |
  3192. #endif
  3193. * |-------------------------------------------------------------------|
  3194. * | rx indication ring base (bits 31:0) |
  3195. #if HTT_PADDR64
  3196. * | rx indication ring base (bits 63:32) |
  3197. #endif
  3198. * |-------------------------------------------------------------------|
  3199. * | rx indication ring size |
  3200. * |-------------------------------------------------------------------|
  3201. * | rx ind RD_IDX physical address (bits 31:0) |
  3202. #if HTT_PADDR64
  3203. * | rx ind RD_IDX physical address (bits 63:32) |
  3204. #endif
  3205. * |-------------------------------------------------------------------|
  3206. * | rx ind WR_IDX physical address (bits 31:0) |
  3207. #if HTT_PADDR64
  3208. * | rx ind WR_IDX physical address (bits 63:32) |
  3209. #endif
  3210. * |-------------------------------------------------------------------|
  3211. * |-------------------------------------------------------------------|
  3212. * | rx ring2 base (bits 31:0) |
  3213. #if HTT_PADDR64
  3214. * | rx ring2 base (bits 63:32) |
  3215. #endif
  3216. * |-------------------------------------------------------------------|
  3217. * | rx ring2 size |
  3218. * |-------------------------------------------------------------------|
  3219. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3220. #if HTT_PADDR64
  3221. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3222. #endif
  3223. * |-------------------------------------------------------------------|
  3224. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3225. #if HTT_PADDR64
  3226. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3227. #endif
  3228. * |-------------------------------------------------------------------|
  3229. *
  3230. * Header fields:
  3231. * Header fields:
  3232. * - MSG_TYPE
  3233. * Bits 7:0
  3234. * Purpose: Identifies this as WDI_IPA config message
  3235. * value: = 0x8
  3236. * - TX_PKT_POOL_SIZE
  3237. * Bits 15:0
  3238. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3239. * WDI_IPA TX path
  3240. * For systems using 32-bit format for bus addresses:
  3241. * - TX_COMP_RING_BASE_ADDR
  3242. * Bits 31:0
  3243. * Purpose: TX Completion Ring base address in DDR
  3244. * - TX_COMP_RING_SIZE
  3245. * Bits 31:0
  3246. * Purpose: TX Completion Ring size (must be power of 2)
  3247. * - TX_COMP_WR_IDX_ADDR
  3248. * Bits 31:0
  3249. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3250. * updates the Write Index for WDI_IPA TX completion ring
  3251. * - TX_CE_WR_IDX_ADDR
  3252. * Bits 31:0
  3253. * Purpose: 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
  3257. * Bits 31:0
  3258. * Purpose: RX Indication Ring base address in DDR
  3259. * - RX_IND_RING_SIZE
  3260. * Bits 31:0
  3261. * Purpose: RX Indication Ring size
  3262. * - RX_IND_RD_IDX_ADDR
  3263. * Bits 31:0
  3264. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3265. * RX indication ring
  3266. * - RX_IND_WR_IDX_ADDR
  3267. * Bits 31:0
  3268. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3269. * updates the Write Index for WDI_IPA RX indication ring
  3270. * - RX_RING2_BASE_ADDR
  3271. * Bits 31:0
  3272. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3273. * - RX_RING2_SIZE
  3274. * Bits 31:0
  3275. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3276. * - RX_RING2_RD_IDX_ADDR
  3277. * Bits 31:0
  3278. * Purpose: If Second RX ring is Indication ring, DDR address where
  3279. * IPA uC updates the Read Index for Ring2.
  3280. * If Second RX ring is completion ring, this is NOT used
  3281. * - RX_RING2_WR_IDX_ADDR
  3282. * Bits 31:0
  3283. * Purpose: If Second RX ring is Indication ring, DDR address where
  3284. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3285. * If second RX ring is completion ring, DDR address where
  3286. * IPA uC updates the Write Index for Ring 2.
  3287. * For systems using 64-bit format for bus addresses:
  3288. * - TX_COMP_RING_BASE_ADDR_LO
  3289. * Bits 31:0
  3290. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3291. * - TX_COMP_RING_BASE_ADDR_HI
  3292. * Bits 31:0
  3293. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3294. * - TX_COMP_RING_SIZE
  3295. * Bits 31:0
  3296. * Purpose: TX Completion Ring size (must be power of 2)
  3297. * - TX_COMP_WR_IDX_ADDR_LO
  3298. * Bits 31:0
  3299. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3300. * Lower 4 bytes of DDR address where WIFI FW
  3301. * updates the Write Index for WDI_IPA TX completion ring
  3302. * - TX_COMP_WR_IDX_ADDR_HI
  3303. * Bits 31:0
  3304. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3305. * Higher 4 bytes of DDR address where WIFI FW
  3306. * updates the Write Index for WDI_IPA TX completion ring
  3307. * - TX_CE_WR_IDX_ADDR_LO
  3308. * Bits 31:0
  3309. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3310. * updates the WR Index for TX CE ring
  3311. * (needed for fusion platforms)
  3312. * - TX_CE_WR_IDX_ADDR_HI
  3313. * Bits 31:0
  3314. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3315. * updates the WR Index for TX CE ring
  3316. * (needed for fusion platforms)
  3317. * - RX_IND_RING_BASE_ADDR_LO
  3318. * Bits 31:0
  3319. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3320. * - RX_IND_RING_BASE_ADDR_HI
  3321. * Bits 31:0
  3322. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3323. * - RX_IND_RING_SIZE
  3324. * Bits 31:0
  3325. * Purpose: RX Indication Ring size
  3326. * - RX_IND_RD_IDX_ADDR_LO
  3327. * Bits 31:0
  3328. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3329. * for WDI_IPA RX indication ring
  3330. * - RX_IND_RD_IDX_ADDR_HI
  3331. * Bits 31:0
  3332. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3333. * for WDI_IPA RX indication ring
  3334. * - RX_IND_WR_IDX_ADDR_LO
  3335. * Bits 31:0
  3336. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3337. * Lower 4 bytes of DDR address where WIFI FW
  3338. * updates the Write Index for WDI_IPA RX indication ring
  3339. * - RX_IND_WR_IDX_ADDR_HI
  3340. * Bits 31:0
  3341. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3342. * Higher 4 bytes of DDR address where WIFI FW
  3343. * updates the Write Index for WDI_IPA RX indication ring
  3344. * - RX_RING2_BASE_ADDR_LO
  3345. * Bits 31:0
  3346. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3347. * - RX_RING2_BASE_ADDR_HI
  3348. * Bits 31:0
  3349. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3350. * - RX_RING2_SIZE
  3351. * Bits 31:0
  3352. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3353. * - RX_RING2_RD_IDX_ADDR_LO
  3354. * Bits 31:0
  3355. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3356. * DDR address where IPA uC updates the Read Index for Ring2.
  3357. * If Second RX ring is completion ring, this is NOT used
  3358. * - RX_RING2_RD_IDX_ADDR_HI
  3359. * Bits 31:0
  3360. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3361. * DDR address where IPA uC updates the Read Index for Ring2.
  3362. * If Second RX ring is completion ring, this is NOT used
  3363. * - RX_RING2_WR_IDX_ADDR_LO
  3364. * Bits 31:0
  3365. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3366. * DDR address where WIFI FW updates the Write Index
  3367. * for WDI_IPA RX ring2
  3368. * If second RX ring is completion ring, lower 4 bytes of
  3369. * DDR address where IPA uC updates the Write Index for Ring 2.
  3370. * - RX_RING2_WR_IDX_ADDR_HI
  3371. * Bits 31:0
  3372. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3373. * DDR address where WIFI FW updates the Write Index
  3374. * for WDI_IPA RX ring2
  3375. * If second RX ring is completion ring, higher 4 bytes of
  3376. * DDR address where IPA uC updates the Write Index for Ring 2.
  3377. */
  3378. #if HTT_PADDR64
  3379. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3380. #else
  3381. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3382. #endif
  3383. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3384. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3385. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3386. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3387. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3388. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3389. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3390. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3391. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3392. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3393. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3394. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3395. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3396. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3397. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3398. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3399. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3400. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3401. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3402. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3403. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3404. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3405. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3406. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3407. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3408. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3409. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3410. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3411. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3412. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3413. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3414. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3415. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3416. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3417. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3418. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3419. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3420. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3421. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3422. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3423. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3424. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3425. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3426. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3427. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3428. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3429. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3430. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3431. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3432. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3433. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3434. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3435. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3436. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3437. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3438. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3439. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3440. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3441. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3442. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3443. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3444. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3445. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3446. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3447. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3448. do { \
  3449. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3450. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3451. } while (0)
  3452. /* for systems using 32-bit format for bus addr */
  3453. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3454. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3455. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3456. do { \
  3457. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3458. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3459. } while (0)
  3460. /* for systems using 64-bit format for bus addr */
  3461. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3462. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3463. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3464. do { \
  3465. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3466. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3467. } while (0)
  3468. /* for systems using 64-bit format for bus addr */
  3469. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3470. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3471. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3472. do { \
  3473. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3474. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3475. } while (0)
  3476. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3477. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3478. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3479. do { \
  3480. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3481. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3482. } while (0)
  3483. /* for systems using 32-bit format for bus addr */
  3484. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3485. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3486. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3487. do { \
  3488. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3489. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3490. } while (0)
  3491. /* for systems using 64-bit format for bus addr */
  3492. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3493. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3494. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3495. do { \
  3496. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3497. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3498. } while (0)
  3499. /* for systems using 64-bit format for bus addr */
  3500. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3501. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3502. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3503. do { \
  3504. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3505. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3506. } while (0)
  3507. /* for systems using 32-bit format for bus addr */
  3508. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3509. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3510. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3511. do { \
  3512. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3513. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3514. } while (0)
  3515. /* for systems using 64-bit format for bus addr */
  3516. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3517. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3518. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3519. do { \
  3520. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3521. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3522. } while (0)
  3523. /* for systems using 64-bit format for bus addr */
  3524. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3525. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3526. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3527. do { \
  3528. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3529. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3530. } while (0)
  3531. /* for systems using 32-bit format for bus addr */
  3532. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3533. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3534. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3535. do { \
  3536. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3537. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3538. } while (0)
  3539. /* for systems using 64-bit format for bus addr */
  3540. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3541. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3542. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3543. do { \
  3544. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3545. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3546. } while (0)
  3547. /* for systems using 64-bit format for bus addr */
  3548. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3549. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3550. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3551. do { \
  3552. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3553. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3554. } while (0)
  3555. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3556. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3557. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3558. do { \
  3559. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3560. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3561. } while (0)
  3562. /* for systems using 32-bit format for bus addr */
  3563. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3564. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3565. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3566. do { \
  3567. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3568. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3569. } while (0)
  3570. /* for systems using 64-bit format for bus addr */
  3571. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3572. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3573. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3574. do { \
  3575. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3576. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3577. } while (0)
  3578. /* for systems using 64-bit format for bus addr */
  3579. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3580. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3581. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3582. do { \
  3583. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3584. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3585. } while (0)
  3586. /* for systems using 32-bit format for bus addr */
  3587. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3588. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3589. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3590. do { \
  3591. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3592. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3593. } while (0)
  3594. /* for systems using 64-bit format for bus addr */
  3595. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3596. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3597. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3598. do { \
  3599. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3600. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3601. } while (0)
  3602. /* for systems using 64-bit format for bus addr */
  3603. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3604. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3605. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3606. do { \
  3607. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3608. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3609. } while (0)
  3610. /* for systems using 32-bit format for bus addr */
  3611. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3612. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3613. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3614. do { \
  3615. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3616. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3617. } while (0)
  3618. /* for systems using 64-bit format for bus addr */
  3619. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3620. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3621. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3622. do { \
  3623. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3624. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3625. } while (0)
  3626. /* for systems using 64-bit format for bus addr */
  3627. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3628. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3629. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3630. do { \
  3631. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3632. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3633. } while (0)
  3634. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3635. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3636. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3637. do { \
  3638. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3639. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3640. } while (0)
  3641. /* for systems using 32-bit format for bus addr */
  3642. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3643. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3644. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3645. do { \
  3646. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3647. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3648. } while (0)
  3649. /* for systems using 64-bit format for bus addr */
  3650. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3651. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3652. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3653. do { \
  3654. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3655. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3656. } while (0)
  3657. /* for systems using 64-bit format for bus addr */
  3658. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3659. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3660. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3661. do { \
  3662. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3663. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3664. } while (0)
  3665. /* for systems using 32-bit format for bus addr */
  3666. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3667. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3668. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3669. do { \
  3670. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3671. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3672. } while (0)
  3673. /* for systems using 64-bit format for bus addr */
  3674. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3675. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3676. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3677. do { \
  3678. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3679. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3680. } while (0)
  3681. /* for systems using 64-bit format for bus addr */
  3682. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  3683. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  3684. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  3685. do { \
  3686. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  3687. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  3688. } while (0)
  3689. /*
  3690. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  3691. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  3692. * addresses are stored in a XXX-bit field.
  3693. * This macro is used to define both htt_wdi_ipa_config32_t and
  3694. * htt_wdi_ipa_config64_t structs.
  3695. */
  3696. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  3697. _paddr__tx_comp_ring_base_addr_, \
  3698. _paddr__tx_comp_wr_idx_addr_, \
  3699. _paddr__tx_ce_wr_idx_addr_, \
  3700. _paddr__rx_ind_ring_base_addr_, \
  3701. _paddr__rx_ind_rd_idx_addr_, \
  3702. _paddr__rx_ind_wr_idx_addr_, \
  3703. _paddr__rx_ring2_base_addr_,\
  3704. _paddr__rx_ring2_rd_idx_addr_,\
  3705. _paddr__rx_ring2_wr_idx_addr_) \
  3706. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  3707. { \
  3708. /* DWORD 0: flags and meta-data */ \
  3709. A_UINT32 \
  3710. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  3711. reserved: 8, \
  3712. tx_pkt_pool_size: 16;\
  3713. /* DWORD 1 */\
  3714. _paddr__tx_comp_ring_base_addr_;\
  3715. /* DWORD 2 (or 3)*/\
  3716. A_UINT32 tx_comp_ring_size;\
  3717. /* DWORD 3 (or 4)*/\
  3718. _paddr__tx_comp_wr_idx_addr_;\
  3719. /* DWORD 4 (or 6)*/\
  3720. _paddr__tx_ce_wr_idx_addr_;\
  3721. /* DWORD 5 (or 8)*/\
  3722. _paddr__rx_ind_ring_base_addr_;\
  3723. /* DWORD 6 (or 10)*/\
  3724. A_UINT32 rx_ind_ring_size;\
  3725. /* DWORD 7 (or 11)*/\
  3726. _paddr__rx_ind_rd_idx_addr_;\
  3727. /* DWORD 8 (or 13)*/\
  3728. _paddr__rx_ind_wr_idx_addr_;\
  3729. /* DWORD 9 (or 15)*/\
  3730. _paddr__rx_ring2_base_addr_;\
  3731. /* DWORD 10 (or 17) */\
  3732. A_UINT32 rx_ring2_size;\
  3733. /* DWORD 11 (or 18) */\
  3734. _paddr__rx_ring2_rd_idx_addr_;\
  3735. /* DWORD 12 (or 20) */\
  3736. _paddr__rx_ring2_wr_idx_addr_;\
  3737. } POSTPACK
  3738. /* define a htt_wdi_ipa_config32_t type */
  3739. 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));
  3740. /* define a htt_wdi_ipa_config64_t type */
  3741. 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));
  3742. #if HTT_PADDR64
  3743. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  3744. #else
  3745. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  3746. #endif
  3747. enum htt_wdi_ipa_op_code {
  3748. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  3749. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  3750. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  3751. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  3752. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  3753. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  3754. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  3755. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  3756. /* keep this last */
  3757. HTT_WDI_IPA_OPCODE_MAX
  3758. };
  3759. /**
  3760. * @brief HTT WDI_IPA Operation Request Message
  3761. *
  3762. * @details
  3763. * HTT WDI_IPA Operation Request message is sent by host
  3764. * to either suspend or resume WDI_IPA TX or RX path.
  3765. * |31 24|23 16|15 8|7 0|
  3766. * |----------------+----------------+----------------+----------------|
  3767. * | op_code | Rsvd | msg_type |
  3768. * |-------------------------------------------------------------------|
  3769. *
  3770. * Header fields:
  3771. * - MSG_TYPE
  3772. * Bits 7:0
  3773. * Purpose: Identifies this as WDI_IPA Operation Request message
  3774. * value: = 0x9
  3775. * - OP_CODE
  3776. * Bits 31:16
  3777. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  3778. * value: = enum htt_wdi_ipa_op_code
  3779. */
  3780. PREPACK struct htt_wdi_ipa_op_request_t
  3781. {
  3782. /* DWORD 0: flags and meta-data */
  3783. A_UINT32
  3784. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  3785. reserved: 8,
  3786. op_code: 16;
  3787. } POSTPACK;
  3788. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  3789. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  3790. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  3791. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  3792. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  3793. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  3794. do { \
  3795. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  3796. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  3797. } while (0)
  3798. /*
  3799. * @brief host -> target HTT_SRING_SETUP message
  3800. *
  3801. * @details
  3802. * After target is booted up, Host can send SRING setup message for
  3803. * each host facing LMAC SRING. Target setups up HW registers based
  3804. * on setup message and confirms back to Host if response_required is set.
  3805. * Host should wait for confirmation message before sending new SRING
  3806. * setup message
  3807. *
  3808. * The message would appear as follows:
  3809. * |31 24|23 20|19|18 16|15|14 8|7 0|
  3810. * |--------------- +-----------------+----------------+------------------|
  3811. * | ring_type | ring_id | pdev_id | msg_type |
  3812. * |----------------------------------------------------------------------|
  3813. * | ring_base_addr_lo |
  3814. * |----------------------------------------------------------------------|
  3815. * | ring_base_addr_hi |
  3816. * |----------------------------------------------------------------------|
  3817. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  3818. * |----------------------------------------------------------------------|
  3819. * | ring_head_offset32_remote_addr_lo |
  3820. * |----------------------------------------------------------------------|
  3821. * | ring_head_offset32_remote_addr_hi |
  3822. * |----------------------------------------------------------------------|
  3823. * | ring_tail_offset32_remote_addr_lo |
  3824. * |----------------------------------------------------------------------|
  3825. * | ring_tail_offset32_remote_addr_hi |
  3826. * |----------------------------------------------------------------------|
  3827. * | ring_msi_addr_lo |
  3828. * |----------------------------------------------------------------------|
  3829. * | ring_msi_addr_hi |
  3830. * |----------------------------------------------------------------------|
  3831. * | ring_msi_data |
  3832. * |----------------------------------------------------------------------|
  3833. * | intr_timer_th |IM| intr_batch_counter_th |
  3834. * |----------------------------------------------------------------------|
  3835. * | reserved |RR|PTCF| intr_low_threshold |
  3836. * |----------------------------------------------------------------------|
  3837. * Where
  3838. * IM = sw_intr_mode
  3839. * RR = response_required
  3840. * PTCF = prefetch_timer_cfg
  3841. *
  3842. * The message is interpreted as follows:
  3843. * dword0 - b'0:7 - msg_type: This will be set to
  3844. * HTT_H2T_MSG_TYPE_SRING_SETUP
  3845. * b'8:15 - pdev_id:
  3846. * 0 (for rings at SOC/UMAC level),
  3847. * 1/2/3 mac id (for rings at LMAC level)
  3848. * b'16:23 - ring_id: identify which ring is to setup,
  3849. * more details can be got from enum htt_srng_ring_id
  3850. * b'24:31 - ring_type: identify type of host rings,
  3851. * more details can be got from enum htt_srng_ring_type
  3852. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  3853. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  3854. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  3855. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  3856. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  3857. * SW_TO_HW_RING.
  3858. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  3859. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  3860. * Lower 32 bits of memory address of the remote variable
  3861. * storing the 4-byte word offset that identifies the head
  3862. * element within the ring.
  3863. * (The head offset variable has type A_UINT32.)
  3864. * Valid for HW_TO_SW and SW_TO_SW rings.
  3865. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  3866. * Upper 32 bits of memory address of the remote variable
  3867. * storing the 4-byte word offset that identifies the head
  3868. * element within the ring.
  3869. * (The head offset variable has type A_UINT32.)
  3870. * Valid for HW_TO_SW and SW_TO_SW rings.
  3871. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  3872. * Lower 32 bits of memory address of the remote variable
  3873. * storing the 4-byte word offset that identifies the tail
  3874. * element within the ring.
  3875. * (The tail offset variable has type A_UINT32.)
  3876. * Valid for HW_TO_SW and SW_TO_SW rings.
  3877. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  3878. * Upper 32 bits of memory address of the remote variable
  3879. * storing the 4-byte word offset that identifies the tail
  3880. * element within the ring.
  3881. * (The tail offset variable has type A_UINT32.)
  3882. * Valid for HW_TO_SW and SW_TO_SW rings.
  3883. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  3884. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3885. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  3886. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3887. * dword10 - b'0:31 - ring_msi_data: MSI data
  3888. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  3889. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3890. * dword11 - b'0:14 - intr_batch_counter_th:
  3891. * batch counter threshold is in units of 4-byte words.
  3892. * HW internally maintains and increments batch count.
  3893. * (see SRING spec for detail description).
  3894. * When batch count reaches threshold value, an interrupt
  3895. * is generated by HW.
  3896. * b'15 - sw_intr_mode:
  3897. * This configuration shall be static.
  3898. * Only programmed at power up.
  3899. * 0: generate pulse style sw interrupts
  3900. * 1: generate level style sw interrupts
  3901. * b'16:31 - intr_timer_th:
  3902. * The timer init value when timer is idle or is
  3903. * initialized to start downcounting.
  3904. * In 8us units (to cover a range of 0 to 524 ms)
  3905. * dword12 - b'0:15 - intr_low_threshold:
  3906. * Used only by Consumer ring to generate ring_sw_int_p.
  3907. * Ring entries low threshold water mark, that is used
  3908. * in combination with the interrupt timer as well as
  3909. * the the clearing of the level interrupt.
  3910. * b'16:18 - prefetch_timer_cfg:
  3911. * Used only by Consumer ring to set timer mode to
  3912. * support Application prefetch handling.
  3913. * The external tail offset/pointer will be updated
  3914. * at following intervals:
  3915. * 3'b000: (Prefetch feature disabled; used only for debug)
  3916. * 3'b001: 1 usec
  3917. * 3'b010: 4 usec
  3918. * 3'b011: 8 usec (default)
  3919. * 3'b100: 16 usec
  3920. * Others: Reserverd
  3921. * b'19 - response_required:
  3922. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  3923. * b'20:31 - reserved: reserved for future use
  3924. */
  3925. PREPACK struct htt_sring_setup_t {
  3926. A_UINT32 msg_type: 8,
  3927. pdev_id: 8,
  3928. ring_id: 8,
  3929. ring_type: 8;
  3930. A_UINT32 ring_base_addr_lo;
  3931. A_UINT32 ring_base_addr_hi;
  3932. A_UINT32 ring_size: 16,
  3933. ring_entry_size: 8,
  3934. ring_misc_cfg_flag: 8;
  3935. A_UINT32 ring_head_offset32_remote_addr_lo;
  3936. A_UINT32 ring_head_offset32_remote_addr_hi;
  3937. A_UINT32 ring_tail_offset32_remote_addr_lo;
  3938. A_UINT32 ring_tail_offset32_remote_addr_hi;
  3939. A_UINT32 ring_msi_addr_lo;
  3940. A_UINT32 ring_msi_addr_hi;
  3941. A_UINT32 ring_msi_data;
  3942. A_UINT32 intr_batch_counter_th: 15,
  3943. sw_intr_mode: 1,
  3944. intr_timer_th: 16;
  3945. A_UINT32 intr_low_threshold: 16,
  3946. prefetch_timer_cfg: 3,
  3947. response_required: 1,
  3948. reserved1: 12;
  3949. } POSTPACK;
  3950. enum htt_srng_ring_type {
  3951. HTT_HW_TO_SW_RING = 0,
  3952. HTT_SW_TO_HW_RING,
  3953. HTT_SW_TO_SW_RING,
  3954. /* Insert new ring types above this line */
  3955. };
  3956. enum htt_srng_ring_id {
  3957. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  3958. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  3959. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  3960. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  3961. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  3962. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  3963. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  3964. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  3965. /* Add Other SRING which can't be directly configured by host software above this line */
  3966. };
  3967. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  3968. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  3969. #define HTT_SRING_SETUP_PDEV_ID_S 8
  3970. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  3971. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  3972. HTT_SRING_SETUP_PDEV_ID_S)
  3973. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  3974. do { \
  3975. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  3976. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  3977. } while (0)
  3978. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  3979. #define HTT_SRING_SETUP_RING_ID_S 16
  3980. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  3981. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  3982. HTT_SRING_SETUP_RING_ID_S)
  3983. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  3984. do { \
  3985. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  3986. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  3987. } while (0)
  3988. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  3989. #define HTT_SRING_SETUP_RING_TYPE_S 24
  3990. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  3991. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  3992. HTT_SRING_SETUP_RING_TYPE_S)
  3993. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  3994. do { \
  3995. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  3996. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  3997. } while (0)
  3998. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  3999. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4000. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4001. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4002. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4003. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4004. do { \
  4005. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4006. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4007. } while (0)
  4008. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4009. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4010. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4011. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4012. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4013. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4014. do { \
  4015. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4016. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4017. } while (0)
  4018. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4019. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4020. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4021. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4022. HTT_SRING_SETUP_RING_SIZE_S)
  4023. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4024. do { \
  4025. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4026. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4027. } while (0)
  4028. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4029. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4030. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4031. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4032. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4033. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4034. do { \
  4035. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4036. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4037. } while (0)
  4038. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4039. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4040. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4041. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4042. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4043. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4044. do { \
  4045. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4046. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4047. } while (0)
  4048. /* This control bit is applicable to only Producer, which updates Ring ID field
  4049. * of each descriptor before pushing into the ring.
  4050. * 0: updates ring_id(default)
  4051. * 1: ring_id updating disabled */
  4052. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4053. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4054. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4055. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4056. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4057. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4058. do { \
  4059. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4060. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4061. } while (0)
  4062. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4063. * of each descriptor before pushing into the ring.
  4064. * 0: updates Loopcnt(default)
  4065. * 1: Loopcnt updating disabled */
  4066. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4067. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4068. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4069. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4070. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4071. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4072. do { \
  4073. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4074. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4075. } while (0)
  4076. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4077. * into security_id port of GXI/AXI. */
  4078. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4079. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4080. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4081. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4082. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4083. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4084. do { \
  4085. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4086. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4087. } while (0)
  4088. /* During MSI write operation, SRNG drives value of this register bit into
  4089. * swap bit of GXI/AXI. */
  4090. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4091. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4092. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4093. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4094. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4095. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4096. do { \
  4097. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4098. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4099. } while (0)
  4100. /* During Pointer write operation, SRNG drives value of this register bit into
  4101. * swap bit of GXI/AXI. */
  4102. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4103. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4104. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4105. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4106. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4107. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4108. do { \
  4109. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4110. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4111. } while (0)
  4112. /* During any data or TLV write operation, SRNG drives value of this register
  4113. * bit into swap bit of GXI/AXI. */
  4114. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4115. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4116. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4117. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4118. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4119. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4120. do { \
  4121. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4122. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4123. } while (0)
  4124. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4125. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4126. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4127. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4128. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4129. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4130. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4131. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4132. do { \
  4133. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4134. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4135. } while (0)
  4136. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4137. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4138. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4139. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4140. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4141. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4142. do { \
  4143. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4144. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4145. } while (0)
  4146. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4147. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4148. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4149. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4150. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4151. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4152. do { \
  4153. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4154. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4155. } while (0)
  4156. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4157. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4158. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4159. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4160. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4161. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4162. do { \
  4163. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4164. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4165. } while (0)
  4166. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4167. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4168. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4169. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4170. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4171. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4172. do { \
  4173. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4174. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4175. } while (0)
  4176. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4177. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4178. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4179. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4180. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4181. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4182. do { \
  4183. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4184. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4185. } while (0)
  4186. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4187. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4188. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4189. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4190. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4191. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4192. do { \
  4193. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4194. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4195. } while (0)
  4196. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4197. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4198. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4199. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4200. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4201. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4202. do { \
  4203. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4204. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4205. } while (0)
  4206. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4207. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4208. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4209. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4210. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4211. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4212. do { \
  4213. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4214. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4215. } while (0)
  4216. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4217. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4218. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4219. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4220. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4221. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4222. do { \
  4223. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4224. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4225. } while (0)
  4226. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4227. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4228. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4229. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4230. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4231. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4232. do { \
  4233. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4234. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4235. } while (0)
  4236. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4237. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4238. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4239. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4240. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4241. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4242. do { \
  4243. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4244. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4245. } while (0)
  4246. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4247. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4248. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4249. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4250. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4251. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4252. do { \
  4253. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4254. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4255. } while (0)
  4256. /**
  4257. * @brief HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG Message
  4258. *
  4259. * @details
  4260. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4261. * configure RXDMA rings.
  4262. * The configuration is per ring based and includes both packet subtypes
  4263. * and PPDU/MPDU TLVs.
  4264. *
  4265. * The message would appear as follows:
  4266. *
  4267. * |31 26|25|24|23 16|15 8|7 0|
  4268. * |-----------------+----------------+----------------+---------------|
  4269. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  4270. * |-------------------------------------------------------------------|
  4271. * | rsvd2 | ring_buffer_size |
  4272. * |-------------------------------------------------------------------|
  4273. * | packet_type_enable_flags_0 |
  4274. * |-------------------------------------------------------------------|
  4275. * | packet_type_enable_flags_1 |
  4276. * |-------------------------------------------------------------------|
  4277. * | packet_type_enable_flags_2 |
  4278. * |-------------------------------------------------------------------|
  4279. * | packet_type_enable_flags_3 |
  4280. * |-------------------------------------------------------------------|
  4281. * | tlv_filter_in_flags |
  4282. * |-------------------------------------------------------------------|
  4283. * Where:
  4284. * PS = pkt_swap
  4285. * SS = status_swap
  4286. * The message is interpreted as follows:
  4287. * dword0 - b'0:7 - msg_type: This will be set to
  4288. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4289. * b'8:15 - pdev_id:
  4290. * 0 (for rings at SOC/UMAC level),
  4291. * 1/2/3 mac id (for rings at LMAC level)
  4292. * b'16:23 - ring_id : Identify the ring to configure.
  4293. * More details can be got from enum htt_srng_ring_id
  4294. * b'24 - status_swap: 1 is to swap status TLV
  4295. * b'25 - pkt_swap: 1 is to swap packet TLV
  4296. * b'26:31 - rsvd1: reserved for future use
  4297. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4298. * in byte units.
  4299. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4300. * - b'16:31 - rsvd2: Reserved for future use
  4301. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4302. * Enable MGMT packet from 0b0000 to 0b1001
  4303. * bits from low to high: FP, MD, MO - 3 bits
  4304. * FP: Filter_Pass
  4305. * MD: Monitor_Direct
  4306. * MO: Monitor_Other
  4307. * 10 mgmt subtypes * 3 bits -> 30 bits
  4308. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4309. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4310. * Enable MGMT packet from 0b1010 to 0b1111
  4311. * bits from low to high: FP, MD, MO - 3 bits
  4312. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4313. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4314. * Enable CTRL packet from 0b0000 to 0b1001
  4315. * bits from low to high: FP, MD, MO - 3 bits
  4316. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4317. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4318. * Enable CTRL packet from 0b1010 to 0b1111,
  4319. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4320. * bits from low to high: FP, MD, MO - 3 bits
  4321. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4322. * dword6 - b'0:31 - tlv_filter_in_flags:
  4323. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4324. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4325. */
  4326. PREPACK struct htt_rx_ring_selection_cfg_t {
  4327. A_UINT32 msg_type: 8,
  4328. pdev_id: 8,
  4329. ring_id: 8,
  4330. status_swap: 1,
  4331. pkt_swap: 1,
  4332. rsvd1: 6;
  4333. A_UINT32 ring_buffer_size: 16,
  4334. rsvd2: 16;
  4335. A_UINT32 packet_type_enable_flags_0;
  4336. A_UINT32 packet_type_enable_flags_1;
  4337. A_UINT32 packet_type_enable_flags_2;
  4338. A_UINT32 packet_type_enable_flags_3;
  4339. A_UINT32 tlv_filter_in_flags;
  4340. } POSTPACK;
  4341. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4342. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4343. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4344. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4345. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4346. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4347. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4348. do { \
  4349. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4350. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4351. } while (0)
  4352. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4353. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4354. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4355. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4356. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4357. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4358. do { \
  4359. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4360. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4361. } while (0)
  4362. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4363. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4364. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4365. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4366. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4367. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4368. do { \
  4369. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  4370. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4371. } while (0)
  4372. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4373. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4374. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4375. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4376. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4377. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4378. do { \
  4379. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  4380. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4381. } while (0)
  4382. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4383. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4384. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4385. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4386. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4387. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4388. do { \
  4389. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  4390. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4391. } while (0)
  4392. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4393. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4394. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4395. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4396. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4397. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4398. do { \
  4399. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  4400. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4401. } while (0)
  4402. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4403. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4404. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4405. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4406. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4407. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4408. do { \
  4409. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  4410. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4411. } while (0)
  4412. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4413. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4414. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4415. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4416. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4417. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4418. do { \
  4419. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  4420. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4421. } while (0)
  4422. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4423. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4424. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4425. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4426. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4427. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4428. do { \
  4429. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  4430. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4431. } while (0)
  4432. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4433. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4434. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4435. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4436. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4437. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4438. do { \
  4439. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4440. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4441. } while (0)
  4442. /*
  4443. * Subtype based MGMT frames enable bits.
  4444. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4445. */
  4446. /* association request */
  4447. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  4448. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4449. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  4450. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4451. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  4452. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4453. /* association response */
  4454. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  4455. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4456. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  4457. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4458. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  4459. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4460. /* Reassociation request */
  4461. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  4462. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  4463. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  4464. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  4465. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  4466. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  4467. /* Reassociation response */
  4468. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  4469. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  4470. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  4471. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  4472. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  4473. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  4474. /* Probe request */
  4475. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  4476. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  4477. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  4478. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  4479. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  4480. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  4481. /* Probe response */
  4482. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  4483. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  4484. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  4485. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  4486. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  4487. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  4488. /* Timing Advertisement */
  4489. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  4490. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  4491. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  4492. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  4493. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  4494. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  4495. /* Reserved */
  4496. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  4497. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  4498. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  4499. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  4500. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  4501. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  4502. /* Beacon */
  4503. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000001
  4504. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  4505. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000001
  4506. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  4507. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x00000001
  4508. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  4509. /* ATIM */
  4510. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x00000001
  4511. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  4512. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x00000001
  4513. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  4514. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x00000001
  4515. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  4516. /* Disassociation */
  4517. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  4518. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  4519. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  4520. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  4521. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  4522. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  4523. /* Authentication */
  4524. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  4525. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  4526. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  4527. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  4528. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  4529. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  4530. /* Deauthentication */
  4531. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  4532. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  4533. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  4534. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  4535. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  4536. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  4537. /* Action */
  4538. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  4539. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  4540. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  4541. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  4542. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  4543. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  4544. /* Action No Ack */
  4545. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  4546. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  4547. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  4548. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  4549. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  4550. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  4551. /* Reserved */
  4552. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  4553. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  4554. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  4555. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  4556. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  4557. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  4558. /*
  4559. * Subtype based CTRL frames enable bits.
  4560. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  4561. */
  4562. /* Reserved */
  4563. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  4564. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  4565. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  4566. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  4567. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  4568. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  4569. /* Reserved */
  4570. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  4571. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  4572. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  4573. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  4574. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  4575. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  4576. /* Reserved */
  4577. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  4578. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  4579. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  4580. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  4581. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  4582. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  4583. /* Reserved */
  4584. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  4585. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  4586. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  4587. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  4588. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  4589. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  4590. /* Reserved */
  4591. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  4592. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  4593. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  4594. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  4595. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  4596. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  4597. /* Reserved */
  4598. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  4599. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  4600. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  4601. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  4602. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  4603. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  4604. /* Reserved */
  4605. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  4606. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  4607. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  4608. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  4609. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  4610. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  4611. /* Control Wrapper */
  4612. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  4613. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  4614. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  4615. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  4616. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  4617. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  4618. /* Block Ack Request */
  4619. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  4620. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  4621. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  4622. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  4623. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  4624. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  4625. /* Block Ack*/
  4626. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  4627. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  4628. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  4629. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  4630. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  4631. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  4632. /* PS-POLL */
  4633. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  4634. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  4635. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  4636. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  4637. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  4638. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  4639. /* RTS */
  4640. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  4641. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  4642. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  4643. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  4644. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  4645. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  4646. /* CTS */
  4647. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  4648. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  4649. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  4650. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  4651. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  4652. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  4653. /* ACK */
  4654. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  4655. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  4656. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  4657. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  4658. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  4659. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  4660. /* CF-END */
  4661. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  4662. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  4663. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  4664. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  4665. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  4666. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  4667. /* CF-END + CF-ACK */
  4668. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  4669. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  4670. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  4671. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  4672. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  4673. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  4674. /* Multicast data */
  4675. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  4676. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  4677. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  4678. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  4679. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  4680. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  4681. /* Unicast data */
  4682. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  4683. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  4684. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  4685. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  4686. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  4687. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  4688. /* NULL data */
  4689. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  4690. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  4691. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  4692. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  4693. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  4694. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  4695. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  4696. do { \
  4697. HTT_CHECK_SET_VAL(httsym, value); \
  4698. (word) |= (value) << httsym##_S; \
  4699. } while (0)
  4700. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  4701. (((word) & httsym##_M) >> httsym##_S)
  4702. #define htt_rx_ring_pkt_enable_subtype_set( \
  4703. word, flag, mode, type, subtype, val) \
  4704. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  4705. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  4706. #define htt_rx_ring_pkt_enable_subtype_get( \
  4707. word, flag, mode, type, subtype) \
  4708. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  4709. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  4710. /* Definition to filter in TLVs */
  4711. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  4712. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  4713. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  4714. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  4715. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  4716. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  4717. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  4718. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  4719. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  4720. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  4721. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  4722. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  4723. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  4724. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  4725. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  4726. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  4727. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  4728. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  4729. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  4730. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  4731. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  4732. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  4733. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  4734. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  4735. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  4736. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  4737. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  4738. do { \
  4739. HTT_CHECK_SET_VAL(httsym, enable); \
  4740. (word) |= (enable) << httsym##_S; \
  4741. } while (0)
  4742. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  4743. (((word) & httsym##_M) >> httsym##_S)
  4744. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  4745. HTT_RX_RING_TLV_ENABLE_SET( \
  4746. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  4747. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  4748. HTT_RX_RING_TLV_ENABLE_GET( \
  4749. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  4750. /**
  4751. * @brief HTT_H2T_MSG_TYPE_RFS_CONFIG
  4752. * host --> target Receive Flow Steering configuration message definition.
  4753. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  4754. * The reason for this is we want RFS to be configured and ready before MAC
  4755. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  4756. *
  4757. * |31 24|23 16|15 9|8|7 0|
  4758. * |----------------+----------------+----------------+----------------|
  4759. * | reserved |E| msg type |
  4760. * |-------------------------------------------------------------------|
  4761. * Where E = RFS enable flag
  4762. *
  4763. * The RFS_CONFIG message consists of a single 4-byte word.
  4764. *
  4765. * Header fields:
  4766. * - MSG_TYPE
  4767. * Bits 7:0
  4768. * Purpose: identifies this as a RFS config msg
  4769. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  4770. * - RFS_CONFIG
  4771. * Bit 8
  4772. * Purpose: Tells target whether to enable (1) or disable (0)
  4773. * flow steering feature when sending rx indication messages to host
  4774. */
  4775. #define HTT_H2T_RFS_CONFIG_M 0x100
  4776. #define HTT_H2T_RFS_CONFIG_S 8
  4777. #define HTT_RX_RFS_CONFIG_GET(_var) \
  4778. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  4779. HTT_H2T_RFS_CONFIG_S)
  4780. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  4781. do { \
  4782. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  4783. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  4784. } while (0)
  4785. #define HTT_RFS_CFG_REQ_BYTES 4
  4786. /**
  4787. * @brief host -> target FW extended statistics retrieve
  4788. *
  4789. * @details
  4790. * The following field definitions describe the format of the HTT host
  4791. * to target FW extended stats retrieve message.
  4792. * The message specifies the type of stats the host wants to retrieve.
  4793. *
  4794. * |31 24|23 16|15 8|7 0|
  4795. * |-----------------------------------------------------------|
  4796. * | reserved | stats type | pdev_mask | msg type |
  4797. * |-----------------------------------------------------------|
  4798. * | config param [0] |
  4799. * |-----------------------------------------------------------|
  4800. * | config param [1] |
  4801. * |-----------------------------------------------------------|
  4802. * | config param [2] |
  4803. * |-----------------------------------------------------------|
  4804. * | config param [3] |
  4805. * |-----------------------------------------------------------|
  4806. * | reserved |
  4807. * |-----------------------------------------------------------|
  4808. * | cookie LSBs |
  4809. * |-----------------------------------------------------------|
  4810. * | cookie MSBs |
  4811. * |-----------------------------------------------------------|
  4812. * Header fields:
  4813. * - MSG_TYPE
  4814. * Bits 7:0
  4815. * Purpose: identifies this is a extended stats upload request message
  4816. * Value: 0x10
  4817. * - PDEV_MASK
  4818. * Bits 8:15
  4819. * Purpose: identifies the mask of PDEVs to retrieve stats from
  4820. * Value: This is a overloaded field, refer to usage and interpretation of
  4821. * PDEV in interface document.
  4822. * Bit 8 : Reserved for SOC stats
  4823. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  4824. * Indicates MACID_MASK in DBS
  4825. * - STATS_TYPE
  4826. * Bits 23:16
  4827. * Purpose: identifies which FW statistics to upload
  4828. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  4829. * - Reserved
  4830. * Bits 31:24
  4831. * - CONFIG_PARAM [0]
  4832. * Bits 31:0
  4833. * Purpose: give an opaque configuration value to the specified stats type
  4834. * Value: stats-type specific configuration value
  4835. * Refer to htt_stats.h for interpretation for each stats sub_type
  4836. * - CONFIG_PARAM [1]
  4837. * Bits 31:0
  4838. * Purpose: give an opaque configuration value to the specified stats type
  4839. * Value: stats-type specific configuration value
  4840. * Refer to htt_stats.h for interpretation for each stats sub_type
  4841. * - CONFIG_PARAM [2]
  4842. * Bits 31:0
  4843. * Purpose: give an opaque configuration value to the specified stats type
  4844. * Value: stats-type specific configuration value
  4845. * Refer to htt_stats.h for interpretation for each stats sub_type
  4846. * - CONFIG_PARAM [3]
  4847. * Bits 31:0
  4848. * Purpose: give an opaque configuration value to the specified stats type
  4849. * Value: stats-type specific configuration value
  4850. * Refer to htt_stats.h for interpretation for each stats sub_type
  4851. * - Reserved [31:0] for future use.
  4852. * - COOKIE_LSBS
  4853. * Bits 31:0
  4854. * Purpose: Provide a mechanism to match a target->host stats confirmation
  4855. * message with its preceding host->target stats request message.
  4856. * Value: LSBs of the opaque cookie specified by the host-side requestor
  4857. * - COOKIE_MSBS
  4858. * Bits 31:0
  4859. * Purpose: Provide a mechanism to match a target->host stats confirmation
  4860. * message with its preceding host->target stats request message.
  4861. * Value: MSBs of the opaque cookie specified by the host-side requestor
  4862. */
  4863. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  4864. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  4865. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  4866. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  4867. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  4868. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  4869. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  4870. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  4871. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  4872. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  4873. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  4874. do { \
  4875. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  4876. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  4877. } while (0)
  4878. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  4879. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  4880. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  4881. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  4882. do { \
  4883. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  4884. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  4885. } while (0)
  4886. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  4887. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  4888. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  4889. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  4890. do { \
  4891. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  4892. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  4893. } while (0)
  4894. /**
  4895. * @brief host -> target FW PPDU_STATS request message
  4896. *
  4897. * @details
  4898. * The following field definitions describe the format of the HTT host
  4899. * to target FW for PPDU_STATS_CFG msg.
  4900. * The message allows the host to configure the PPDU_STATS_IND messages
  4901. * produced by the target.
  4902. *
  4903. * |31 24|23 16|15 8|7 0|
  4904. * |-----------------------------------------------------------|
  4905. * | REQ bit mask | pdev_mask | msg type |
  4906. * |-----------------------------------------------------------|
  4907. * Header fields:
  4908. * - MSG_TYPE
  4909. * Bits 7:0
  4910. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  4911. * Value: 0x11
  4912. * - PDEV_MASK
  4913. * Bits 8:15
  4914. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  4915. * Value: This is a overloaded field, refer to usage and interpretation of
  4916. * PDEV in interface document.
  4917. * Bit 8 : Reserved for SOC stats
  4918. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  4919. * Indicates MACID_MASK in DBS
  4920. * - REQ_TLV_BIT_MASK
  4921. * Bits 16:31
  4922. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  4923. * needs to be included in the target's PPDU_STATS_IND messages.
  4924. * Value: refer htt_ppdu_stats_tlv_tag_t
  4925. *
  4926. */
  4927. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  4928. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  4929. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  4930. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  4931. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  4932. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  4933. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  4934. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  4935. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  4936. do { \
  4937. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  4938. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  4939. } while (0)
  4940. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  4941. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  4942. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  4943. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  4944. do { \
  4945. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  4946. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  4947. } while (0)
  4948. /*=== target -> host messages ===============================================*/
  4949. enum htt_t2h_msg_type {
  4950. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  4951. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  4952. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  4953. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  4954. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  4955. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  4956. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  4957. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  4958. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  4959. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  4960. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  4961. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  4962. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  4963. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  4964. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  4965. /* only used for HL, add HTT MSG for HTT CREDIT update */
  4966. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  4967. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  4968. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  4969. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  4970. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  4971. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  4972. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  4973. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  4974. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  4975. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  4976. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  4977. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  4978. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  4979. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  4980. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  4981. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  4982. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  4983. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  4984. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  4985. HTT_T2H_MSG_TYPE_TEST,
  4986. /* keep this last */
  4987. HTT_T2H_NUM_MSGS
  4988. };
  4989. /*
  4990. * HTT target to host message type -
  4991. * stored in bits 7:0 of the first word of the message
  4992. */
  4993. #define HTT_T2H_MSG_TYPE_M 0xff
  4994. #define HTT_T2H_MSG_TYPE_S 0
  4995. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  4996. do { \
  4997. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  4998. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  4999. } while (0)
  5000. #define HTT_T2H_MSG_TYPE_GET(word) \
  5001. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  5002. /**
  5003. * @brief target -> host version number confirmation message definition
  5004. *
  5005. * |31 24|23 16|15 8|7 0|
  5006. * |----------------+----------------+----------------+----------------|
  5007. * | reserved | major number | minor number | msg type |
  5008. * |-------------------------------------------------------------------|
  5009. * : option request TLV (optional) |
  5010. * :...................................................................:
  5011. *
  5012. * The VER_CONF message may consist of a single 4-byte word, or may be
  5013. * extended with TLVs that specify HTT options selected by the target.
  5014. * The following option TLVs may be appended to the VER_CONF message:
  5015. * - LL_BUS_ADDR_SIZE
  5016. * - HL_SUPPRESS_TX_COMPL_IND
  5017. * - MAX_TX_QUEUE_GROUPS
  5018. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  5019. * may be appended to the VER_CONF message (but only one TLV of each type).
  5020. *
  5021. * Header fields:
  5022. * - MSG_TYPE
  5023. * Bits 7:0
  5024. * Purpose: identifies this as a version number confirmation message
  5025. * Value: 0x0
  5026. * - VER_MINOR
  5027. * Bits 15:8
  5028. * Purpose: Specify the minor number of the HTT message library version
  5029. * in use by the target firmware.
  5030. * The minor number specifies the specific revision within a range
  5031. * of fundamentally compatible HTT message definition revisions.
  5032. * Compatible revisions involve adding new messages or perhaps
  5033. * adding new fields to existing messages, in a backwards-compatible
  5034. * manner.
  5035. * Incompatible revisions involve changing the message type values,
  5036. * or redefining existing messages.
  5037. * Value: minor number
  5038. * - VER_MAJOR
  5039. * Bits 15:8
  5040. * Purpose: Specify the major number of the HTT message library version
  5041. * in use by the target firmware.
  5042. * The major number specifies the family of minor revisions that are
  5043. * fundamentally compatible with each other, but not with prior or
  5044. * later families.
  5045. * Value: major number
  5046. */
  5047. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  5048. #define HTT_VER_CONF_MINOR_S 8
  5049. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  5050. #define HTT_VER_CONF_MAJOR_S 16
  5051. #define HTT_VER_CONF_MINOR_SET(word, value) \
  5052. do { \
  5053. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  5054. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  5055. } while (0)
  5056. #define HTT_VER_CONF_MINOR_GET(word) \
  5057. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  5058. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  5059. do { \
  5060. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  5061. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  5062. } while (0)
  5063. #define HTT_VER_CONF_MAJOR_GET(word) \
  5064. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  5065. #define HTT_VER_CONF_BYTES 4
  5066. /**
  5067. * @brief - target -> host HTT Rx In order indication message
  5068. *
  5069. * @details
  5070. *
  5071. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  5072. * |----------------+-------------------+---------------------+---------------|
  5073. * | peer ID | P| F| O| ext TID | msg type |
  5074. * |--------------------------------------------------------------------------|
  5075. * | MSDU count | Reserved | vdev id |
  5076. * |--------------------------------------------------------------------------|
  5077. * | MSDU 0 bus address (bits 31:0) |
  5078. #if HTT_PADDR64
  5079. * | MSDU 0 bus address (bits 63:32) |
  5080. #endif
  5081. * |--------------------------------------------------------------------------|
  5082. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  5083. * |--------------------------------------------------------------------------|
  5084. * | MSDU 1 bus address (bits 31:0) |
  5085. #if HTT_PADDR64
  5086. * | MSDU 1 bus address (bits 63:32) |
  5087. #endif
  5088. * |--------------------------------------------------------------------------|
  5089. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  5090. * |--------------------------------------------------------------------------|
  5091. */
  5092. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  5093. *
  5094. * @details
  5095. * bits
  5096. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  5097. * |-----+----+-------+--------+--------+---------+---------+-----------|
  5098. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  5099. * | | frag | | | | fail |chksum fail|
  5100. * |-----+----+-------+--------+--------+---------+---------+-----------|
  5101. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  5102. */
  5103. struct htt_rx_in_ord_paddr_ind_hdr_t
  5104. {
  5105. A_UINT32 /* word 0 */
  5106. msg_type: 8,
  5107. ext_tid: 5,
  5108. offload: 1,
  5109. frag: 1,
  5110. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  5111. peer_id: 16;
  5112. A_UINT32 /* word 1 */
  5113. vap_id: 8,
  5114. reserved_1: 8,
  5115. msdu_cnt: 16;
  5116. };
  5117. struct htt_rx_in_ord_paddr_ind_msdu32_t
  5118. {
  5119. A_UINT32 dma_addr;
  5120. A_UINT32
  5121. length: 16,
  5122. fw_desc: 8,
  5123. msdu_info:8;
  5124. };
  5125. struct htt_rx_in_ord_paddr_ind_msdu64_t
  5126. {
  5127. A_UINT32 dma_addr_lo;
  5128. A_UINT32 dma_addr_hi;
  5129. A_UINT32
  5130. length: 16,
  5131. fw_desc: 8,
  5132. msdu_info:8;
  5133. };
  5134. #if HTT_PADDR64
  5135. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  5136. #else
  5137. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  5138. #endif
  5139. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  5140. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  5141. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  5142. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  5143. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  5144. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  5145. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  5146. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  5147. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  5148. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  5149. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  5150. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  5151. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  5152. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  5153. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  5154. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  5155. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  5156. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  5157. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  5158. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  5159. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  5160. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  5161. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  5162. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  5163. /* for systems using 64-bit format for bus addresses */
  5164. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  5165. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  5166. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  5167. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  5168. /* for systems using 32-bit format for bus addresses */
  5169. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  5170. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  5171. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  5172. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  5173. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  5174. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  5175. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  5176. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  5177. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  5178. do { \
  5179. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  5180. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  5181. } while (0)
  5182. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  5183. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  5184. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  5185. do { \
  5186. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  5187. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  5188. } while (0)
  5189. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  5190. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  5191. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  5192. do { \
  5193. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  5194. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  5195. } while (0)
  5196. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  5197. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  5198. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  5199. do { \
  5200. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  5201. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  5202. } while (0)
  5203. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  5204. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  5205. /* for systems using 64-bit format for bus addresses */
  5206. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  5207. do { \
  5208. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  5209. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  5210. } while (0)
  5211. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  5212. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  5213. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  5214. do { \
  5215. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  5216. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  5217. } while (0)
  5218. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  5219. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  5220. /* for systems using 32-bit format for bus addresses */
  5221. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  5222. do { \
  5223. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  5224. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  5225. } while (0)
  5226. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  5227. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  5228. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  5229. do { \
  5230. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  5231. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  5232. } while (0)
  5233. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  5234. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  5235. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  5236. do { \
  5237. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  5238. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  5239. } while (0)
  5240. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  5241. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  5242. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  5243. do { \
  5244. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  5245. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  5246. } while (0)
  5247. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  5248. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  5249. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  5250. do { \
  5251. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  5252. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  5253. } while (0)
  5254. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  5255. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  5256. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  5257. do { \
  5258. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  5259. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  5260. } while (0)
  5261. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  5262. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  5263. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  5264. do { \
  5265. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  5266. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  5267. } while (0)
  5268. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  5269. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  5270. /* definitions used within target -> host rx indication message */
  5271. PREPACK struct htt_rx_ind_hdr_prefix_t
  5272. {
  5273. A_UINT32 /* word 0 */
  5274. msg_type: 8,
  5275. ext_tid: 5,
  5276. release_valid: 1,
  5277. flush_valid: 1,
  5278. reserved0: 1,
  5279. peer_id: 16;
  5280. A_UINT32 /* word 1 */
  5281. flush_start_seq_num: 6,
  5282. flush_end_seq_num: 6,
  5283. release_start_seq_num: 6,
  5284. release_end_seq_num: 6,
  5285. num_mpdu_ranges: 8;
  5286. } POSTPACK;
  5287. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  5288. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  5289. #define HTT_TGT_RSSI_INVALID 0x80
  5290. PREPACK struct htt_rx_ppdu_desc_t
  5291. {
  5292. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  5293. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  5294. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  5295. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  5296. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  5297. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  5298. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  5299. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  5300. A_UINT32 /* word 0 */
  5301. rssi_cmb: 8,
  5302. timestamp_submicrosec: 8,
  5303. phy_err_code: 8,
  5304. phy_err: 1,
  5305. legacy_rate: 4,
  5306. legacy_rate_sel: 1,
  5307. end_valid: 1,
  5308. start_valid: 1;
  5309. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  5310. union {
  5311. A_UINT32 /* word 1 */
  5312. rssi0_pri20: 8,
  5313. rssi0_ext20: 8,
  5314. rssi0_ext40: 8,
  5315. rssi0_ext80: 8;
  5316. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  5317. } u0;
  5318. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  5319. union {
  5320. A_UINT32 /* word 2 */
  5321. rssi1_pri20: 8,
  5322. rssi1_ext20: 8,
  5323. rssi1_ext40: 8,
  5324. rssi1_ext80: 8;
  5325. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  5326. } u1;
  5327. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  5328. union {
  5329. A_UINT32 /* word 3 */
  5330. rssi2_pri20: 8,
  5331. rssi2_ext20: 8,
  5332. rssi2_ext40: 8,
  5333. rssi2_ext80: 8;
  5334. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  5335. } u2;
  5336. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  5337. union {
  5338. A_UINT32 /* word 4 */
  5339. rssi3_pri20: 8,
  5340. rssi3_ext20: 8,
  5341. rssi3_ext40: 8,
  5342. rssi3_ext80: 8;
  5343. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  5344. } u3;
  5345. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  5346. A_UINT32 tsf32; /* word 5 */
  5347. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  5348. A_UINT32 timestamp_microsec; /* word 6 */
  5349. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  5350. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  5351. A_UINT32 /* word 7 */
  5352. vht_sig_a1: 24,
  5353. preamble_type: 8;
  5354. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  5355. A_UINT32 /* word 8 */
  5356. vht_sig_a2: 24,
  5357. reserved0: 8;
  5358. } POSTPACK;
  5359. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  5360. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  5361. PREPACK struct htt_rx_ind_hdr_suffix_t
  5362. {
  5363. A_UINT32 /* word 0 */
  5364. fw_rx_desc_bytes: 16,
  5365. reserved0: 16;
  5366. } POSTPACK;
  5367. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  5368. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  5369. PREPACK struct htt_rx_ind_hdr_t
  5370. {
  5371. struct htt_rx_ind_hdr_prefix_t prefix;
  5372. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  5373. struct htt_rx_ind_hdr_suffix_t suffix;
  5374. } POSTPACK;
  5375. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  5376. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  5377. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  5378. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  5379. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  5380. /*
  5381. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  5382. * the offset into the HTT rx indication message at which the
  5383. * FW rx PPDU descriptor resides
  5384. */
  5385. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  5386. /*
  5387. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  5388. * the offset into the HTT rx indication message at which the
  5389. * header suffix (FW rx MSDU byte count) resides
  5390. */
  5391. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  5392. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  5393. /*
  5394. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  5395. * the offset into the HTT rx indication message at which the per-MSDU
  5396. * information starts
  5397. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  5398. * per-MSDU information portion of the message. The per-MSDU info itself
  5399. * starts at byte 12.
  5400. */
  5401. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  5402. /**
  5403. * @brief target -> host rx indication message definition
  5404. *
  5405. * @details
  5406. * The following field definitions describe the format of the rx indication
  5407. * message sent from the target to the host.
  5408. * The message consists of three major sections:
  5409. * 1. a fixed-length header
  5410. * 2. a variable-length list of firmware rx MSDU descriptors
  5411. * 3. one or more 4-octet MPDU range information elements
  5412. * The fixed length header itself has two sub-sections
  5413. * 1. the message meta-information, including identification of the
  5414. * sender and type of the received data, and a 4-octet flush/release IE
  5415. * 2. the firmware rx PPDU descriptor
  5416. *
  5417. * The format of the message is depicted below.
  5418. * in this depiction, the following abbreviations are used for information
  5419. * elements within the message:
  5420. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  5421. * elements associated with the PPDU start are valid.
  5422. * Specifically, the following fields are valid only if SV is set:
  5423. * RSSI (all variants), L, legacy rate, preamble type, service,
  5424. * VHT-SIG-A
  5425. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  5426. * elements associated with the PPDU end are valid.
  5427. * Specifically, the following fields are valid only if EV is set:
  5428. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  5429. * - L - Legacy rate selector - if legacy rates are used, this flag
  5430. * indicates whether the rate is from a CCK (L == 1) or OFDM
  5431. * (L == 0) PHY.
  5432. * - P - PHY error flag - boolean indication of whether the rx frame had
  5433. * a PHY error
  5434. *
  5435. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  5436. * |----------------+-------------------+---------------------+---------------|
  5437. * | peer ID | |RV|FV| ext TID | msg type |
  5438. * |--------------------------------------------------------------------------|
  5439. * | num | release | release | flush | flush |
  5440. * | MPDU | end | start | end | start |
  5441. * | ranges | seq num | seq num | seq num | seq num |
  5442. * |==========================================================================|
  5443. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  5444. * |V|V| | rate | | | timestamp | RSSI |
  5445. * |--------------------------------------------------------------------------|
  5446. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  5447. * |--------------------------------------------------------------------------|
  5448. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  5449. * |--------------------------------------------------------------------------|
  5450. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  5451. * |--------------------------------------------------------------------------|
  5452. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  5453. * |--------------------------------------------------------------------------|
  5454. * | TSF LSBs |
  5455. * |--------------------------------------------------------------------------|
  5456. * | microsec timestamp |
  5457. * |--------------------------------------------------------------------------|
  5458. * | preamble type | HT-SIG / VHT-SIG-A1 |
  5459. * |--------------------------------------------------------------------------|
  5460. * | service | HT-SIG / VHT-SIG-A2 |
  5461. * |==========================================================================|
  5462. * | reserved | FW rx desc bytes |
  5463. * |--------------------------------------------------------------------------|
  5464. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  5465. * | desc B3 | desc B2 | desc B1 | desc B0 |
  5466. * |--------------------------------------------------------------------------|
  5467. * : : :
  5468. * |--------------------------------------------------------------------------|
  5469. * | alignment | MSDU Rx |
  5470. * | padding | desc Bn |
  5471. * |--------------------------------------------------------------------------|
  5472. * | reserved | MPDU range status | MPDU count |
  5473. * |--------------------------------------------------------------------------|
  5474. * : reserved : MPDU range status : MPDU count :
  5475. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  5476. *
  5477. * Header fields:
  5478. * - MSG_TYPE
  5479. * Bits 7:0
  5480. * Purpose: identifies this as an rx indication message
  5481. * Value: 0x1
  5482. * - EXT_TID
  5483. * Bits 12:8
  5484. * Purpose: identify the traffic ID of the rx data, including
  5485. * special "extended" TID values for multicast, broadcast, and
  5486. * non-QoS data frames
  5487. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  5488. * - FLUSH_VALID (FV)
  5489. * Bit 13
  5490. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  5491. * is valid
  5492. * Value:
  5493. * 1 -> flush IE is valid and needs to be processed
  5494. * 0 -> flush IE is not valid and should be ignored
  5495. * - REL_VALID (RV)
  5496. * Bit 13
  5497. * Purpose: indicate whether the release IE (start/end sequence numbers)
  5498. * is valid
  5499. * Value:
  5500. * 1 -> release IE is valid and needs to be processed
  5501. * 0 -> release IE is not valid and should be ignored
  5502. * - PEER_ID
  5503. * Bits 31:16
  5504. * Purpose: Identify, by ID, which peer sent the rx data
  5505. * Value: ID of the peer who sent the rx data
  5506. * - FLUSH_SEQ_NUM_START
  5507. * Bits 5:0
  5508. * Purpose: Indicate the start of a series of MPDUs to flush
  5509. * Not all MPDUs within this series are necessarily valid - the host
  5510. * must check each sequence number within this range to see if the
  5511. * corresponding MPDU is actually present.
  5512. * This field is only valid if the FV bit is set.
  5513. * Value:
  5514. * The sequence number for the first MPDUs to check to flush.
  5515. * The sequence number is masked by 0x3f.
  5516. * - FLUSH_SEQ_NUM_END
  5517. * Bits 11:6
  5518. * Purpose: Indicate the end of a series of MPDUs to flush
  5519. * Value:
  5520. * The sequence number one larger than the sequence number of the
  5521. * last MPDU to check to flush.
  5522. * The sequence number is masked by 0x3f.
  5523. * Not all MPDUs within this series are necessarily valid - the host
  5524. * must check each sequence number within this range to see if the
  5525. * corresponding MPDU is actually present.
  5526. * This field is only valid if the FV bit is set.
  5527. * - REL_SEQ_NUM_START
  5528. * Bits 17:12
  5529. * Purpose: Indicate the start of a series of MPDUs to release.
  5530. * All MPDUs within this series are present and valid - the host
  5531. * need not check each sequence number within this range to see if
  5532. * the corresponding MPDU is actually present.
  5533. * This field is only valid if the RV bit is set.
  5534. * Value:
  5535. * The sequence number for the first MPDUs to check to release.
  5536. * The sequence number is masked by 0x3f.
  5537. * - REL_SEQ_NUM_END
  5538. * Bits 23:18
  5539. * Purpose: Indicate the end of a series of MPDUs to release.
  5540. * Value:
  5541. * The sequence number one larger than the sequence number of the
  5542. * last MPDU to check to release.
  5543. * The sequence number is masked by 0x3f.
  5544. * All MPDUs within this series are present and valid - the host
  5545. * need not check each sequence number within this range to see if
  5546. * the corresponding MPDU is actually present.
  5547. * This field is only valid if the RV bit is set.
  5548. * - NUM_MPDU_RANGES
  5549. * Bits 31:24
  5550. * Purpose: Indicate how many ranges of MPDUs are present.
  5551. * Each MPDU range consists of a series of contiguous MPDUs within the
  5552. * rx frame sequence which all have the same MPDU status.
  5553. * Value: 1-63 (typically a small number, like 1-3)
  5554. *
  5555. * Rx PPDU descriptor fields:
  5556. * - RSSI_CMB
  5557. * Bits 7:0
  5558. * Purpose: Combined RSSI from all active rx chains, across the active
  5559. * bandwidth.
  5560. * Value: RSSI dB units w.r.t. noise floor
  5561. * - TIMESTAMP_SUBMICROSEC
  5562. * Bits 15:8
  5563. * Purpose: high-resolution timestamp
  5564. * Value:
  5565. * Sub-microsecond time of PPDU reception.
  5566. * This timestamp ranges from [0,MAC clock MHz).
  5567. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  5568. * to form a high-resolution, large range rx timestamp.
  5569. * - PHY_ERR_CODE
  5570. * Bits 23:16
  5571. * Purpose:
  5572. * If the rx frame processing resulted in a PHY error, indicate what
  5573. * type of rx PHY error occurred.
  5574. * Value:
  5575. * This field is valid if the "P" (PHY_ERR) flag is set.
  5576. * TBD: document/specify the values for this field
  5577. * - PHY_ERR
  5578. * Bit 24
  5579. * Purpose: indicate whether the rx PPDU had a PHY error
  5580. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  5581. * - LEGACY_RATE
  5582. * Bits 28:25
  5583. * Purpose:
  5584. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  5585. * specify which rate was used.
  5586. * Value:
  5587. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  5588. * flag.
  5589. * If LEGACY_RATE_SEL is 0:
  5590. * 0x8: OFDM 48 Mbps
  5591. * 0x9: OFDM 24 Mbps
  5592. * 0xA: OFDM 12 Mbps
  5593. * 0xB: OFDM 6 Mbps
  5594. * 0xC: OFDM 54 Mbps
  5595. * 0xD: OFDM 36 Mbps
  5596. * 0xE: OFDM 18 Mbps
  5597. * 0xF: OFDM 9 Mbps
  5598. * If LEGACY_RATE_SEL is 1:
  5599. * 0x8: CCK 11 Mbps long preamble
  5600. * 0x9: CCK 5.5 Mbps long preamble
  5601. * 0xA: CCK 2 Mbps long preamble
  5602. * 0xB: CCK 1 Mbps long preamble
  5603. * 0xC: CCK 11 Mbps short preamble
  5604. * 0xD: CCK 5.5 Mbps short preamble
  5605. * 0xE: CCK 2 Mbps short preamble
  5606. * - LEGACY_RATE_SEL
  5607. * Bit 29
  5608. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  5609. * Value:
  5610. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  5611. * used a legacy rate.
  5612. * 0 -> OFDM, 1 -> CCK
  5613. * - END_VALID
  5614. * Bit 30
  5615. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5616. * the start of the PPDU are valid. Specifically, the following
  5617. * fields are only valid if END_VALID is set:
  5618. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  5619. * TIMESTAMP_SUBMICROSEC
  5620. * Value:
  5621. * 0 -> rx PPDU desc end fields are not valid
  5622. * 1 -> rx PPDU desc end fields are valid
  5623. * - START_VALID
  5624. * Bit 31
  5625. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5626. * the end of the PPDU are valid. Specifically, the following
  5627. * fields are only valid if START_VALID is set:
  5628. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  5629. * VHT-SIG-A
  5630. * Value:
  5631. * 0 -> rx PPDU desc start fields are not valid
  5632. * 1 -> rx PPDU desc start fields are valid
  5633. * - RSSI0_PRI20
  5634. * Bits 7:0
  5635. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  5636. * Value: RSSI dB units w.r.t. noise floor
  5637. *
  5638. * - RSSI0_EXT20
  5639. * Bits 7:0
  5640. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  5641. * (if the rx bandwidth was >= 40 MHz)
  5642. * Value: RSSI dB units w.r.t. noise floor
  5643. * - RSSI0_EXT40
  5644. * Bits 7:0
  5645. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  5646. * (if the rx bandwidth was >= 80 MHz)
  5647. * Value: RSSI dB units w.r.t. noise floor
  5648. * - RSSI0_EXT80
  5649. * Bits 7:0
  5650. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  5651. * (if the rx bandwidth was >= 160 MHz)
  5652. * Value: RSSI dB units w.r.t. noise floor
  5653. *
  5654. * - RSSI1_PRI20
  5655. * Bits 7:0
  5656. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  5657. * Value: RSSI dB units w.r.t. noise floor
  5658. * - RSSI1_EXT20
  5659. * Bits 7:0
  5660. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  5661. * (if the rx bandwidth was >= 40 MHz)
  5662. * Value: RSSI dB units w.r.t. noise floor
  5663. * - RSSI1_EXT40
  5664. * Bits 7:0
  5665. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  5666. * (if the rx bandwidth was >= 80 MHz)
  5667. * Value: RSSI dB units w.r.t. noise floor
  5668. * - RSSI1_EXT80
  5669. * Bits 7:0
  5670. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  5671. * (if the rx bandwidth was >= 160 MHz)
  5672. * Value: RSSI dB units w.r.t. noise floor
  5673. *
  5674. * - RSSI2_PRI20
  5675. * Bits 7:0
  5676. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  5677. * Value: RSSI dB units w.r.t. noise floor
  5678. * - RSSI2_EXT20
  5679. * Bits 7:0
  5680. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  5681. * (if the rx bandwidth was >= 40 MHz)
  5682. * Value: RSSI dB units w.r.t. noise floor
  5683. * - RSSI2_EXT40
  5684. * Bits 7:0
  5685. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  5686. * (if the rx bandwidth was >= 80 MHz)
  5687. * Value: RSSI dB units w.r.t. noise floor
  5688. * - RSSI2_EXT80
  5689. * Bits 7:0
  5690. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  5691. * (if the rx bandwidth was >= 160 MHz)
  5692. * Value: RSSI dB units w.r.t. noise floor
  5693. *
  5694. * - RSSI3_PRI20
  5695. * Bits 7:0
  5696. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  5697. * Value: RSSI dB units w.r.t. noise floor
  5698. * - RSSI3_EXT20
  5699. * Bits 7:0
  5700. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  5701. * (if the rx bandwidth was >= 40 MHz)
  5702. * Value: RSSI dB units w.r.t. noise floor
  5703. * - RSSI3_EXT40
  5704. * Bits 7:0
  5705. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  5706. * (if the rx bandwidth was >= 80 MHz)
  5707. * Value: RSSI dB units w.r.t. noise floor
  5708. * - RSSI3_EXT80
  5709. * Bits 7:0
  5710. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  5711. * (if the rx bandwidth was >= 160 MHz)
  5712. * Value: RSSI dB units w.r.t. noise floor
  5713. *
  5714. * - TSF32
  5715. * Bits 31:0
  5716. * Purpose: specify the time the rx PPDU was received, in TSF units
  5717. * Value: 32 LSBs of the TSF
  5718. * - TIMESTAMP_MICROSEC
  5719. * Bits 31:0
  5720. * Purpose: specify the time the rx PPDU was received, in microsecond units
  5721. * Value: PPDU rx time, in microseconds
  5722. * - VHT_SIG_A1
  5723. * Bits 23:0
  5724. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  5725. * from the rx PPDU
  5726. * Value:
  5727. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  5728. * VHT-SIG-A1 data.
  5729. * If PREAMBLE_TYPE specifies HT, then this field contains the
  5730. * first 24 bits of the HT-SIG data.
  5731. * Otherwise, this field is invalid.
  5732. * Refer to the the 802.11 protocol for the definition of the
  5733. * HT-SIG and VHT-SIG-A1 fields
  5734. * - VHT_SIG_A2
  5735. * Bits 23:0
  5736. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  5737. * from the rx PPDU
  5738. * Value:
  5739. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  5740. * VHT-SIG-A2 data.
  5741. * If PREAMBLE_TYPE specifies HT, then this field contains the
  5742. * last 24 bits of the HT-SIG data.
  5743. * Otherwise, this field is invalid.
  5744. * Refer to the the 802.11 protocol for the definition of the
  5745. * HT-SIG and VHT-SIG-A2 fields
  5746. * - PREAMBLE_TYPE
  5747. * Bits 31:24
  5748. * Purpose: indicate the PHY format of the received burst
  5749. * Value:
  5750. * 0x4: Legacy (OFDM/CCK)
  5751. * 0x8: HT
  5752. * 0x9: HT with TxBF
  5753. * 0xC: VHT
  5754. * 0xD: VHT with TxBF
  5755. * - SERVICE
  5756. * Bits 31:24
  5757. * Purpose: TBD
  5758. * Value: TBD
  5759. *
  5760. * Rx MSDU descriptor fields:
  5761. * - FW_RX_DESC_BYTES
  5762. * Bits 15:0
  5763. * Purpose: Indicate how many bytes in the Rx indication are used for
  5764. * FW Rx descriptors
  5765. *
  5766. * Payload fields:
  5767. * - MPDU_COUNT
  5768. * Bits 7:0
  5769. * Purpose: Indicate how many sequential MPDUs share the same status.
  5770. * All MPDUs within the indicated list are from the same RA-TA-TID.
  5771. * - MPDU_STATUS
  5772. * Bits 15:8
  5773. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  5774. * received successfully.
  5775. * Value:
  5776. * 0x1: success
  5777. * 0x2: FCS error
  5778. * 0x3: duplicate error
  5779. * 0x4: replay error
  5780. * 0x5: invalid peer
  5781. */
  5782. /* header fields */
  5783. #define HTT_RX_IND_EXT_TID_M 0x1f00
  5784. #define HTT_RX_IND_EXT_TID_S 8
  5785. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  5786. #define HTT_RX_IND_FLUSH_VALID_S 13
  5787. #define HTT_RX_IND_REL_VALID_M 0x4000
  5788. #define HTT_RX_IND_REL_VALID_S 14
  5789. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  5790. #define HTT_RX_IND_PEER_ID_S 16
  5791. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  5792. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  5793. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  5794. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  5795. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  5796. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  5797. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  5798. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  5799. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  5800. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  5801. /* rx PPDU descriptor fields */
  5802. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  5803. #define HTT_RX_IND_RSSI_CMB_S 0
  5804. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  5805. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  5806. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  5807. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  5808. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  5809. #define HTT_RX_IND_PHY_ERR_S 24
  5810. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  5811. #define HTT_RX_IND_LEGACY_RATE_S 25
  5812. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  5813. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  5814. #define HTT_RX_IND_END_VALID_M 0x40000000
  5815. #define HTT_RX_IND_END_VALID_S 30
  5816. #define HTT_RX_IND_START_VALID_M 0x80000000
  5817. #define HTT_RX_IND_START_VALID_S 31
  5818. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  5819. #define HTT_RX_IND_RSSI_PRI20_S 0
  5820. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  5821. #define HTT_RX_IND_RSSI_EXT20_S 8
  5822. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  5823. #define HTT_RX_IND_RSSI_EXT40_S 16
  5824. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  5825. #define HTT_RX_IND_RSSI_EXT80_S 24
  5826. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  5827. #define HTT_RX_IND_VHT_SIG_A1_S 0
  5828. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  5829. #define HTT_RX_IND_VHT_SIG_A2_S 0
  5830. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  5831. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  5832. #define HTT_RX_IND_SERVICE_M 0xff000000
  5833. #define HTT_RX_IND_SERVICE_S 24
  5834. /* rx MSDU descriptor fields */
  5835. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  5836. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  5837. /* payload fields */
  5838. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  5839. #define HTT_RX_IND_MPDU_COUNT_S 0
  5840. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  5841. #define HTT_RX_IND_MPDU_STATUS_S 8
  5842. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  5843. do { \
  5844. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  5845. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  5846. } while (0)
  5847. #define HTT_RX_IND_EXT_TID_GET(word) \
  5848. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  5849. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  5850. do { \
  5851. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  5852. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  5853. } while (0)
  5854. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  5855. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  5856. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  5857. do { \
  5858. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  5859. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  5860. } while (0)
  5861. #define HTT_RX_IND_REL_VALID_GET(word) \
  5862. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  5863. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  5864. do { \
  5865. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  5866. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  5867. } while (0)
  5868. #define HTT_RX_IND_PEER_ID_GET(word) \
  5869. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  5870. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  5871. do { \
  5872. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  5873. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  5874. } while (0)
  5875. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  5876. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  5877. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  5878. do { \
  5879. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  5880. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  5881. } while (0)
  5882. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  5883. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  5884. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  5885. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  5886. do { \
  5887. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  5888. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  5889. } while (0)
  5890. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  5891. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  5892. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  5893. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  5894. do { \
  5895. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  5896. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  5897. } while (0)
  5898. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  5899. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  5900. HTT_RX_IND_REL_SEQ_NUM_START_S)
  5901. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  5902. do { \
  5903. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  5904. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  5905. } while (0)
  5906. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  5907. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  5908. HTT_RX_IND_REL_SEQ_NUM_END_S)
  5909. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  5910. do { \
  5911. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  5912. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  5913. } while (0)
  5914. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  5915. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  5916. HTT_RX_IND_NUM_MPDU_RANGES_S)
  5917. /* FW rx PPDU descriptor fields */
  5918. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  5919. do { \
  5920. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  5921. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  5922. } while (0)
  5923. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  5924. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  5925. HTT_RX_IND_RSSI_CMB_S)
  5926. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  5927. do { \
  5928. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  5929. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  5930. } while (0)
  5931. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  5932. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  5933. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  5934. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  5935. do { \
  5936. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  5937. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  5938. } while (0)
  5939. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  5940. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  5941. HTT_RX_IND_PHY_ERR_CODE_S)
  5942. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  5943. do { \
  5944. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  5945. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  5946. } while (0)
  5947. #define HTT_RX_IND_PHY_ERR_GET(word) \
  5948. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  5949. HTT_RX_IND_PHY_ERR_S)
  5950. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  5951. do { \
  5952. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  5953. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  5954. } while (0)
  5955. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  5956. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  5957. HTT_RX_IND_LEGACY_RATE_S)
  5958. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  5959. do { \
  5960. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  5961. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  5962. } while (0)
  5963. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  5964. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  5965. HTT_RX_IND_LEGACY_RATE_SEL_S)
  5966. #define HTT_RX_IND_END_VALID_SET(word, value) \
  5967. do { \
  5968. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  5969. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  5970. } while (0)
  5971. #define HTT_RX_IND_END_VALID_GET(word) \
  5972. (((word) & HTT_RX_IND_END_VALID_M) >> \
  5973. HTT_RX_IND_END_VALID_S)
  5974. #define HTT_RX_IND_START_VALID_SET(word, value) \
  5975. do { \
  5976. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  5977. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  5978. } while (0)
  5979. #define HTT_RX_IND_START_VALID_GET(word) \
  5980. (((word) & HTT_RX_IND_START_VALID_M) >> \
  5981. HTT_RX_IND_START_VALID_S)
  5982. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  5983. do { \
  5984. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  5985. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  5986. } while (0)
  5987. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  5988. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  5989. HTT_RX_IND_RSSI_PRI20_S)
  5990. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  5991. do { \
  5992. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  5993. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  5994. } while (0)
  5995. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  5996. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  5997. HTT_RX_IND_RSSI_EXT20_S)
  5998. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  5999. do { \
  6000. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  6001. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  6002. } while (0)
  6003. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  6004. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  6005. HTT_RX_IND_RSSI_EXT40_S)
  6006. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  6007. do { \
  6008. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  6009. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  6010. } while (0)
  6011. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  6012. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  6013. HTT_RX_IND_RSSI_EXT80_S)
  6014. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  6015. do { \
  6016. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  6017. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  6018. } while (0)
  6019. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  6020. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  6021. HTT_RX_IND_VHT_SIG_A1_S)
  6022. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  6023. do { \
  6024. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  6025. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  6026. } while (0)
  6027. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  6028. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  6029. HTT_RX_IND_VHT_SIG_A2_S)
  6030. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  6031. do { \
  6032. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  6033. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  6034. } while (0)
  6035. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  6036. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  6037. HTT_RX_IND_PREAMBLE_TYPE_S)
  6038. #define HTT_RX_IND_SERVICE_SET(word, value) \
  6039. do { \
  6040. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  6041. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  6042. } while (0)
  6043. #define HTT_RX_IND_SERVICE_GET(word) \
  6044. (((word) & HTT_RX_IND_SERVICE_M) >> \
  6045. HTT_RX_IND_SERVICE_S)
  6046. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  6047. do { \
  6048. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  6049. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  6050. } while (0)
  6051. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  6052. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  6053. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  6054. do { \
  6055. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  6056. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  6057. } while (0)
  6058. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  6059. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  6060. #define HTT_RX_IND_HL_BYTES \
  6061. (HTT_RX_IND_HDR_BYTES + \
  6062. 4 /* single FW rx MSDU descriptor, plus padding */ + \
  6063. 4 /* single MPDU range information element */)
  6064. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  6065. /* Could we use one macro entry? */
  6066. #define HTT_WORD_SET(word, field, value) \
  6067. do { \
  6068. HTT_CHECK_SET_VAL(field, value); \
  6069. (word) |= ((value) << field ## _S); \
  6070. } while (0)
  6071. #define HTT_WORD_GET(word, field) \
  6072. (((word) & field ## _M) >> field ## _S)
  6073. PREPACK struct hl_htt_rx_ind_base {
  6074. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  6075. } POSTPACK;
  6076. /*
  6077. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  6078. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  6079. * HL host needed info. The field is just after the msdu fw rx desc.
  6080. */
  6081. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  6082. struct htt_rx_ind_hl_rx_desc_t {
  6083. A_UINT8 ver;
  6084. A_UINT8 len;
  6085. struct {
  6086. A_UINT8
  6087. first_msdu: 1,
  6088. last_msdu: 1,
  6089. c3_failed: 1,
  6090. c4_failed: 1,
  6091. ipv6: 1,
  6092. tcp: 1,
  6093. udp: 1,
  6094. reserved: 1;
  6095. } flags;
  6096. };
  6097. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  6098. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6099. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  6100. #define HTT_RX_IND_HL_RX_DESC_VER 0
  6101. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  6102. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6103. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  6104. #define HTT_RX_IND_HL_FLAG_OFFSET \
  6105. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6106. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  6107. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  6108. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  6109. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  6110. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  6111. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  6112. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  6113. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  6114. /* This structure is used in HL, the basic descriptor information
  6115. * used by host. the structure is translated by FW from HW desc
  6116. * or generated by FW. But in HL monitor mode, the host would use
  6117. * the same structure with LL.
  6118. */
  6119. PREPACK struct hl_htt_rx_desc_base {
  6120. A_UINT32
  6121. seq_num:12,
  6122. encrypted:1,
  6123. chan_info_present:1,
  6124. resv0:2,
  6125. mcast_bcast:1,
  6126. fragment:1,
  6127. key_id_oct:8,
  6128. resv1:6;
  6129. A_UINT32
  6130. pn_31_0;
  6131. union {
  6132. struct {
  6133. A_UINT16 pn_47_32;
  6134. A_UINT16 pn_63_48;
  6135. } pn16;
  6136. A_UINT32 pn_63_32;
  6137. } u0;
  6138. A_UINT32
  6139. pn_95_64;
  6140. A_UINT32
  6141. pn_127_96;
  6142. } POSTPACK;
  6143. /*
  6144. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  6145. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  6146. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  6147. * Please see htt_chan_change_t for description of the fields.
  6148. */
  6149. PREPACK struct htt_chan_info_t
  6150. {
  6151. A_UINT32 primary_chan_center_freq_mhz: 16,
  6152. contig_chan1_center_freq_mhz: 16;
  6153. A_UINT32 contig_chan2_center_freq_mhz: 16,
  6154. phy_mode: 8,
  6155. reserved: 8;
  6156. } POSTPACK;
  6157. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  6158. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  6159. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  6160. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  6161. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  6162. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  6163. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  6164. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  6165. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  6166. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  6167. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  6168. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  6169. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  6170. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  6171. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  6172. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  6173. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  6174. /* Channel information */
  6175. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  6176. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  6177. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  6178. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  6179. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  6180. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  6181. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  6182. #define HTT_CHAN_INFO_PHY_MODE_S 16
  6183. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  6184. do { \
  6185. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  6186. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  6187. } while (0)
  6188. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  6189. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  6190. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  6191. do { \
  6192. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  6193. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  6194. } while (0)
  6195. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  6196. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  6197. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  6198. do { \
  6199. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  6200. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  6201. } while (0)
  6202. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  6203. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  6204. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  6205. do { \
  6206. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  6207. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  6208. } while (0)
  6209. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  6210. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  6211. /*
  6212. * @brief target -> host rx reorder flush message definition
  6213. *
  6214. * @details
  6215. * The following field definitions describe the format of the rx flush
  6216. * message sent from the target to the host.
  6217. * The message consists of a 4-octet header, followed by one or more
  6218. * 4-octet payload information elements.
  6219. *
  6220. * |31 24|23 8|7 0|
  6221. * |--------------------------------------------------------------|
  6222. * | TID | peer ID | msg type |
  6223. * |--------------------------------------------------------------|
  6224. * | seq num end | seq num start | MPDU status | reserved |
  6225. * |--------------------------------------------------------------|
  6226. * First DWORD:
  6227. * - MSG_TYPE
  6228. * Bits 7:0
  6229. * Purpose: identifies this as an rx flush message
  6230. * Value: 0x2
  6231. * - PEER_ID
  6232. * Bits 23:8 (only bits 18:8 actually used)
  6233. * Purpose: identify which peer's rx data is being flushed
  6234. * Value: (rx) peer ID
  6235. * - TID
  6236. * Bits 31:24 (only bits 27:24 actually used)
  6237. * Purpose: Specifies which traffic identifier's rx data is being flushed
  6238. * Value: traffic identifier
  6239. * Second DWORD:
  6240. * - MPDU_STATUS
  6241. * Bits 15:8
  6242. * Purpose:
  6243. * Indicate whether the flushed MPDUs should be discarded or processed.
  6244. * Value:
  6245. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  6246. * stages of rx processing
  6247. * other: discard the MPDUs
  6248. * It is anticipated that flush messages will always have
  6249. * MPDU status == 1, but the status flag is included for
  6250. * flexibility.
  6251. * - SEQ_NUM_START
  6252. * Bits 23:16
  6253. * Purpose:
  6254. * Indicate the start of a series of consecutive MPDUs being flushed.
  6255. * Not all MPDUs within this range are necessarily valid - the host
  6256. * must check each sequence number within this range to see if the
  6257. * corresponding MPDU is actually present.
  6258. * Value:
  6259. * The sequence number for the first MPDU in the sequence.
  6260. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6261. * - SEQ_NUM_END
  6262. * Bits 30:24
  6263. * Purpose:
  6264. * Indicate the end of a series of consecutive MPDUs being flushed.
  6265. * Value:
  6266. * The sequence number one larger than the sequence number of the
  6267. * last MPDU being flushed.
  6268. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6269. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  6270. * are to be released for further rx processing.
  6271. * Not all MPDUs within this range are necessarily valid - the host
  6272. * must check each sequence number within this range to see if the
  6273. * corresponding MPDU is actually present.
  6274. */
  6275. /* first DWORD */
  6276. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  6277. #define HTT_RX_FLUSH_PEER_ID_S 8
  6278. #define HTT_RX_FLUSH_TID_M 0xff000000
  6279. #define HTT_RX_FLUSH_TID_S 24
  6280. /* second DWORD */
  6281. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  6282. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  6283. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  6284. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  6285. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  6286. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  6287. #define HTT_RX_FLUSH_BYTES 8
  6288. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  6289. do { \
  6290. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  6291. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  6292. } while (0)
  6293. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  6294. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  6295. #define HTT_RX_FLUSH_TID_SET(word, value) \
  6296. do { \
  6297. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  6298. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  6299. } while (0)
  6300. #define HTT_RX_FLUSH_TID_GET(word) \
  6301. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  6302. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  6303. do { \
  6304. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  6305. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  6306. } while (0)
  6307. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  6308. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  6309. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  6310. do { \
  6311. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  6312. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  6313. } while (0)
  6314. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  6315. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  6316. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  6317. do { \
  6318. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  6319. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  6320. } while (0)
  6321. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  6322. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  6323. /*
  6324. * @brief target -> host rx pn check indication message
  6325. *
  6326. * @details
  6327. * The following field definitions describe the format of the Rx PN check
  6328. * indication message sent from the target to the host.
  6329. * The message consists of a 4-octet header, followed by the start and
  6330. * end sequence numbers to be released, followed by the PN IEs. Each PN
  6331. * IE is one octet containing the sequence number that failed the PN
  6332. * check.
  6333. *
  6334. * |31 24|23 8|7 0|
  6335. * |--------------------------------------------------------------|
  6336. * | TID | peer ID | msg type |
  6337. * |--------------------------------------------------------------|
  6338. * | Reserved | PN IE count | seq num end | seq num start|
  6339. * |--------------------------------------------------------------|
  6340. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  6341. * |--------------------------------------------------------------|
  6342. * First DWORD:
  6343. * - MSG_TYPE
  6344. * Bits 7:0
  6345. * Purpose: Identifies this as an rx pn check indication message
  6346. * Value: 0x2
  6347. * - PEER_ID
  6348. * Bits 23:8 (only bits 18:8 actually used)
  6349. * Purpose: identify which peer
  6350. * Value: (rx) peer ID
  6351. * - TID
  6352. * Bits 31:24 (only bits 27:24 actually used)
  6353. * Purpose: identify traffic identifier
  6354. * Value: traffic identifier
  6355. * Second DWORD:
  6356. * - SEQ_NUM_START
  6357. * Bits 7:0
  6358. * Purpose:
  6359. * Indicates the starting sequence number of the MPDU in this
  6360. * series of MPDUs that went though PN check.
  6361. * Value:
  6362. * The sequence number for the first MPDU in the sequence.
  6363. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6364. * - SEQ_NUM_END
  6365. * Bits 15:8
  6366. * Purpose:
  6367. * Indicates the ending sequence number of the MPDU in this
  6368. * series of MPDUs that went though PN check.
  6369. * Value:
  6370. * The sequence number one larger then the sequence number of the last
  6371. * MPDU being flushed.
  6372. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6373. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  6374. * for invalid PN numbers and are ready to be released for further processing.
  6375. * Not all MPDUs within this range are necessarily valid - the host
  6376. * must check each sequence number within this range to see if the
  6377. * corresponding MPDU is actually present.
  6378. * - PN_IE_COUNT
  6379. * Bits 23:16
  6380. * Purpose:
  6381. * Used to determine the variable number of PN information elements in this
  6382. * message
  6383. *
  6384. * PN information elements:
  6385. * - PN_IE_x-
  6386. * Purpose:
  6387. * Each PN information element contains the sequence number of the MPDU that
  6388. * has failed the target PN check.
  6389. * Value:
  6390. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  6391. * that failed the PN check.
  6392. */
  6393. /* first DWORD */
  6394. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  6395. #define HTT_RX_PN_IND_PEER_ID_S 8
  6396. #define HTT_RX_PN_IND_TID_M 0xff000000
  6397. #define HTT_RX_PN_IND_TID_S 24
  6398. /* second DWORD */
  6399. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  6400. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  6401. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  6402. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  6403. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  6404. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  6405. #define HTT_RX_PN_IND_BYTES 8
  6406. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  6407. do { \
  6408. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  6409. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  6410. } while (0)
  6411. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  6412. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  6413. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  6414. do { \
  6415. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  6416. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  6417. } while (0)
  6418. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  6419. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  6420. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  6421. do { \
  6422. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  6423. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  6424. } while (0)
  6425. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  6426. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  6427. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  6428. do { \
  6429. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  6430. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  6431. } while (0)
  6432. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  6433. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  6434. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  6435. do { \
  6436. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  6437. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  6438. } while (0)
  6439. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  6440. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  6441. /*
  6442. * @brief target -> host rx offload deliver message for LL system
  6443. *
  6444. * @details
  6445. * In a low latency system this message is sent whenever the offload
  6446. * manager flushes out the packets it has coalesced in its coalescing buffer.
  6447. * The DMA of the actual packets into host memory is done before sending out
  6448. * this message. This message indicates only how many MSDUs to reap. The
  6449. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  6450. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  6451. * DMA'd by the MAC directly into host memory these packets do not contain
  6452. * the MAC descriptors in the header portion of the packet. Instead they contain
  6453. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  6454. * message, the packets are delivered directly to the NW stack without going
  6455. * through the regular reorder buffering and PN checking path since it has
  6456. * already been done in target.
  6457. *
  6458. * |31 24|23 16|15 8|7 0|
  6459. * |-----------------------------------------------------------------------|
  6460. * | Total MSDU count | reserved | msg type |
  6461. * |-----------------------------------------------------------------------|
  6462. *
  6463. * @brief target -> host rx offload deliver message for HL system
  6464. *
  6465. * @details
  6466. * In a high latency system this message is sent whenever the offload manager
  6467. * flushes out the packets it has coalesced in its coalescing buffer. The
  6468. * actual packets are also carried along with this message. When the host
  6469. * receives this message, it is expected to deliver these packets to the NW
  6470. * stack directly instead of routing them through the reorder buffering and
  6471. * PN checking path since it has already been done in target.
  6472. *
  6473. * |31 24|23 16|15 8|7 0|
  6474. * |-----------------------------------------------------------------------|
  6475. * | Total MSDU count | reserved | msg type |
  6476. * |-----------------------------------------------------------------------|
  6477. * | peer ID | MSDU length |
  6478. * |-----------------------------------------------------------------------|
  6479. * | MSDU payload | FW Desc | tid | vdev ID |
  6480. * |-----------------------------------------------------------------------|
  6481. * | MSDU payload contd. |
  6482. * |-----------------------------------------------------------------------|
  6483. * | peer ID | MSDU length |
  6484. * |-----------------------------------------------------------------------|
  6485. * | MSDU payload | FW Desc | tid | vdev ID |
  6486. * |-----------------------------------------------------------------------|
  6487. * | MSDU payload contd. |
  6488. * |-----------------------------------------------------------------------|
  6489. *
  6490. */
  6491. /* first DWORD */
  6492. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  6493. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  6494. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  6495. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  6496. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  6497. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  6498. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  6499. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  6500. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  6501. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  6502. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  6503. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  6504. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  6505. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  6506. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  6507. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  6508. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  6509. do { \
  6510. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  6511. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  6512. } while (0)
  6513. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  6514. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  6515. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  6516. do { \
  6517. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  6518. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  6519. } while (0)
  6520. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  6521. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  6522. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  6523. do { \
  6524. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  6525. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  6526. } while (0)
  6527. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  6528. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  6529. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  6530. do { \
  6531. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  6532. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  6533. } while (0)
  6534. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  6535. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  6536. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  6537. do { \
  6538. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  6539. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  6540. } while (0)
  6541. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  6542. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  6543. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  6544. do { \
  6545. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  6546. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  6547. } while (0)
  6548. /**
  6549. * @brief target -> host rx peer map/unmap message definition
  6550. *
  6551. * @details
  6552. * The following diagram shows the format of the rx peer map message sent
  6553. * from the target to the host. This layout assumes the target operates
  6554. * as little-endian.
  6555. *
  6556. * This message always contains a SW peer ID. The main purpose of the
  6557. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  6558. * with, so that the host can use that peer ID to determine which peer
  6559. * transmitted the rx frame. This SW peer ID is sometimes also used for
  6560. * other purposes, such as identifying during tx completions which peer
  6561. * the tx frames in question were transmitted to.
  6562. *
  6563. * In certain generations of chips, the peer map message also contains
  6564. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  6565. * to identify which peer the frame needs to be forwarded to (i.e. the
  6566. * peer assocated with the Destination MAC Address within the packet),
  6567. * and particularly which vdev needs to transmit the frame (for cases
  6568. * of inter-vdev rx --> tx forwarding).
  6569. * This DA-based peer ID that is provided for certain rx frames
  6570. * (the rx frames that need to be re-transmitted as tx frames)
  6571. * is the ID that the HW uses for referring to the peer in question,
  6572. * rather than the peer ID that the SW+FW use to refer to the peer.
  6573. *
  6574. *
  6575. * |31 24|23 16|15 8|7 0|
  6576. * |-----------------------------------------------------------------------|
  6577. * | SW peer ID | VDEV ID | msg type |
  6578. * |-----------------------------------------------------------------------|
  6579. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6580. * |-----------------------------------------------------------------------|
  6581. * | HW peer ID | MAC addr 5 | MAC addr 4 |
  6582. * |-----------------------------------------------------------------------|
  6583. *
  6584. *
  6585. * The following diagram shows the format of the rx peer unmap message sent
  6586. * from the target to the host.
  6587. *
  6588. * |31 24|23 16|15 8|7 0|
  6589. * |-----------------------------------------------------------------------|
  6590. * | SW peer ID | VDEV ID | msg type |
  6591. * |-----------------------------------------------------------------------|
  6592. *
  6593. * The following field definitions describe the format of the rx peer map
  6594. * and peer unmap messages sent from the target to the host.
  6595. * - MSG_TYPE
  6596. * Bits 7:0
  6597. * Purpose: identifies this as an rx peer map or peer unmap message
  6598. * Value: peer map -> 0x3, peer unmap -> 0x4
  6599. * - VDEV_ID
  6600. * Bits 15:8
  6601. * Purpose: Indicates which virtual device the peer is associated
  6602. * with.
  6603. * Value: vdev ID (used in the host to look up the vdev object)
  6604. * - PEER_ID (a.k.a. SW_PEER_ID)
  6605. * Bits 31:16
  6606. * Purpose: The peer ID (index) that WAL is allocating (map) or
  6607. * freeing (unmap)
  6608. * Value: (rx) peer ID
  6609. * - MAC_ADDR_L32 (peer map only)
  6610. * Bits 31:0
  6611. * Purpose: Identifies which peer node the peer ID is for.
  6612. * Value: lower 4 bytes of peer node's MAC address
  6613. * - MAC_ADDR_U16 (peer map only)
  6614. * Bits 15:0
  6615. * Purpose: Identifies which peer node the peer ID is for.
  6616. * Value: upper 2 bytes of peer node's MAC address
  6617. * - HW_PEER_ID
  6618. * Bits 31:16
  6619. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  6620. * address, so for rx frames marked for rx --> tx forwarding, the
  6621. * host can determine from the HW peer ID provided as meta-data with
  6622. * the rx frame which peer the frame is supposed to be forwarded to.
  6623. * Value: ID used by the MAC HW to identify the peer
  6624. */
  6625. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  6626. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  6627. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  6628. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  6629. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  6630. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  6631. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  6632. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  6633. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  6634. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  6635. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  6636. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  6637. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  6638. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  6639. do { \
  6640. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  6641. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  6642. } while (0)
  6643. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  6644. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  6645. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  6646. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  6647. do { \
  6648. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  6649. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  6650. } while (0)
  6651. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  6652. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  6653. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  6654. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  6655. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  6656. do { \
  6657. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  6658. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  6659. } while (0)
  6660. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  6661. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  6662. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  6663. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  6664. #define HTT_RX_PEER_MAP_BYTES 12
  6665. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  6666. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  6667. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  6668. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  6669. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  6670. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  6671. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  6672. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  6673. #define HTT_RX_PEER_UNMAP_BYTES 4
  6674. /**
  6675. * @brief target -> host rx peer map V2 message definition
  6676. *
  6677. * @details
  6678. * The following diagram shows the format of the rx peer map v2 message sent
  6679. * from the target to the host. This layout assumes the target operates
  6680. * as little-endian.
  6681. *
  6682. * This message always contains a SW peer ID. The main purpose of the
  6683. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  6684. * with, so that the host can use that peer ID to determine which peer
  6685. * transmitted the rx frame. This SW peer ID is sometimes also used for
  6686. * other purposes, such as identifying during tx completions which peer
  6687. * the tx frames in question were transmitted to.
  6688. *
  6689. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  6690. * is used during rx --> tx frame forwarding to identify which peer the
  6691. * frame needs to be forwarded to (i.e. the peer assocated with the
  6692. * Destination MAC Address within the packet), and particularly which vdev
  6693. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  6694. * This DA-based peer ID that is provided for certain rx frames
  6695. * (the rx frames that need to be re-transmitted as tx frames)
  6696. * is the ID that the HW uses for referring to the peer in question,
  6697. * rather than the peer ID that the SW+FW use to refer to the peer.
  6698. *
  6699. *
  6700. * |31 24|23 16|15 8|7 0|
  6701. * |-----------------------------------------------------------------------|
  6702. * | SW peer ID | VDEV ID | msg type |
  6703. * |-----------------------------------------------------------------------|
  6704. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6705. * |-----------------------------------------------------------------------|
  6706. * | HW peer ID | MAC addr 5 | MAC addr 4 |
  6707. * |-----------------------------------------------------------------------|
  6708. * | Reserved_17_31 | Next Hop | AST Hash Value |
  6709. * |-----------------------------------------------------------------------|
  6710. * | Reserved_0 |
  6711. * |-----------------------------------------------------------------------|
  6712. * | Reserved_1 |
  6713. * |-----------------------------------------------------------------------|
  6714. * | Reserved_2 |
  6715. * |-----------------------------------------------------------------------|
  6716. * | Reserved_3 |
  6717. * |-----------------------------------------------------------------------|
  6718. *
  6719. *
  6720. * The following field definitions describe the format of the rx peer map v2
  6721. * messages sent from the target to the host.
  6722. * - MSG_TYPE
  6723. * Bits 7:0
  6724. * Purpose: identifies this as an rx peer map v2 message
  6725. * Value: peer map v2 -> 0x1e
  6726. * - VDEV_ID
  6727. * Bits 15:8
  6728. * Purpose: Indicates which virtual device the peer is associated with.
  6729. * Value: vdev ID (used in the host to look up the vdev object)
  6730. * - SW_PEER_ID
  6731. * Bits 31:16
  6732. * Purpose: The peer ID (index) that WAL is allocating
  6733. * Value: (rx) peer ID
  6734. * - MAC_ADDR_L32
  6735. * Bits 31:0
  6736. * Purpose: Identifies which peer node the peer ID is for.
  6737. * Value: lower 4 bytes of peer node's MAC address
  6738. * - MAC_ADDR_U16
  6739. * Bits 15:0
  6740. * Purpose: Identifies which peer node the peer ID is for.
  6741. * Value: upper 2 bytes of peer node's MAC address
  6742. * - HW_PEER_ID
  6743. * Bits 31:16
  6744. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  6745. * address, so for rx frames marked for rx --> tx forwarding, the
  6746. * host can determine from the HW peer ID provided as meta-data with
  6747. * the rx frame which peer the frame is supposed to be forwarded to.
  6748. * Value: ID used by the MAC HW to identify the peer
  6749. * - AST_HASH_VALUE
  6750. * Bits 15:0
  6751. * Purpose: Indicates AST Hash value is required for the TCL AST index
  6752. * override feature.
  6753. * - NEXT_HOP
  6754. * Bit 16
  6755. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  6756. * (Wireless Distribution System).
  6757. */
  6758. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  6759. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  6760. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  6761. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  6762. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  6763. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  6764. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  6765. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  6766. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  6767. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  6768. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  6769. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  6770. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  6771. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  6772. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  6773. do { \
  6774. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  6775. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  6776. } while (0)
  6777. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  6778. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  6779. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  6780. do { \
  6781. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  6782. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  6783. } while (0)
  6784. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  6785. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  6786. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  6787. do { \
  6788. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  6789. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  6790. } while (0)
  6791. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  6792. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  6793. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  6794. do { \
  6795. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  6796. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  6797. } while (0)
  6798. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  6799. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  6800. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  6801. do { \
  6802. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  6803. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  6804. } while (0)
  6805. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  6806. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  6807. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  6808. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  6809. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  6810. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  6811. #define HTT_RX_PEER_MAP_V2_BYTES 32
  6812. /**
  6813. * @brief target -> host rx peer unmap V2 message definition
  6814. *
  6815. *
  6816. * The following diagram shows the format of the rx peer unmap message sent
  6817. * from the target to the host.
  6818. *
  6819. * |31 24|23 16|15 8|7 0|
  6820. * |-----------------------------------------------------------------------|
  6821. * | SW peer ID | VDEV ID | msg type |
  6822. * |-----------------------------------------------------------------------|
  6823. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6824. * |-----------------------------------------------------------------------|
  6825. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  6826. * |-----------------------------------------------------------------------|
  6827. * | Peer Delete Duration |
  6828. * |-----------------------------------------------------------------------|
  6829. * | Reserved_0 |
  6830. * |-----------------------------------------------------------------------|
  6831. * | Reserved_1 |
  6832. * |-----------------------------------------------------------------------|
  6833. * | Reserved_2 |
  6834. * |-----------------------------------------------------------------------|
  6835. *
  6836. *
  6837. * The following field definitions describe the format of the rx peer unmap
  6838. * messages sent from the target to the host.
  6839. * - MSG_TYPE
  6840. * Bits 7:0
  6841. * Purpose: identifies this as an rx peer unmap v2 message
  6842. * Value: peer unmap v2 -> 0x1f
  6843. * - VDEV_ID
  6844. * Bits 15:8
  6845. * Purpose: Indicates which virtual device the peer is associated
  6846. * with.
  6847. * Value: vdev ID (used in the host to look up the vdev object)
  6848. * - SW_PEER_ID
  6849. * Bits 31:16
  6850. * Purpose: The peer ID (index) that WAL is freeing
  6851. * Value: (rx) peer ID
  6852. * - MAC_ADDR_L32
  6853. * Bits 31:0
  6854. * Purpose: Identifies which peer node the peer ID is for.
  6855. * Value: lower 4 bytes of peer node's MAC address
  6856. * - MAC_ADDR_U16
  6857. * Bits 15:0
  6858. * Purpose: Identifies which peer node the peer ID is for.
  6859. * Value: upper 2 bytes of peer node's MAC address
  6860. * - NEXT_HOP
  6861. * Bits 16
  6862. * Purpose: Bit indicates next_hop AST entry used for WDS
  6863. * (Wireless Distribution System).
  6864. * - PEER_DELETE_DURATION
  6865. * Bits 31:0
  6866. * Purpose: Time taken to delete peer, in msec,
  6867. * Used for monitoring / debugging PEER delete response delay
  6868. */
  6869. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  6870. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  6871. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  6872. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  6873. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  6874. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  6875. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  6876. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  6877. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  6878. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  6879. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  6880. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  6881. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  6882. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  6883. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  6884. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  6885. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  6886. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  6887. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  6888. do { \
  6889. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  6890. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  6891. } while (0)
  6892. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  6893. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  6894. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  6895. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  6896. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  6897. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  6898. /**
  6899. * @brief target -> host message specifying security parameters
  6900. *
  6901. * @details
  6902. * The following diagram shows the format of the security specification
  6903. * message sent from the target to the host.
  6904. * This security specification message tells the host whether a PN check is
  6905. * necessary on rx data frames, and if so, how large the PN counter is.
  6906. * This message also tells the host about the security processing to apply
  6907. * to defragmented rx frames - specifically, whether a Message Integrity
  6908. * Check is required, and the Michael key to use.
  6909. *
  6910. * |31 24|23 16|15|14 8|7 0|
  6911. * |-----------------------------------------------------------------------|
  6912. * | peer ID | U| security type | msg type |
  6913. * |-----------------------------------------------------------------------|
  6914. * | Michael Key K0 |
  6915. * |-----------------------------------------------------------------------|
  6916. * | Michael Key K1 |
  6917. * |-----------------------------------------------------------------------|
  6918. * | WAPI RSC Low0 |
  6919. * |-----------------------------------------------------------------------|
  6920. * | WAPI RSC Low1 |
  6921. * |-----------------------------------------------------------------------|
  6922. * | WAPI RSC Hi0 |
  6923. * |-----------------------------------------------------------------------|
  6924. * | WAPI RSC Hi1 |
  6925. * |-----------------------------------------------------------------------|
  6926. *
  6927. * The following field definitions describe the format of the security
  6928. * indication message sent from the target to the host.
  6929. * - MSG_TYPE
  6930. * Bits 7:0
  6931. * Purpose: identifies this as a security specification message
  6932. * Value: 0xb
  6933. * - SEC_TYPE
  6934. * Bits 14:8
  6935. * Purpose: specifies which type of security applies to the peer
  6936. * Value: htt_sec_type enum value
  6937. * - UNICAST
  6938. * Bit 15
  6939. * Purpose: whether this security is applied to unicast or multicast data
  6940. * Value: 1 -> unicast, 0 -> multicast
  6941. * - PEER_ID
  6942. * Bits 31:16
  6943. * Purpose: The ID number for the peer the security specification is for
  6944. * Value: peer ID
  6945. * - MICHAEL_KEY_K0
  6946. * Bits 31:0
  6947. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  6948. * Value: Michael Key K0 (if security type is TKIP)
  6949. * - MICHAEL_KEY_K1
  6950. * Bits 31:0
  6951. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  6952. * Value: Michael Key K1 (if security type is TKIP)
  6953. * - WAPI_RSC_LOW0
  6954. * Bits 31:0
  6955. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  6956. * Value: WAPI RSC Low0 (if security type is WAPI)
  6957. * - WAPI_RSC_LOW1
  6958. * Bits 31:0
  6959. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  6960. * Value: WAPI RSC Low1 (if security type is WAPI)
  6961. * - WAPI_RSC_HI0
  6962. * Bits 31:0
  6963. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  6964. * Value: WAPI RSC Hi0 (if security type is WAPI)
  6965. * - WAPI_RSC_HI1
  6966. * Bits 31:0
  6967. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  6968. * Value: WAPI RSC Hi1 (if security type is WAPI)
  6969. */
  6970. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  6971. #define HTT_SEC_IND_SEC_TYPE_S 8
  6972. #define HTT_SEC_IND_UNICAST_M 0x00008000
  6973. #define HTT_SEC_IND_UNICAST_S 15
  6974. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  6975. #define HTT_SEC_IND_PEER_ID_S 16
  6976. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  6977. do { \
  6978. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  6979. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  6980. } while (0)
  6981. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  6982. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  6983. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  6984. do { \
  6985. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  6986. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  6987. } while (0)
  6988. #define HTT_SEC_IND_UNICAST_GET(word) \
  6989. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  6990. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  6991. do { \
  6992. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  6993. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  6994. } while (0)
  6995. #define HTT_SEC_IND_PEER_ID_GET(word) \
  6996. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  6997. #define HTT_SEC_IND_BYTES 28
  6998. /**
  6999. * @brief target -> host rx ADDBA / DELBA message definitions
  7000. *
  7001. * @details
  7002. * The following diagram shows the format of the rx ADDBA message sent
  7003. * from the target to the host:
  7004. *
  7005. * |31 20|19 16|15 8|7 0|
  7006. * |---------------------------------------------------------------------|
  7007. * | peer ID | TID | window size | msg type |
  7008. * |---------------------------------------------------------------------|
  7009. *
  7010. * The following diagram shows the format of the rx DELBA message sent
  7011. * from the target to the host:
  7012. *
  7013. * |31 20|19 16|15 8|7 0|
  7014. * |---------------------------------------------------------------------|
  7015. * | peer ID | TID | reserved | msg type |
  7016. * |---------------------------------------------------------------------|
  7017. *
  7018. * The following field definitions describe the format of the rx ADDBA
  7019. * and DELBA messages sent from the target to the host.
  7020. * - MSG_TYPE
  7021. * Bits 7:0
  7022. * Purpose: identifies this as an rx ADDBA or DELBA message
  7023. * Value: ADDBA -> 0x5, DELBA -> 0x6
  7024. * - WIN_SIZE
  7025. * Bits 15:8 (ADDBA only)
  7026. * Purpose: Specifies the length of the block ack window (max = 64).
  7027. * Value:
  7028. * block ack window length specified by the received ADDBA
  7029. * management message.
  7030. * - TID
  7031. * Bits 19:16
  7032. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  7033. * Value:
  7034. * TID specified by the received ADDBA or DELBA management message.
  7035. * - PEER_ID
  7036. * Bits 31:20
  7037. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  7038. * Value:
  7039. * ID (hash value) used by the host for fast, direct lookup of
  7040. * host SW peer info, including rx reorder states.
  7041. */
  7042. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  7043. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  7044. #define HTT_RX_ADDBA_TID_M 0xf0000
  7045. #define HTT_RX_ADDBA_TID_S 16
  7046. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  7047. #define HTT_RX_ADDBA_PEER_ID_S 20
  7048. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  7049. do { \
  7050. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  7051. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  7052. } while (0)
  7053. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  7054. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  7055. #define HTT_RX_ADDBA_TID_SET(word, value) \
  7056. do { \
  7057. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  7058. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  7059. } while (0)
  7060. #define HTT_RX_ADDBA_TID_GET(word) \
  7061. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  7062. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  7063. do { \
  7064. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  7065. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  7066. } while (0)
  7067. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  7068. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  7069. #define HTT_RX_ADDBA_BYTES 4
  7070. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  7071. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  7072. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  7073. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  7074. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  7075. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  7076. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  7077. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  7078. #define HTT_RX_DELBA_BYTES 4
  7079. /**
  7080. * @brief tx queue group information element definition
  7081. *
  7082. * @details
  7083. * The following diagram shows the format of the tx queue group
  7084. * information element, which can be included in target --> host
  7085. * messages to specify the number of tx "credits" (tx descriptors
  7086. * for LL, or tx buffers for HL) available to a particular group
  7087. * of host-side tx queues, and which host-side tx queues belong to
  7088. * the group.
  7089. *
  7090. * |31|30 24|23 16|15|14|13 0|
  7091. * |------------------------------------------------------------------------|
  7092. * | X| reserved | tx queue grp ID | A| S| credit count |
  7093. * |------------------------------------------------------------------------|
  7094. * | vdev ID mask | AC mask |
  7095. * |------------------------------------------------------------------------|
  7096. *
  7097. * The following definitions describe the fields within the tx queue group
  7098. * information element:
  7099. * - credit_count
  7100. * Bits 13:1
  7101. * Purpose: specify how many tx credits are available to the tx queue group
  7102. * Value: An absolute or relative, positive or negative credit value
  7103. * The 'A' bit specifies whether the value is absolute or relative.
  7104. * The 'S' bit specifies whether the value is positive or negative.
  7105. * A negative value can only be relative, not absolute.
  7106. * An absolute value replaces any prior credit value the host has for
  7107. * the tx queue group in question.
  7108. * A relative value is added to the prior credit value the host has for
  7109. * the tx queue group in question.
  7110. * - sign
  7111. * Bit 14
  7112. * Purpose: specify whether the credit count is positive or negative
  7113. * Value: 0 -> positive, 1 -> negative
  7114. * - absolute
  7115. * Bit 15
  7116. * Purpose: specify whether the credit count is absolute or relative
  7117. * Value: 0 -> relative, 1 -> absolute
  7118. * - txq_group_id
  7119. * Bits 23:16
  7120. * Purpose: indicate which tx queue group's credit and/or membership are
  7121. * being specified
  7122. * Value: 0 to max_tx_queue_groups-1
  7123. * - reserved
  7124. * Bits 30:16
  7125. * Value: 0x0
  7126. * - eXtension
  7127. * Bit 31
  7128. * Purpose: specify whether another tx queue group info element follows
  7129. * Value: 0 -> no more tx queue group information elements
  7130. * 1 -> another tx queue group information element immediately follows
  7131. * - ac_mask
  7132. * Bits 15:0
  7133. * Purpose: specify which Access Categories belong to the tx queue group
  7134. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  7135. * the tx queue group.
  7136. * The AC bit-mask values are obtained by left-shifting by the
  7137. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  7138. * - vdev_id_mask
  7139. * Bits 31:16
  7140. * Purpose: specify which vdev's tx queues belong to the tx queue group
  7141. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  7142. * belong to the tx queue group.
  7143. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  7144. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  7145. */
  7146. PREPACK struct htt_txq_group {
  7147. A_UINT32
  7148. credit_count: 14,
  7149. sign: 1,
  7150. absolute: 1,
  7151. tx_queue_group_id: 8,
  7152. reserved0: 7,
  7153. extension: 1;
  7154. A_UINT32
  7155. ac_mask: 16,
  7156. vdev_id_mask: 16;
  7157. } POSTPACK;
  7158. /* first word */
  7159. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  7160. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  7161. #define HTT_TXQ_GROUP_SIGN_S 14
  7162. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  7163. #define HTT_TXQ_GROUP_ABS_S 15
  7164. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  7165. #define HTT_TXQ_GROUP_ID_S 16
  7166. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  7167. #define HTT_TXQ_GROUP_EXT_S 31
  7168. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  7169. /* second word */
  7170. #define HTT_TXQ_GROUP_AC_MASK_S 0
  7171. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  7172. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  7173. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  7174. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  7175. do { \
  7176. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  7177. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  7178. } while (0)
  7179. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  7180. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  7181. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  7182. do { \
  7183. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  7184. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  7185. } while (0)
  7186. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  7187. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  7188. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  7189. do { \
  7190. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  7191. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  7192. } while (0)
  7193. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  7194. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  7195. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  7196. do { \
  7197. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  7198. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  7199. } while (0)
  7200. #define HTT_TXQ_GROUP_ID_GET(_info) \
  7201. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  7202. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  7203. do { \
  7204. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  7205. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  7206. } while (0)
  7207. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  7208. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  7209. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  7210. do { \
  7211. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  7212. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  7213. } while (0)
  7214. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  7215. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  7216. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  7217. do { \
  7218. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  7219. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  7220. } while (0)
  7221. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  7222. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  7223. /**
  7224. * @brief target -> host TX completion indication message definition
  7225. *
  7226. * @details
  7227. * The following diagram shows the format of the TX completion indication sent
  7228. * from the target to the host
  7229. *
  7230. * |31 27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  7231. * |------------------------------------------------------------|
  7232. * header: | rsvd |TP|A1|A0| num | t_i| tid |status| msg_type |
  7233. * |------------------------------------------------------------|
  7234. * payload: | MSDU1 ID | MSDU0 ID |
  7235. * |------------------------------------------------------------|
  7236. * : MSDU3 ID : MSDU2 ID :
  7237. * |------------------------------------------------------------|
  7238. * | struct htt_tx_compl_ind_append_retries |
  7239. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7240. * | struct htt_tx_compl_ind_append_tx_tstamp |
  7241. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7242. * Where:
  7243. * A0 = append (a.k.a. append0)
  7244. * A1 = append1
  7245. * TP = MSDU tx power presence
  7246. *
  7247. * The following field definitions describe the format of the TX completion
  7248. * indication sent from the target to the host
  7249. * Header fields:
  7250. * - msg_type
  7251. * Bits 7:0
  7252. * Purpose: identifies this as HTT TX completion indication
  7253. * Value: 0x7
  7254. * - status
  7255. * Bits 10:8
  7256. * Purpose: the TX completion status of payload fragmentations descriptors
  7257. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  7258. * - tid
  7259. * Bits 14:11
  7260. * Purpose: the tid associated with those fragmentation descriptors. It is
  7261. * valid or not, depending on the tid_invalid bit.
  7262. * Value: 0 to 15
  7263. * - tid_invalid
  7264. * Bits 15:15
  7265. * Purpose: this bit indicates whether the tid field is valid or not
  7266. * Value: 0 indicates valid; 1 indicates invalid
  7267. * - num
  7268. * Bits 23:16
  7269. * Purpose: the number of payload in this indication
  7270. * Value: 1 to 255
  7271. * - append (a.k.a. append0)
  7272. * Bits 24:24
  7273. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  7274. * the number of tx retries for one MSDU at the end of this message
  7275. * Value: 0 indicates no appending; 1 indicates appending
  7276. * - append1
  7277. * Bits 25:25
  7278. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  7279. * contains the timestamp info for each TX msdu id in payload.
  7280. * The order of the timestamps matches the order of the MSDU IDs.
  7281. * Note that a big-endian host needs to account for the reordering
  7282. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  7283. * conversion) when determining which tx timestamp corresponds to
  7284. * which MSDU ID.
  7285. * Value: 0 indicates no appending; 1 indicates appending
  7286. * - msdu_tx_power_presence
  7287. * Bits 26:26
  7288. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  7289. * for each MSDU referenced by the TX_COMPL_IND message.
  7290. * The tx power is reported in 0.5 dBm units.
  7291. * The order of the per-MSDU tx power reports matches the order
  7292. * of the MSDU IDs.
  7293. * Note that a big-endian host needs to account for the reordering
  7294. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  7295. * conversion) when determining which Tx Power corresponds to
  7296. * which MSDU ID.
  7297. * Value: 0 indicates MSDU tx power reports are not appended,
  7298. * 1 indicates MSDU tx power reports are appended
  7299. * Payload fields:
  7300. * - hmsdu_id
  7301. * Bits 15:0
  7302. * Purpose: this ID is used to track the Tx buffer in host
  7303. * Value: 0 to "size of host MSDU descriptor pool - 1"
  7304. */
  7305. #define HTT_TX_COMPL_IND_STATUS_S 8
  7306. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  7307. #define HTT_TX_COMPL_IND_TID_S 11
  7308. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  7309. #define HTT_TX_COMPL_IND_TID_INV_S 15
  7310. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  7311. #define HTT_TX_COMPL_IND_NUM_S 16
  7312. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  7313. #define HTT_TX_COMPL_IND_APPEND_S 24
  7314. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  7315. #define HTT_TX_COMPL_IND_APPEND1_S 25
  7316. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  7317. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  7318. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  7319. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  7320. do { \
  7321. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  7322. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  7323. } while (0)
  7324. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  7325. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  7326. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  7327. do { \
  7328. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  7329. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  7330. } while (0)
  7331. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  7332. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  7333. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  7334. do { \
  7335. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  7336. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  7337. } while (0)
  7338. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  7339. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  7340. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  7341. do { \
  7342. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  7343. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  7344. } while (0)
  7345. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  7346. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  7347. HTT_TX_COMPL_IND_TID_INV_S)
  7348. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  7349. do { \
  7350. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  7351. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  7352. } while (0)
  7353. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  7354. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  7355. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  7356. do { \
  7357. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  7358. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  7359. } while (0)
  7360. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  7361. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  7362. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  7363. do { \
  7364. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  7365. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  7366. } while (0)
  7367. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  7368. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  7369. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  7370. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  7371. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  7372. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  7373. #define HTT_TX_COMPL_IND_STAT_OK 0
  7374. /* DISCARD:
  7375. * current meaning:
  7376. * MSDUs were queued for transmission but filtered by HW or SW
  7377. * without any over the air attempts
  7378. * legacy meaning (HL Rome):
  7379. * MSDUs were discarded by the target FW without any over the air
  7380. * attempts due to lack of space
  7381. */
  7382. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  7383. /* NO_ACK:
  7384. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  7385. */
  7386. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  7387. /* POSTPONE:
  7388. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  7389. * be downloaded again later (in the appropriate order), when they are
  7390. * deliverable.
  7391. */
  7392. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  7393. /*
  7394. * The PEER_DEL tx completion status is used for HL cases
  7395. * where the peer the frame is for has been deleted.
  7396. * The host has already discarded its copy of the frame, but
  7397. * it still needs the tx completion to restore its credit.
  7398. */
  7399. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  7400. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  7401. #define HTT_TX_COMPL_IND_STAT_DROP 5
  7402. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  7403. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  7404. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  7405. PREPACK struct htt_tx_compl_ind_base {
  7406. A_UINT32 hdr;
  7407. A_UINT16 payload[1/*or more*/];
  7408. } POSTPACK;
  7409. PREPACK struct htt_tx_compl_ind_append_retries {
  7410. A_UINT16 msdu_id;
  7411. A_UINT8 tx_retries;
  7412. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  7413. 0: this is the last append_retries struct */
  7414. } POSTPACK;
  7415. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  7416. A_UINT32 timestamp[1/*or more*/];
  7417. } POSTPACK;
  7418. /**
  7419. * @brief target -> host rate-control update indication message
  7420. *
  7421. * @details
  7422. * The following diagram shows the format of the RC Update message
  7423. * sent from the target to the host, while processing the tx-completion
  7424. * of a transmitted PPDU.
  7425. *
  7426. * |31 24|23 16|15 8|7 0|
  7427. * |-------------------------------------------------------------|
  7428. * | peer ID | vdev ID | msg_type |
  7429. * |-------------------------------------------------------------|
  7430. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  7431. * |-------------------------------------------------------------|
  7432. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  7433. * |-------------------------------------------------------------|
  7434. * | : |
  7435. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  7436. * | : |
  7437. * |-------------------------------------------------------------|
  7438. * | : |
  7439. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  7440. * | : |
  7441. * |-------------------------------------------------------------|
  7442. * : :
  7443. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  7444. *
  7445. */
  7446. typedef struct {
  7447. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  7448. A_UINT32 rate_code_flags;
  7449. A_UINT32 flags; /* Encodes information such as excessive
  7450. retransmission, aggregate, some info
  7451. from .11 frame control,
  7452. STBC, LDPC, (SGI and Tx Chain Mask
  7453. are encoded in ptx_rc->flags field),
  7454. AMPDU truncation (BT/time based etc.),
  7455. RTS/CTS attempt */
  7456. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  7457. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  7458. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  7459. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  7460. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  7461. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  7462. } HTT_RC_TX_DONE_PARAMS;
  7463. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  7464. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  7465. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  7466. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  7467. #define HTT_RC_UPDATE_VDEVID_S 8
  7468. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  7469. #define HTT_RC_UPDATE_PEERID_S 16
  7470. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  7471. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  7472. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  7473. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  7474. do { \
  7475. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  7476. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  7477. } while (0)
  7478. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  7479. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  7480. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  7481. do { \
  7482. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  7483. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  7484. } while (0)
  7485. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  7486. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  7487. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  7488. do { \
  7489. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  7490. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  7491. } while (0)
  7492. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  7493. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  7494. /**
  7495. * @brief target -> host rx fragment indication message definition
  7496. *
  7497. * @details
  7498. * The following field definitions describe the format of the rx fragment
  7499. * indication message sent from the target to the host.
  7500. * The rx fragment indication message shares the format of the
  7501. * rx indication message, but not all fields from the rx indication message
  7502. * are relevant to the rx fragment indication message.
  7503. *
  7504. *
  7505. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  7506. * |-----------+-------------------+---------------------+-------------|
  7507. * | peer ID | |FV| ext TID | msg type |
  7508. * |-------------------------------------------------------------------|
  7509. * | | flush | flush |
  7510. * | | end | start |
  7511. * | | seq num | seq num |
  7512. * |-------------------------------------------------------------------|
  7513. * | reserved | FW rx desc bytes |
  7514. * |-------------------------------------------------------------------|
  7515. * | | FW MSDU Rx |
  7516. * | | desc B0 |
  7517. * |-------------------------------------------------------------------|
  7518. * Header fields:
  7519. * - MSG_TYPE
  7520. * Bits 7:0
  7521. * Purpose: identifies this as an rx fragment indication message
  7522. * Value: 0xa
  7523. * - EXT_TID
  7524. * Bits 12:8
  7525. * Purpose: identify the traffic ID of the rx data, including
  7526. * special "extended" TID values for multicast, broadcast, and
  7527. * non-QoS data frames
  7528. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  7529. * - FLUSH_VALID (FV)
  7530. * Bit 13
  7531. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  7532. * is valid
  7533. * Value:
  7534. * 1 -> flush IE is valid and needs to be processed
  7535. * 0 -> flush IE is not valid and should be ignored
  7536. * - PEER_ID
  7537. * Bits 31:16
  7538. * Purpose: Identify, by ID, which peer sent the rx data
  7539. * Value: ID of the peer who sent the rx data
  7540. * - FLUSH_SEQ_NUM_START
  7541. * Bits 5:0
  7542. * Purpose: Indicate the start of a series of MPDUs to flush
  7543. * Not all MPDUs within this series are necessarily valid - the host
  7544. * must check each sequence number within this range to see if the
  7545. * corresponding MPDU is actually present.
  7546. * This field is only valid if the FV bit is set.
  7547. * Value:
  7548. * The sequence number for the first MPDUs to check to flush.
  7549. * The sequence number is masked by 0x3f.
  7550. * - FLUSH_SEQ_NUM_END
  7551. * Bits 11:6
  7552. * Purpose: Indicate the end of a series of MPDUs to flush
  7553. * Value:
  7554. * The sequence number one larger than the sequence number of the
  7555. * last MPDU to check to flush.
  7556. * The sequence number is masked by 0x3f.
  7557. * Not all MPDUs within this series are necessarily valid - the host
  7558. * must check each sequence number within this range to see if the
  7559. * corresponding MPDU is actually present.
  7560. * This field is only valid if the FV bit is set.
  7561. * Rx descriptor fields:
  7562. * - FW_RX_DESC_BYTES
  7563. * Bits 15:0
  7564. * Purpose: Indicate how many bytes in the Rx indication are used for
  7565. * FW Rx descriptors
  7566. * Value: 1
  7567. */
  7568. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  7569. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  7570. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  7571. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  7572. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  7573. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  7574. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  7575. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  7576. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  7577. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  7578. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  7579. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  7580. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  7581. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  7582. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  7583. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  7584. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  7585. #define HTT_RX_FRAG_IND_BYTES \
  7586. (4 /* msg hdr */ + \
  7587. 4 /* flush spec */ + \
  7588. 4 /* (unused) FW rx desc bytes spec */ + \
  7589. 4 /* FW rx desc */)
  7590. /**
  7591. * @brief target -> host test message definition
  7592. *
  7593. * @details
  7594. * The following field definitions describe the format of the test
  7595. * message sent from the target to the host.
  7596. * The message consists of a 4-octet header, followed by a variable
  7597. * number of 32-bit integer values, followed by a variable number
  7598. * of 8-bit character values.
  7599. *
  7600. * |31 16|15 8|7 0|
  7601. * |-----------------------------------------------------------|
  7602. * | num chars | num ints | msg type |
  7603. * |-----------------------------------------------------------|
  7604. * | int 0 |
  7605. * |-----------------------------------------------------------|
  7606. * | int 1 |
  7607. * |-----------------------------------------------------------|
  7608. * | ... |
  7609. * |-----------------------------------------------------------|
  7610. * | char 3 | char 2 | char 1 | char 0 |
  7611. * |-----------------------------------------------------------|
  7612. * | | | ... | char 4 |
  7613. * |-----------------------------------------------------------|
  7614. * - MSG_TYPE
  7615. * Bits 7:0
  7616. * Purpose: identifies this as a test message
  7617. * Value: HTT_MSG_TYPE_TEST
  7618. * - NUM_INTS
  7619. * Bits 15:8
  7620. * Purpose: indicate how many 32-bit integers follow the message header
  7621. * - NUM_CHARS
  7622. * Bits 31:16
  7623. * Purpose: indicate how many 8-bit charaters follow the series of integers
  7624. */
  7625. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  7626. #define HTT_RX_TEST_NUM_INTS_S 8
  7627. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  7628. #define HTT_RX_TEST_NUM_CHARS_S 16
  7629. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  7630. do { \
  7631. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  7632. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  7633. } while (0)
  7634. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  7635. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  7636. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  7637. do { \
  7638. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  7639. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  7640. } while (0)
  7641. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  7642. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  7643. /**
  7644. * @brief target -> host packet log message
  7645. *
  7646. * @details
  7647. * The following field definitions describe the format of the packet log
  7648. * message sent from the target to the host.
  7649. * The message consists of a 4-octet header,followed by a variable number
  7650. * of 32-bit character values.
  7651. *
  7652. * |31 16|15 12|11 10|9 8|7 0|
  7653. * |------------------------------------------------------------------|
  7654. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  7655. * |------------------------------------------------------------------|
  7656. * | payload |
  7657. * |------------------------------------------------------------------|
  7658. * - MSG_TYPE
  7659. * Bits 7:0
  7660. * Purpose: identifies this as a pktlog message
  7661. * Value: HTT_T2H_MSG_TYPE_PKTLOG
  7662. * - mac_id
  7663. * Bits 9:8
  7664. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  7665. * Value: 0-3
  7666. * - pdev_id
  7667. * Bits 11:10
  7668. * Purpose: pdev_id
  7669. * Value: 0-3
  7670. * 0 (for rings at SOC level),
  7671. * 1/2/3 PDEV -> 0/1/2
  7672. * - payload_size
  7673. * Bits 31:16
  7674. * Purpose: explicitly specify the payload size
  7675. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  7676. */
  7677. PREPACK struct htt_pktlog_msg {
  7678. A_UINT32 header;
  7679. A_UINT32 payload[1/* or more */];
  7680. } POSTPACK;
  7681. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  7682. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  7683. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  7684. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  7685. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  7686. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  7687. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  7688. do { \
  7689. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  7690. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  7691. } while (0)
  7692. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  7693. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  7694. HTT_T2H_PKTLOG_MAC_ID_S)
  7695. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  7696. do { \
  7697. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  7698. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  7699. } while (0)
  7700. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  7701. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  7702. HTT_T2H_PKTLOG_PDEV_ID_S)
  7703. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  7704. do { \
  7705. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  7706. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  7707. } while (0)
  7708. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  7709. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  7710. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  7711. /*
  7712. * Rx reorder statistics
  7713. * NB: all the fields must be defined in 4 octets size.
  7714. */
  7715. struct rx_reorder_stats {
  7716. /* Non QoS MPDUs received */
  7717. A_UINT32 deliver_non_qos;
  7718. /* MPDUs received in-order */
  7719. A_UINT32 deliver_in_order;
  7720. /* Flush due to reorder timer expired */
  7721. A_UINT32 deliver_flush_timeout;
  7722. /* Flush due to move out of window */
  7723. A_UINT32 deliver_flush_oow;
  7724. /* Flush due to DELBA */
  7725. A_UINT32 deliver_flush_delba;
  7726. /* MPDUs dropped due to FCS error */
  7727. A_UINT32 fcs_error;
  7728. /* MPDUs dropped due to monitor mode non-data packet */
  7729. A_UINT32 mgmt_ctrl;
  7730. /* Unicast-data MPDUs dropped due to invalid peer */
  7731. A_UINT32 invalid_peer;
  7732. /* MPDUs dropped due to duplication (non aggregation) */
  7733. A_UINT32 dup_non_aggr;
  7734. /* MPDUs dropped due to processed before */
  7735. A_UINT32 dup_past;
  7736. /* MPDUs dropped due to duplicate in reorder queue */
  7737. A_UINT32 dup_in_reorder;
  7738. /* Reorder timeout happened */
  7739. A_UINT32 reorder_timeout;
  7740. /* invalid bar ssn */
  7741. A_UINT32 invalid_bar_ssn;
  7742. /* reorder reset due to bar ssn */
  7743. A_UINT32 ssn_reset;
  7744. /* Flush due to delete peer */
  7745. A_UINT32 deliver_flush_delpeer;
  7746. /* Flush due to offload*/
  7747. A_UINT32 deliver_flush_offload;
  7748. /* Flush due to out of buffer*/
  7749. A_UINT32 deliver_flush_oob;
  7750. /* MPDUs dropped due to PN check fail */
  7751. A_UINT32 pn_fail;
  7752. /* MPDUs dropped due to unable to allocate memory */
  7753. A_UINT32 store_fail;
  7754. /* Number of times the tid pool alloc succeeded */
  7755. A_UINT32 tid_pool_alloc_succ;
  7756. /* Number of times the MPDU pool alloc succeeded */
  7757. A_UINT32 mpdu_pool_alloc_succ;
  7758. /* Number of times the MSDU pool alloc succeeded */
  7759. A_UINT32 msdu_pool_alloc_succ;
  7760. /* Number of times the tid pool alloc failed */
  7761. A_UINT32 tid_pool_alloc_fail;
  7762. /* Number of times the MPDU pool alloc failed */
  7763. A_UINT32 mpdu_pool_alloc_fail;
  7764. /* Number of times the MSDU pool alloc failed */
  7765. A_UINT32 msdu_pool_alloc_fail;
  7766. /* Number of times the tid pool freed */
  7767. A_UINT32 tid_pool_free;
  7768. /* Number of times the MPDU pool freed */
  7769. A_UINT32 mpdu_pool_free;
  7770. /* Number of times the MSDU pool freed */
  7771. A_UINT32 msdu_pool_free;
  7772. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  7773. A_UINT32 msdu_queued;
  7774. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  7775. A_UINT32 msdu_recycled;
  7776. /* Number of MPDUs with invalid peer but A2 found in AST */
  7777. A_UINT32 invalid_peer_a2_in_ast;
  7778. /* Number of MPDUs with invalid peer but A3 found in AST */
  7779. A_UINT32 invalid_peer_a3_in_ast;
  7780. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  7781. A_UINT32 invalid_peer_bmc_mpdus;
  7782. /* Number of MSDUs with err attention word */
  7783. A_UINT32 rxdesc_err_att;
  7784. /* Number of MSDUs with flag of peer_idx_invalid */
  7785. A_UINT32 rxdesc_err_peer_idx_inv;
  7786. /* Number of MSDUs with flag of peer_idx_timeout */
  7787. A_UINT32 rxdesc_err_peer_idx_to;
  7788. /* Number of MSDUs with flag of overflow */
  7789. A_UINT32 rxdesc_err_ov;
  7790. /* Number of MSDUs with flag of msdu_length_err */
  7791. A_UINT32 rxdesc_err_msdu_len;
  7792. /* Number of MSDUs with flag of mpdu_length_err */
  7793. A_UINT32 rxdesc_err_mpdu_len;
  7794. /* Number of MSDUs with flag of tkip_mic_err */
  7795. A_UINT32 rxdesc_err_tkip_mic;
  7796. /* Number of MSDUs with flag of decrypt_err */
  7797. A_UINT32 rxdesc_err_decrypt;
  7798. /* Number of MSDUs with flag of fcs_err */
  7799. A_UINT32 rxdesc_err_fcs;
  7800. /* Number of Unicast (bc_mc bit is not set in attention word)
  7801. * frames with invalid peer handler
  7802. */
  7803. A_UINT32 rxdesc_uc_msdus_inv_peer;
  7804. /* Number of unicast frame directly (direct bit is set in attention word)
  7805. * to DUT with invalid peer handler
  7806. */
  7807. A_UINT32 rxdesc_direct_msdus_inv_peer;
  7808. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  7809. * frames with invalid peer handler
  7810. */
  7811. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  7812. /* Number of MSDUs dropped due to no first MSDU flag */
  7813. A_UINT32 rxdesc_no_1st_msdu;
  7814. /* Number of MSDUs droped due to ring overflow */
  7815. A_UINT32 msdu_drop_ring_ov;
  7816. /* Number of MSDUs dropped due to FC mismatch */
  7817. A_UINT32 msdu_drop_fc_mismatch;
  7818. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  7819. A_UINT32 msdu_drop_mgmt_remote_ring;
  7820. /* Number of MSDUs dropped due to errors not reported in attention word */
  7821. A_UINT32 msdu_drop_misc;
  7822. /* Number of MSDUs go to offload before reorder */
  7823. A_UINT32 offload_msdu_wal;
  7824. /* Number of data frame dropped by offload after reorder */
  7825. A_UINT32 offload_msdu_reorder;
  7826. /* Number of MPDUs with sequence number in the past and within the BA window */
  7827. A_UINT32 dup_past_within_window;
  7828. /* Number of MPDUs with sequence number in the past and outside the BA window */
  7829. A_UINT32 dup_past_outside_window;
  7830. /* Number of MSDUs with decrypt/MIC error */
  7831. A_UINT32 rxdesc_err_decrypt_mic;
  7832. /* Number of data MSDUs received on both local and remote rings */
  7833. A_UINT32 data_msdus_on_both_rings;
  7834. /* MPDUs never filled */
  7835. A_UINT32 holes_not_filled;
  7836. };
  7837. /*
  7838. * Rx Remote buffer statistics
  7839. * NB: all the fields must be defined in 4 octets size.
  7840. */
  7841. struct rx_remote_buffer_mgmt_stats {
  7842. /* Total number of MSDUs reaped for Rx processing */
  7843. A_UINT32 remote_reaped;
  7844. /* MSDUs recycled within firmware */
  7845. A_UINT32 remote_recycled;
  7846. /* MSDUs stored by Data Rx */
  7847. A_UINT32 data_rx_msdus_stored;
  7848. /* Number of HTT indications from WAL Rx MSDU */
  7849. A_UINT32 wal_rx_ind;
  7850. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  7851. A_UINT32 wal_rx_ind_unconsumed;
  7852. /* Number of HTT indications from Data Rx MSDU */
  7853. A_UINT32 data_rx_ind;
  7854. /* Number of unconsumed HTT indications from Data Rx MSDU */
  7855. A_UINT32 data_rx_ind_unconsumed;
  7856. /* Number of HTT indications from ATHBUF */
  7857. A_UINT32 athbuf_rx_ind;
  7858. /* Number of remote buffers requested for refill */
  7859. A_UINT32 refill_buf_req;
  7860. /* Number of remote buffers filled by the host */
  7861. A_UINT32 refill_buf_rsp;
  7862. /* Number of times MAC hw_index = f/w write_index */
  7863. A_INT32 mac_no_bufs;
  7864. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  7865. A_INT32 fw_indices_equal;
  7866. /* Number of times f/w finds no buffers to post */
  7867. A_INT32 host_no_bufs;
  7868. };
  7869. /*
  7870. * TXBF MU/SU packets and NDPA statistics
  7871. * NB: all the fields must be defined in 4 octets size.
  7872. */
  7873. struct rx_txbf_musu_ndpa_pkts_stats {
  7874. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  7875. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  7876. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  7877. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  7878. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  7879. A_UINT32 reserved[3]; /* must be set to 0x0 */
  7880. };
  7881. /*
  7882. * htt_dbg_stats_status -
  7883. * present - The requested stats have been delivered in full.
  7884. * This indicates that either the stats information was contained
  7885. * in its entirety within this message, or else this message
  7886. * completes the delivery of the requested stats info that was
  7887. * partially delivered through earlier STATS_CONF messages.
  7888. * partial - The requested stats have been delivered in part.
  7889. * One or more subsequent STATS_CONF messages with the same
  7890. * cookie value will be sent to deliver the remainder of the
  7891. * information.
  7892. * error - The requested stats could not be delivered, for example due
  7893. * to a shortage of memory to construct a message holding the
  7894. * requested stats.
  7895. * invalid - The requested stat type is either not recognized, or the
  7896. * target is configured to not gather the stats type in question.
  7897. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  7898. * series_done - This special value indicates that no further stats info
  7899. * elements are present within a series of stats info elems
  7900. * (within a stats upload confirmation message).
  7901. */
  7902. enum htt_dbg_stats_status {
  7903. HTT_DBG_STATS_STATUS_PRESENT = 0,
  7904. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  7905. HTT_DBG_STATS_STATUS_ERROR = 2,
  7906. HTT_DBG_STATS_STATUS_INVALID = 3,
  7907. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  7908. };
  7909. /**
  7910. * @brief target -> host statistics upload
  7911. *
  7912. * @details
  7913. * The following field definitions describe the format of the HTT target
  7914. * to host stats upload confirmation message.
  7915. * The message contains a cookie echoed from the HTT host->target stats
  7916. * upload request, which identifies which request the confirmation is
  7917. * for, and a series of tag-length-value stats information elements.
  7918. * The tag-length header for each stats info element also includes a
  7919. * status field, to indicate whether the request for the stat type in
  7920. * question was fully met, partially met, unable to be met, or invalid
  7921. * (if the stat type in question is disabled in the target).
  7922. * A special value of all 1's in this status field is used to indicate
  7923. * the end of the series of stats info elements.
  7924. *
  7925. *
  7926. * |31 16|15 8|7 5|4 0|
  7927. * |------------------------------------------------------------|
  7928. * | reserved | msg type |
  7929. * |------------------------------------------------------------|
  7930. * | cookie LSBs |
  7931. * |------------------------------------------------------------|
  7932. * | cookie MSBs |
  7933. * |------------------------------------------------------------|
  7934. * | stats entry length | reserved | S |stat type|
  7935. * |------------------------------------------------------------|
  7936. * | |
  7937. * | type-specific stats info |
  7938. * | |
  7939. * |------------------------------------------------------------|
  7940. * | stats entry length | reserved | S |stat type|
  7941. * |------------------------------------------------------------|
  7942. * | |
  7943. * | type-specific stats info |
  7944. * | |
  7945. * |------------------------------------------------------------|
  7946. * | n/a | reserved | 111 | n/a |
  7947. * |------------------------------------------------------------|
  7948. * Header fields:
  7949. * - MSG_TYPE
  7950. * Bits 7:0
  7951. * Purpose: identifies this is a statistics upload confirmation message
  7952. * Value: 0x9
  7953. * - COOKIE_LSBS
  7954. * Bits 31:0
  7955. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7956. * message with its preceding host->target stats request message.
  7957. * Value: LSBs of the opaque cookie specified by the host-side requestor
  7958. * - COOKIE_MSBS
  7959. * Bits 31:0
  7960. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7961. * message with its preceding host->target stats request message.
  7962. * Value: MSBs of the opaque cookie specified by the host-side requestor
  7963. *
  7964. * Stats Information Element tag-length header fields:
  7965. * - STAT_TYPE
  7966. * Bits 4:0
  7967. * Purpose: identifies the type of statistics info held in the
  7968. * following information element
  7969. * Value: htt_dbg_stats_type
  7970. * - STATUS
  7971. * Bits 7:5
  7972. * Purpose: indicate whether the requested stats are present
  7973. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  7974. * the completion of the stats entry series
  7975. * - LENGTH
  7976. * Bits 31:16
  7977. * Purpose: indicate the stats information size
  7978. * Value: This field specifies the number of bytes of stats information
  7979. * that follows the element tag-length header.
  7980. * It is expected but not required that this length is a multiple of
  7981. * 4 bytes. Even if the length is not an integer multiple of 4, the
  7982. * subsequent stats entry header will begin on a 4-byte aligned
  7983. * boundary.
  7984. */
  7985. #define HTT_T2H_STATS_COOKIE_SIZE 8
  7986. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  7987. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  7988. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  7989. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  7990. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  7991. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  7992. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  7993. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  7994. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  7995. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  7996. do { \
  7997. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  7998. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  7999. } while (0)
  8000. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  8001. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  8002. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  8003. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  8004. do { \
  8005. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  8006. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  8007. } while (0)
  8008. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  8009. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  8010. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  8011. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  8012. do { \
  8013. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  8014. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  8015. } while (0)
  8016. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  8017. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  8018. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  8019. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  8020. #define HTT_MAX_AGGR 64
  8021. #define HTT_HL_MAX_AGGR 18
  8022. /**
  8023. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  8024. *
  8025. * @details
  8026. * The following field definitions describe the format of the HTT host
  8027. * to target frag_desc/msdu_ext bank configuration message.
  8028. * The message contains the based address and the min and max id of the
  8029. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  8030. * MSDU_EXT/FRAG_DESC.
  8031. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  8032. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  8033. * the hardware does the mapping/translation.
  8034. *
  8035. * Total banks that can be configured is configured to 16.
  8036. *
  8037. * This should be called before any TX has be initiated by the HTT
  8038. *
  8039. * |31 16|15 8|7 5|4 0|
  8040. * |------------------------------------------------------------|
  8041. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  8042. * |------------------------------------------------------------|
  8043. * | BANK0_BASE_ADDRESS (bits 31:0) |
  8044. #if HTT_PADDR64
  8045. * | BANK0_BASE_ADDRESS (bits 63:32) |
  8046. #endif
  8047. * |------------------------------------------------------------|
  8048. * | ... |
  8049. * |------------------------------------------------------------|
  8050. * | BANK15_BASE_ADDRESS (bits 31:0) |
  8051. #if HTT_PADDR64
  8052. * | BANK15_BASE_ADDRESS (bits 63:32) |
  8053. #endif
  8054. * |------------------------------------------------------------|
  8055. * | BANK0_MAX_ID | BANK0_MIN_ID |
  8056. * |------------------------------------------------------------|
  8057. * | ... |
  8058. * |------------------------------------------------------------|
  8059. * | BANK15_MAX_ID | BANK15_MIN_ID |
  8060. * |------------------------------------------------------------|
  8061. * Header fields:
  8062. * - MSG_TYPE
  8063. * Bits 7:0
  8064. * Value: 0x6
  8065. * for systems with 64-bit format for bus addresses:
  8066. * - BANKx_BASE_ADDRESS_LO
  8067. * Bits 31:0
  8068. * Purpose: Provide a mechanism to specify the base address of the
  8069. * MSDU_EXT bank physical/bus address.
  8070. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  8071. * - BANKx_BASE_ADDRESS_HI
  8072. * Bits 31:0
  8073. * Purpose: Provide a mechanism to specify the base address of the
  8074. * MSDU_EXT bank physical/bus address.
  8075. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  8076. * for systems with 32-bit format for bus addresses:
  8077. * - BANKx_BASE_ADDRESS
  8078. * Bits 31:0
  8079. * Purpose: Provide a mechanism to specify the base address of the
  8080. * MSDU_EXT bank physical/bus address.
  8081. * Value: MSDU_EXT bank physical / bus address
  8082. * - BANKx_MIN_ID
  8083. * Bits 15:0
  8084. * Purpose: Provide a mechanism to specify the min index that needs to
  8085. * mapped.
  8086. * - BANKx_MAX_ID
  8087. * Bits 31:16
  8088. * Purpose: Provide a mechanism to specify the max index that needs to
  8089. * mapped.
  8090. *
  8091. */
  8092. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  8093. * safe value.
  8094. * @note MAX supported banks is 16.
  8095. */
  8096. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  8097. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  8098. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  8099. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  8100. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  8101. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  8102. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  8103. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  8104. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  8105. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  8106. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  8107. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  8108. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  8109. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  8110. do { \
  8111. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  8112. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  8113. } while (0)
  8114. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  8115. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  8116. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  8117. do { \
  8118. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  8119. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  8120. } while (0)
  8121. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  8122. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  8123. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  8124. do { \
  8125. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  8126. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  8127. } while (0)
  8128. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  8129. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  8130. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  8131. do { \
  8132. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  8133. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  8134. } while (0)
  8135. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  8136. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  8137. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  8138. do { \
  8139. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  8140. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  8141. } while (0)
  8142. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  8143. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  8144. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  8145. do { \
  8146. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  8147. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  8148. } while (0)
  8149. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  8150. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  8151. /*
  8152. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  8153. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  8154. * addresses are stored in a XXX-bit field.
  8155. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  8156. * htt_tx_frag_desc64_bank_cfg_t structs.
  8157. */
  8158. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  8159. _paddr_bits_, \
  8160. _paddr__bank_base_address_) \
  8161. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  8162. /** word 0 \
  8163. * msg_type: 8, \
  8164. * pdev_id: 2, \
  8165. * swap: 1, \
  8166. * reserved0: 5, \
  8167. * num_banks: 8, \
  8168. * desc_size: 8; \
  8169. */ \
  8170. A_UINT32 word0; \
  8171. /* \
  8172. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  8173. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  8174. * the second A_UINT32). \
  8175. */ \
  8176. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  8177. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  8178. } POSTPACK
  8179. /* define htt_tx_frag_desc32_bank_cfg_t */
  8180. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  8181. /* define htt_tx_frag_desc64_bank_cfg_t */
  8182. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  8183. /*
  8184. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  8185. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  8186. */
  8187. #if HTT_PADDR64
  8188. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  8189. #else
  8190. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  8191. #endif
  8192. /**
  8193. * @brief target -> host HTT TX Credit total count update message definition
  8194. *
  8195. *|31 16|15|14 9| 8 |7 0 |
  8196. *|---------------------+--+----------+-------+----------|
  8197. *|cur htt credit delta | Q| reserved | sign | msg type |
  8198. *|------------------------------------------------------|
  8199. *
  8200. * Header fields:
  8201. * - MSG_TYPE
  8202. * Bits 7:0
  8203. * Purpose: identifies this as a htt tx credit delta update message
  8204. * Value: 0xe
  8205. * - SIGN
  8206. * Bits 8
  8207. * identifies whether credit delta is positive or negative
  8208. * Value:
  8209. * - 0x0: credit delta is positive, rebalance in some buffers
  8210. * - 0x1: credit delta is negative, rebalance out some buffers
  8211. * - reserved
  8212. * Bits 14:9
  8213. * Value: 0x0
  8214. * - TXQ_GRP
  8215. * Bit 15
  8216. * Purpose: indicates whether any tx queue group information elements
  8217. * are appended to the tx credit update message
  8218. * Value: 0 -> no tx queue group information element is present
  8219. * 1 -> a tx queue group information element immediately follows
  8220. * - DELTA_COUNT
  8221. * Bits 31:16
  8222. * Purpose: Specify current htt credit delta absolute count
  8223. */
  8224. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  8225. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  8226. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  8227. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  8228. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  8229. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  8230. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  8231. do { \
  8232. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  8233. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  8234. } while (0)
  8235. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  8236. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  8237. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  8238. do { \
  8239. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  8240. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  8241. } while (0)
  8242. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  8243. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  8244. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  8245. do { \
  8246. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  8247. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  8248. } while (0)
  8249. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  8250. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  8251. #define HTT_TX_CREDIT_MSG_BYTES 4
  8252. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  8253. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  8254. /**
  8255. * @brief HTT WDI_IPA Operation Response Message
  8256. *
  8257. * @details
  8258. * HTT WDI_IPA Operation Response message is sent by target
  8259. * to host confirming suspend or resume operation.
  8260. * |31 24|23 16|15 8|7 0|
  8261. * |----------------+----------------+----------------+----------------|
  8262. * | op_code | Rsvd | msg_type |
  8263. * |-------------------------------------------------------------------|
  8264. * | Rsvd | Response len |
  8265. * |-------------------------------------------------------------------|
  8266. * | |
  8267. * | Response-type specific info |
  8268. * | |
  8269. * | |
  8270. * |-------------------------------------------------------------------|
  8271. * Header fields:
  8272. * - MSG_TYPE
  8273. * Bits 7:0
  8274. * Purpose: Identifies this as WDI_IPA Operation Response message
  8275. * value: = 0x13
  8276. * - OP_CODE
  8277. * Bits 31:16
  8278. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  8279. * value: = enum htt_wdi_ipa_op_code
  8280. * - RSP_LEN
  8281. * Bits 16:0
  8282. * Purpose: length for the response-type specific info
  8283. * value: = length in bytes for response-type specific info
  8284. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  8285. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  8286. */
  8287. PREPACK struct htt_wdi_ipa_op_response_t
  8288. {
  8289. /* DWORD 0: flags and meta-data */
  8290. A_UINT32
  8291. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  8292. reserved1: 8,
  8293. op_code: 16;
  8294. A_UINT32
  8295. rsp_len: 16,
  8296. reserved2: 16;
  8297. } POSTPACK;
  8298. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  8299. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  8300. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  8301. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  8302. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  8303. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  8304. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  8305. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  8306. do { \
  8307. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  8308. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  8309. } while (0)
  8310. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  8311. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  8312. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  8313. do { \
  8314. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  8315. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  8316. } while (0)
  8317. enum htt_phy_mode {
  8318. htt_phy_mode_11a = 0,
  8319. htt_phy_mode_11g = 1,
  8320. htt_phy_mode_11b = 2,
  8321. htt_phy_mode_11g_only = 3,
  8322. htt_phy_mode_11na_ht20 = 4,
  8323. htt_phy_mode_11ng_ht20 = 5,
  8324. htt_phy_mode_11na_ht40 = 6,
  8325. htt_phy_mode_11ng_ht40 = 7,
  8326. htt_phy_mode_11ac_vht20 = 8,
  8327. htt_phy_mode_11ac_vht40 = 9,
  8328. htt_phy_mode_11ac_vht80 = 10,
  8329. htt_phy_mode_11ac_vht20_2g = 11,
  8330. htt_phy_mode_11ac_vht40_2g = 12,
  8331. htt_phy_mode_11ac_vht80_2g = 13,
  8332. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  8333. htt_phy_mode_11ac_vht160 = 15,
  8334. htt_phy_mode_max,
  8335. };
  8336. /**
  8337. * @brief target -> host HTT channel change indication
  8338. * @details
  8339. * Specify when a channel change occurs.
  8340. * This allows the host to precisely determine which rx frames arrived
  8341. * on the old channel and which rx frames arrived on the new channel.
  8342. *
  8343. *|31 |7 0 |
  8344. *|-------------------------------------------+----------|
  8345. *| reserved | msg type |
  8346. *|------------------------------------------------------|
  8347. *| primary_chan_center_freq_mhz |
  8348. *|------------------------------------------------------|
  8349. *| contiguous_chan1_center_freq_mhz |
  8350. *|------------------------------------------------------|
  8351. *| contiguous_chan2_center_freq_mhz |
  8352. *|------------------------------------------------------|
  8353. *| phy_mode |
  8354. *|------------------------------------------------------|
  8355. *
  8356. * Header fields:
  8357. * - MSG_TYPE
  8358. * Bits 7:0
  8359. * Purpose: identifies this as a htt channel change indication message
  8360. * Value: 0x15
  8361. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  8362. * Bits 31:0
  8363. * Purpose: identify the (center of the) new 20 MHz primary channel
  8364. * Value: center frequency of the 20 MHz primary channel, in MHz units
  8365. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  8366. * Bits 31:0
  8367. * Purpose: identify the (center of the) contiguous frequency range
  8368. * comprising the new channel.
  8369. * For example, if the new channel is a 80 MHz channel extending
  8370. * 60 MHz beyond the primary channel, this field would be 30 larger
  8371. * than the primary channel center frequency field.
  8372. * Value: center frequency of the contiguous frequency range comprising
  8373. * the full channel in MHz units
  8374. * (80+80 channels also use the CONTIG_CHAN2 field)
  8375. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  8376. * Bits 31:0
  8377. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  8378. * within a VHT 80+80 channel.
  8379. * This field is only relevant for VHT 80+80 channels.
  8380. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  8381. * channel (arbitrary value for cases besides VHT 80+80)
  8382. * - PHY_MODE
  8383. * Bits 31:0
  8384. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  8385. * and band
  8386. * Value: htt_phy_mode enum value
  8387. */
  8388. PREPACK struct htt_chan_change_t
  8389. {
  8390. /* DWORD 0: flags and meta-data */
  8391. A_UINT32
  8392. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  8393. reserved1: 24;
  8394. A_UINT32 primary_chan_center_freq_mhz;
  8395. A_UINT32 contig_chan1_center_freq_mhz;
  8396. A_UINT32 contig_chan2_center_freq_mhz;
  8397. A_UINT32 phy_mode;
  8398. } POSTPACK;
  8399. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  8400. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  8401. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  8402. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  8403. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  8404. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  8405. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  8406. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  8407. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  8408. do { \
  8409. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  8410. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  8411. } while (0)
  8412. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  8413. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  8414. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  8415. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  8416. do { \
  8417. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  8418. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  8419. } while (0)
  8420. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  8421. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  8422. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  8423. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  8424. do { \
  8425. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  8426. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  8427. } while (0)
  8428. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  8429. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  8430. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  8431. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  8432. do { \
  8433. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  8434. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  8435. } while (0)
  8436. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  8437. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  8438. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  8439. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  8440. /**
  8441. * @brief rx offload packet error message
  8442. *
  8443. * @details
  8444. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  8445. * of target payload like mic err.
  8446. *
  8447. * |31 24|23 16|15 8|7 0|
  8448. * |----------------+----------------+----------------+----------------|
  8449. * | tid | vdev_id | msg_sub_type | msg_type |
  8450. * |-------------------------------------------------------------------|
  8451. * : (sub-type dependent content) :
  8452. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  8453. * Header fields:
  8454. * - msg_type
  8455. * Bits 7:0
  8456. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  8457. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  8458. * - msg_sub_type
  8459. * Bits 15:8
  8460. * Purpose: Identifies which type of rx error is reported by this message
  8461. * value: htt_rx_ofld_pkt_err_type
  8462. * - vdev_id
  8463. * Bits 23:16
  8464. * Purpose: Identifies which vdev received the erroneous rx frame
  8465. * value:
  8466. * - tid
  8467. * Bits 31:24
  8468. * Purpose: Identifies the traffic type of the rx frame
  8469. * value:
  8470. *
  8471. * - The payload fields used if the sub-type == MIC error are shown below.
  8472. * Note - MIC err is per MSDU, while PN is per MPDU.
  8473. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  8474. * with MIC err in A-MSDU case, so FW will send only one HTT message
  8475. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  8476. * instead of sending separate HTT messages for each wrong MSDU within
  8477. * the MPDU.
  8478. *
  8479. * |31 24|23 16|15 8|7 0|
  8480. * |----------------+----------------+----------------+----------------|
  8481. * | Rsvd | key_id | peer_id |
  8482. * |-------------------------------------------------------------------|
  8483. * | receiver MAC addr 31:0 |
  8484. * |-------------------------------------------------------------------|
  8485. * | Rsvd | receiver MAC addr 47:32 |
  8486. * |-------------------------------------------------------------------|
  8487. * | transmitter MAC addr 31:0 |
  8488. * |-------------------------------------------------------------------|
  8489. * | Rsvd | transmitter MAC addr 47:32 |
  8490. * |-------------------------------------------------------------------|
  8491. * | PN 31:0 |
  8492. * |-------------------------------------------------------------------|
  8493. * | Rsvd | PN 47:32 |
  8494. * |-------------------------------------------------------------------|
  8495. * - peer_id
  8496. * Bits 15:0
  8497. * Purpose: identifies which peer is frame is from
  8498. * value:
  8499. * - key_id
  8500. * Bits 23:16
  8501. * Purpose: identifies key_id of rx frame
  8502. * value:
  8503. * - RA_31_0 (receiver MAC addr 31:0)
  8504. * Bits 31:0
  8505. * Purpose: identifies by MAC address which vdev received the frame
  8506. * value: MAC address lower 4 bytes
  8507. * - RA_47_32 (receiver MAC addr 47:32)
  8508. * Bits 15:0
  8509. * Purpose: identifies by MAC address which vdev received the frame
  8510. * value: MAC address upper 2 bytes
  8511. * - TA_31_0 (transmitter MAC addr 31:0)
  8512. * Bits 31:0
  8513. * Purpose: identifies by MAC address which peer transmitted the frame
  8514. * value: MAC address lower 4 bytes
  8515. * - TA_47_32 (transmitter MAC addr 47:32)
  8516. * Bits 15:0
  8517. * Purpose: identifies by MAC address which peer transmitted the frame
  8518. * value: MAC address upper 2 bytes
  8519. * - PN_31_0
  8520. * Bits 31:0
  8521. * Purpose: Identifies pn of rx frame
  8522. * value: PN lower 4 bytes
  8523. * - PN_47_32
  8524. * Bits 15:0
  8525. * Purpose: Identifies pn of rx frame
  8526. * value:
  8527. * TKIP or CCMP: PN upper 2 bytes
  8528. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  8529. */
  8530. enum htt_rx_ofld_pkt_err_type {
  8531. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  8532. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  8533. };
  8534. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  8535. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  8536. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  8537. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  8538. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  8539. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  8540. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  8541. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  8542. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  8543. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  8544. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  8545. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  8546. do { \
  8547. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  8548. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  8549. } while (0)
  8550. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  8551. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  8552. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  8553. do { \
  8554. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  8555. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  8556. } while (0)
  8557. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  8558. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  8559. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  8560. do { \
  8561. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  8562. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  8563. } while (0)
  8564. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  8565. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  8566. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  8567. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  8568. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  8569. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  8570. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  8571. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  8572. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  8573. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  8574. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  8575. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  8576. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  8577. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  8578. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  8579. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  8580. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  8581. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  8582. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  8583. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  8584. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  8585. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  8586. do { \
  8587. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  8588. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  8589. } while (0)
  8590. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  8591. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  8592. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  8593. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  8594. do { \
  8595. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  8596. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  8597. } while (0)
  8598. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  8599. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  8600. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  8601. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  8602. do { \
  8603. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  8604. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  8605. } while (0)
  8606. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  8607. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  8608. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  8609. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  8610. do { \
  8611. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  8612. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  8613. } while (0)
  8614. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  8615. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  8616. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  8617. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  8618. do { \
  8619. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  8620. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  8621. } while (0)
  8622. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  8623. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  8624. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  8625. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  8626. do { \
  8627. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  8628. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  8629. } while (0)
  8630. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  8631. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  8632. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  8633. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  8634. do { \
  8635. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  8636. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  8637. } while (0)
  8638. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  8639. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  8640. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  8641. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  8642. do { \
  8643. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  8644. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  8645. } while (0)
  8646. /**
  8647. * @brief peer rate report message
  8648. *
  8649. * @details
  8650. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  8651. * justified rate of all the peers.
  8652. *
  8653. * |31 24|23 16|15 8|7 0|
  8654. * |----------------+----------------+----------------+----------------|
  8655. * | peer_count | | msg_type |
  8656. * |-------------------------------------------------------------------|
  8657. * : Payload (variant number of peer rate report) :
  8658. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  8659. * Header fields:
  8660. * - msg_type
  8661. * Bits 7:0
  8662. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  8663. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  8664. * - reserved
  8665. * Bits 15:8
  8666. * Purpose:
  8667. * value:
  8668. * - peer_count
  8669. * Bits 31:16
  8670. * Purpose: Specify how many peer rate report elements are present in the payload.
  8671. * value:
  8672. *
  8673. * Payload:
  8674. * There are variant number of peer rate report follow the first 32 bits.
  8675. * The peer rate report is defined as follows.
  8676. *
  8677. * |31 20|19 16|15 0|
  8678. * |-----------------------+---------+---------------------------------|-
  8679. * | reserved | phy | peer_id | \
  8680. * |-------------------------------------------------------------------| -> report #0
  8681. * | rate | /
  8682. * |-----------------------+---------+---------------------------------|-
  8683. * | reserved | phy | peer_id | \
  8684. * |-------------------------------------------------------------------| -> report #1
  8685. * | rate | /
  8686. * |-----------------------+---------+---------------------------------|-
  8687. * | reserved | phy | peer_id | \
  8688. * |-------------------------------------------------------------------| -> report #2
  8689. * | rate | /
  8690. * |-------------------------------------------------------------------|-
  8691. * : :
  8692. * : :
  8693. * : :
  8694. * :-------------------------------------------------------------------:
  8695. *
  8696. * - peer_id
  8697. * Bits 15:0
  8698. * Purpose: identify the peer
  8699. * value:
  8700. * - phy
  8701. * Bits 19:16
  8702. * Purpose: identify which phy is in use
  8703. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  8704. * Please see enum htt_peer_report_phy_type for detail.
  8705. * - reserved
  8706. * Bits 31:20
  8707. * Purpose:
  8708. * value:
  8709. * - rate
  8710. * Bits 31:0
  8711. * Purpose: represent the justified rate of the peer specified by peer_id
  8712. * value:
  8713. */
  8714. enum htt_peer_rate_report_phy_type {
  8715. HTT_PEER_RATE_REPORT_11B = 0,
  8716. HTT_PEER_RATE_REPORT_11A_G,
  8717. HTT_PEER_RATE_REPORT_11N,
  8718. HTT_PEER_RATE_REPORT_11AC,
  8719. };
  8720. #define HTT_PEER_RATE_REPORT_SIZE 8
  8721. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  8722. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  8723. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  8724. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  8725. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  8726. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  8727. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  8728. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  8729. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  8730. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  8731. do { \
  8732. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  8733. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  8734. } while (0)
  8735. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  8736. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  8737. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  8738. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  8739. do { \
  8740. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  8741. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  8742. } while (0)
  8743. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  8744. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  8745. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  8746. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  8747. do { \
  8748. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  8749. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  8750. } while (0)
  8751. /**
  8752. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_MAP Message
  8753. *
  8754. * @details
  8755. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  8756. * a flow of descriptors.
  8757. *
  8758. * This message is in TLV format and indicates the parameters to be setup a
  8759. * flow in the host. Each entry indicates that a particular flow ID is ready to
  8760. * receive descriptors from a specified pool.
  8761. *
  8762. * The message would appear as follows:
  8763. *
  8764. * |31 24|23 16|15 8|7 0|
  8765. * |----------------+----------------+----------------+----------------|
  8766. * header | reserved | num_flows | msg_type |
  8767. * |-------------------------------------------------------------------|
  8768. * | |
  8769. * : payload :
  8770. * | |
  8771. * |-------------------------------------------------------------------|
  8772. *
  8773. * The header field is one DWORD long and is interpreted as follows:
  8774. * b'0:7 - msg_type: This will be set to HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  8775. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  8776. * this message
  8777. * b'16-31 - reserved: These bits are reserved for future use
  8778. *
  8779. * Payload:
  8780. * The payload would contain multiple objects of the following structure. Each
  8781. * object represents a flow.
  8782. *
  8783. * |31 24|23 16|15 8|7 0|
  8784. * |----------------+----------------+----------------+----------------|
  8785. * header | reserved | num_flows | msg_type |
  8786. * |-------------------------------------------------------------------|
  8787. * payload0| flow_type |
  8788. * |-------------------------------------------------------------------|
  8789. * | flow_id |
  8790. * |-------------------------------------------------------------------|
  8791. * | reserved0 | flow_pool_id |
  8792. * |-------------------------------------------------------------------|
  8793. * | reserved1 | flow_pool_size |
  8794. * |-------------------------------------------------------------------|
  8795. * | reserved2 |
  8796. * |-------------------------------------------------------------------|
  8797. * payload1| flow_type |
  8798. * |-------------------------------------------------------------------|
  8799. * | flow_id |
  8800. * |-------------------------------------------------------------------|
  8801. * | reserved0 | flow_pool_id |
  8802. * |-------------------------------------------------------------------|
  8803. * | reserved1 | flow_pool_size |
  8804. * |-------------------------------------------------------------------|
  8805. * | reserved2 |
  8806. * |-------------------------------------------------------------------|
  8807. * | . |
  8808. * | . |
  8809. * | . |
  8810. * |-------------------------------------------------------------------|
  8811. *
  8812. * Each payload is 5 DWORDS long and is interpreted as follows:
  8813. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  8814. * this flow is associated. It can be VDEV, peer,
  8815. * or tid (AC). Based on enum htt_flow_type.
  8816. *
  8817. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  8818. * object. For flow_type vdev it is set to the
  8819. * vdevid, for peer it is peerid and for tid, it is
  8820. * tid_num.
  8821. *
  8822. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  8823. * in the host for this flow
  8824. * b'16:31 - reserved0: This field in reserved for the future. In case
  8825. * we have a hierarchical implementation (HCM) of
  8826. * pools, it can be used to indicate the ID of the
  8827. * parent-pool.
  8828. *
  8829. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  8830. * Descriptors for this flow will be
  8831. * allocated from this pool in the host.
  8832. * b'16:31 - reserved1: This field in reserved for the future. In case
  8833. * we have a hierarchical implementation of pools,
  8834. * it can be used to indicate the max number of
  8835. * descriptors in the pool. The b'0:15 can be used
  8836. * to indicate min number of descriptors in the
  8837. * HCM scheme.
  8838. *
  8839. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  8840. * we have a hierarchical implementation of pools,
  8841. * b'0:15 can be used to indicate the
  8842. * priority-based borrowing (PBB) threshold of
  8843. * the flow's pool. The b'16:31 are still left
  8844. * reserved.
  8845. */
  8846. enum htt_flow_type {
  8847. FLOW_TYPE_VDEV = 0,
  8848. /* Insert new flow types above this line */
  8849. };
  8850. PREPACK struct htt_flow_pool_map_payload_t {
  8851. A_UINT32 flow_type;
  8852. A_UINT32 flow_id;
  8853. A_UINT32 flow_pool_id:16,
  8854. reserved0:16;
  8855. A_UINT32 flow_pool_size:16,
  8856. reserved1:16;
  8857. A_UINT32 reserved2;
  8858. } POSTPACK;
  8859. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  8860. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  8861. (sizeof(struct htt_flow_pool_map_payload_t))
  8862. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  8863. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  8864. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  8865. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  8866. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  8867. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  8868. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  8869. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  8870. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  8871. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  8872. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  8873. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  8874. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  8875. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  8876. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  8877. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  8878. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  8879. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  8880. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  8881. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  8882. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  8883. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  8884. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  8885. do { \
  8886. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  8887. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  8888. } while (0)
  8889. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  8890. do { \
  8891. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  8892. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  8893. } while (0)
  8894. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  8895. do { \
  8896. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  8897. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  8898. } while (0)
  8899. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  8900. do { \
  8901. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  8902. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  8903. } while (0)
  8904. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  8905. do { \
  8906. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  8907. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  8908. } while (0)
  8909. /**
  8910. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP Message
  8911. *
  8912. * @details
  8913. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  8914. * down a flow of descriptors.
  8915. * This message indicates that for the flow (whose ID is provided) is wanting
  8916. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  8917. * pool of descriptors from where descriptors are being allocated for this
  8918. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  8919. * be unmapped by the host.
  8920. *
  8921. * The message would appear as follows:
  8922. *
  8923. * |31 24|23 16|15 8|7 0|
  8924. * |----------------+----------------+----------------+----------------|
  8925. * | reserved0 | msg_type |
  8926. * |-------------------------------------------------------------------|
  8927. * | flow_type |
  8928. * |-------------------------------------------------------------------|
  8929. * | flow_id |
  8930. * |-------------------------------------------------------------------|
  8931. * | reserved1 | flow_pool_id |
  8932. * |-------------------------------------------------------------------|
  8933. *
  8934. * The message is interpreted as follows:
  8935. * dword0 - b'0:7 - msg_type: This will be set to
  8936. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  8937. * b'8:31 - reserved0: Reserved for future use
  8938. *
  8939. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  8940. * this flow is associated. It can be VDEV, peer,
  8941. * or tid (AC). Based on enum htt_flow_type.
  8942. *
  8943. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  8944. * object. For flow_type vdev it is set to the
  8945. * vdevid, for peer it is peerid and for tid, it is
  8946. * tid_num.
  8947. *
  8948. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  8949. * used in the host for this flow
  8950. * b'16:31 - reserved0: This field in reserved for the future.
  8951. *
  8952. */
  8953. PREPACK struct htt_flow_pool_unmap_t {
  8954. A_UINT32 msg_type:8,
  8955. reserved0:24;
  8956. A_UINT32 flow_type;
  8957. A_UINT32 flow_id;
  8958. A_UINT32 flow_pool_id:16,
  8959. reserved1:16;
  8960. } POSTPACK;
  8961. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  8962. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  8963. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  8964. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  8965. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  8966. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  8967. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  8968. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  8969. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  8970. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  8971. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  8972. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  8973. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  8974. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  8975. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  8976. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  8977. do { \
  8978. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  8979. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  8980. } while (0)
  8981. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  8982. do { \
  8983. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  8984. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  8985. } while (0)
  8986. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  8987. do { \
  8988. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  8989. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  8990. } while (0)
  8991. /**
  8992. * @brief HTT_T2H_MSG_TYPE_SRING_SETUP_DONE Message
  8993. *
  8994. * @details
  8995. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  8996. * SRNG ring setup is done
  8997. *
  8998. * This message indicates whether the last setup operation is successful.
  8999. * It will be sent to host when host set respose_required bit in
  9000. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  9001. * The message would appear as follows:
  9002. *
  9003. * |31 24|23 16|15 8|7 0|
  9004. * |--------------- +----------------+----------------+----------------|
  9005. * | setup_status | ring_id | pdev_id | msg_type |
  9006. * |-------------------------------------------------------------------|
  9007. *
  9008. * The message is interpreted as follows:
  9009. * dword0 - b'0:7 - msg_type: This will be set to
  9010. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  9011. * b'8:15 - pdev_id:
  9012. * 0 (for rings at SOC/UMAC level),
  9013. * 1/2/3 mac id (for rings at LMAC level)
  9014. * b'16:23 - ring_id: Identify the ring which is set up
  9015. * More details can be got from enum htt_srng_ring_id
  9016. * b'24:31 - setup_status: Indicate status of setup operation
  9017. * Refer to htt_ring_setup_status
  9018. */
  9019. PREPACK struct htt_sring_setup_done_t {
  9020. A_UINT32 msg_type: 8,
  9021. pdev_id: 8,
  9022. ring_id: 8,
  9023. setup_status: 8;
  9024. } POSTPACK;
  9025. enum htt_ring_setup_status {
  9026. htt_ring_setup_status_ok = 0,
  9027. htt_ring_setup_status_error,
  9028. };
  9029. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  9030. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  9031. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  9032. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  9033. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  9034. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  9035. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  9036. do { \
  9037. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  9038. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  9039. } while (0)
  9040. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  9041. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  9042. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  9043. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  9044. HTT_SRING_SETUP_DONE_RING_ID_S)
  9045. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  9046. do { \
  9047. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  9048. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  9049. } while (0)
  9050. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  9051. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  9052. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  9053. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  9054. HTT_SRING_SETUP_DONE_STATUS_S)
  9055. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  9056. do { \
  9057. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  9058. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  9059. } while (0)
  9060. /**
  9061. * @brief HTT_T2H_MSG_TYPE_MAP_FLOW_INFO Message
  9062. *
  9063. * @details
  9064. * HTT TX map flow entry with tqm flow pointer
  9065. * Sent from firmware to host to add tqm flow pointer in corresponding
  9066. * flow search entry. Flow metadata is replayed back to host as part of this
  9067. * struct to enable host to find the specific flow search entry
  9068. *
  9069. * The message would appear as follows:
  9070. *
  9071. * |31 28|27 18|17 14|13 8|7 0|
  9072. * |-------+------------------------------------------+----------------|
  9073. * | rsvd0 | fse_hsh_idx | msg_type |
  9074. * |-------------------------------------------------------------------|
  9075. * | rsvd1 | tid | peer_id |
  9076. * |-------------------------------------------------------------------|
  9077. * | tqm_flow_pntr_lo |
  9078. * |-------------------------------------------------------------------|
  9079. * | tqm_flow_pntr_hi |
  9080. * |-------------------------------------------------------------------|
  9081. * | fse_meta_data |
  9082. * |-------------------------------------------------------------------|
  9083. *
  9084. * The message is interpreted as follows:
  9085. *
  9086. * dword0 - b'0:7 - msg_type: This will be set to
  9087. * HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  9088. *
  9089. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  9090. * for this flow entry
  9091. *
  9092. * dword0 - b'28:31 - rsvd0: Reserved for future use
  9093. *
  9094. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  9095. *
  9096. * dword1 - b'14:17 - tid
  9097. *
  9098. * dword1 - b'18:31 - rsvd1: Reserved for future use
  9099. *
  9100. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  9101. *
  9102. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  9103. *
  9104. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  9105. * given by host
  9106. */
  9107. PREPACK struct htt_tx_map_flow_info {
  9108. A_UINT32
  9109. msg_type: 8,
  9110. fse_hsh_idx: 20,
  9111. rsvd0: 4;
  9112. A_UINT32
  9113. peer_id: 14,
  9114. tid: 4,
  9115. rsvd1: 14;
  9116. A_UINT32 tqm_flow_pntr_lo;
  9117. A_UINT32 tqm_flow_pntr_hi;
  9118. struct htt_tx_flow_metadata fse_meta_data;
  9119. } POSTPACK;
  9120. /* DWORD 0 */
  9121. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  9122. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  9123. /* DWORD 1 */
  9124. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  9125. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  9126. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  9127. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  9128. /* DWORD 0 */
  9129. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  9130. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  9131. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  9132. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  9133. do { \
  9134. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  9135. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  9136. } while (0)
  9137. /* DWORD 1 */
  9138. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  9139. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  9140. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  9141. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  9142. do { \
  9143. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  9144. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  9145. } while (0)
  9146. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  9147. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  9148. HTT_TX_MAP_FLOW_INFO_TID_S)
  9149. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  9150. do { \
  9151. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  9152. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  9153. } while (0)
  9154. /*
  9155. * htt_dbg_ext_stats_status -
  9156. * present - The requested stats have been delivered in full.
  9157. * This indicates that either the stats information was contained
  9158. * in its entirety within this message, or else this message
  9159. * completes the delivery of the requested stats info that was
  9160. * partially delivered through earlier STATS_CONF messages.
  9161. * partial - The requested stats have been delivered in part.
  9162. * One or more subsequent STATS_CONF messages with the same
  9163. * cookie value will be sent to deliver the remainder of the
  9164. * information.
  9165. * error - The requested stats could not be delivered, for example due
  9166. * to a shortage of memory to construct a message holding the
  9167. * requested stats.
  9168. * invalid - The requested stat type is either not recognized, or the
  9169. * target is configured to not gather the stats type in question.
  9170. */
  9171. enum htt_dbg_ext_stats_status {
  9172. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  9173. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  9174. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  9175. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  9176. };
  9177. /**
  9178. * @brief target -> host ppdu stats upload
  9179. *
  9180. * @details
  9181. * The following field definitions describe the format of the HTT target
  9182. * to host ppdu stats indication message.
  9183. *
  9184. *
  9185. * |31 16|15 12|11 10|9 8|7 0 |
  9186. * |----------------------------------------------------------------------|
  9187. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  9188. * |----------------------------------------------------------------------|
  9189. * | ppdu_id |
  9190. * |----------------------------------------------------------------------|
  9191. * | Timestamp in us |
  9192. * |----------------------------------------------------------------------|
  9193. * | reserved |
  9194. * |----------------------------------------------------------------------|
  9195. * | type-specific stats info |
  9196. * | (see htt_ppdu_stats.h) |
  9197. * |----------------------------------------------------------------------|
  9198. * Header fields:
  9199. * - MSG_TYPE
  9200. * Bits 7:0
  9201. * Purpose: Identifies this is a PPDU STATS indication
  9202. * message.
  9203. * Value: 0x1d
  9204. * - mac_id
  9205. * Bits 9:8
  9206. * Purpose: mac_id of this ppdu_id
  9207. * Value: 0-3
  9208. * - pdev_id
  9209. * Bits 11:10
  9210. * Purpose: pdev_id of this ppdu_id
  9211. * Value: 0-3
  9212. * 0 (for rings at SOC level),
  9213. * 1/2/3 PDEV -> 0/1/2
  9214. * - payload_size
  9215. * Bits 31:16
  9216. * Purpose: total tlv size
  9217. * Value: payload_size in bytes
  9218. */
  9219. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  9220. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  9221. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  9222. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  9223. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  9224. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  9225. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  9226. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  9227. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  9228. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  9229. do { \
  9230. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  9231. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  9232. } while (0)
  9233. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  9234. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  9235. HTT_T2H_PPDU_STATS_MAC_ID_S)
  9236. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  9237. do { \
  9238. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  9239. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  9240. } while (0)
  9241. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  9242. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  9243. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  9244. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  9245. do { \
  9246. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  9247. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  9248. } while (0)
  9249. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  9250. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  9251. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  9252. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  9253. do { \
  9254. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  9255. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  9256. } while (0)
  9257. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  9258. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  9259. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  9260. /**
  9261. * @brief target -> host extended statistics upload
  9262. *
  9263. * @details
  9264. * The following field definitions describe the format of the HTT target
  9265. * to host stats upload confirmation message.
  9266. * The message contains a cookie echoed from the HTT host->target stats
  9267. * upload request, which identifies which request the confirmation is
  9268. * for, and a single stats can span over multiple HTT stats indication
  9269. * due to the HTT message size limitation so every HTT ext stats indication
  9270. * will have tag-length-value stats information elements.
  9271. * The tag-length header for each HTT stats IND message also includes a
  9272. * status field, to indicate whether the request for the stat type in
  9273. * question was fully met, partially met, unable to be met, or invalid
  9274. * (if the stat type in question is disabled in the target).
  9275. * A Done bit 1's indicate the end of the of stats info elements.
  9276. *
  9277. *
  9278. * |31 16|15 12|11|10 8|7 5|4 0|
  9279. * |--------------------------------------------------------------|
  9280. * | reserved | msg type |
  9281. * |--------------------------------------------------------------|
  9282. * | cookie LSBs |
  9283. * |--------------------------------------------------------------|
  9284. * | cookie MSBs |
  9285. * |--------------------------------------------------------------|
  9286. * | stats entry length | rsvd | D| S | stat type |
  9287. * |--------------------------------------------------------------|
  9288. * | type-specific stats info |
  9289. * | (see htt_stats.h) |
  9290. * |--------------------------------------------------------------|
  9291. * Header fields:
  9292. * - MSG_TYPE
  9293. * Bits 7:0
  9294. * Purpose: Identifies this is a extended statistics upload confirmation
  9295. * message.
  9296. * Value: 0x1c
  9297. * - COOKIE_LSBS
  9298. * Bits 31:0
  9299. * Purpose: Provide a mechanism to match a target->host stats confirmation
  9300. * message with its preceding host->target stats request message.
  9301. * Value: LSBs of the opaque cookie specified by the host-side requestor
  9302. * - COOKIE_MSBS
  9303. * Bits 31:0
  9304. * Purpose: Provide a mechanism to match a target->host stats confirmation
  9305. * message with its preceding host->target stats request message.
  9306. * Value: MSBs of the opaque cookie specified by the host-side requestor
  9307. *
  9308. * Stats Information Element tag-length header fields:
  9309. * - STAT_TYPE
  9310. * Bits 7:0
  9311. * Purpose: identifies the type of statistics info held in the
  9312. * following information element
  9313. * Value: htt_dbg_ext_stats_type
  9314. * - STATUS
  9315. * Bits 10:8
  9316. * Purpose: indicate whether the requested stats are present
  9317. * Value: htt_dbg_ext_stats_status
  9318. * - DONE
  9319. * Bits 11
  9320. * Purpose:
  9321. * Indicates the completion of the stats entry, this will be the last
  9322. * stats conf HTT segment for the requested stats type.
  9323. * Value:
  9324. * 0 -> the stats retrieval is ongoing
  9325. * 1 -> the stats retrieval is complete
  9326. * - LENGTH
  9327. * Bits 31:16
  9328. * Purpose: indicate the stats information size
  9329. * Value: This field specifies the number of bytes of stats information
  9330. * that follows the element tag-length header.
  9331. * It is expected but not required that this length is a multiple of
  9332. * 4 bytes.
  9333. */
  9334. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  9335. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  9336. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  9337. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  9338. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  9339. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  9340. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  9341. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  9342. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  9343. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  9344. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  9345. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  9346. do { \
  9347. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  9348. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  9349. } while (0)
  9350. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  9351. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  9352. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  9353. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  9354. do { \
  9355. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  9356. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  9357. } while (0)
  9358. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  9359. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  9360. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  9361. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  9362. do { \
  9363. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  9364. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  9365. } while (0)
  9366. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  9367. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  9368. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  9369. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  9370. do { \
  9371. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  9372. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  9373. } while (0)
  9374. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  9375. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  9376. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  9377. typedef enum {
  9378. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  9379. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  9380. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  9381. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  9382. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  9383. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  9384. /* Reserved from 128 - 255 for target internal use.*/
  9385. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  9386. } HTT_PEER_TYPE;
  9387. /** 2 word representation of MAC addr */
  9388. typedef struct {
  9389. /** upper 4 bytes of MAC address */
  9390. A_UINT32 mac_addr31to0;
  9391. /** lower 2 bytes of MAC address */
  9392. A_UINT32 mac_addr47to32;
  9393. } htt_mac_addr;
  9394. /** macro to convert MAC address from char array to HTT word format */
  9395. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  9396. (phtt_mac_addr)->mac_addr31to0 = \
  9397. (((c_macaddr)[0] << 0) | \
  9398. ((c_macaddr)[1] << 8) | \
  9399. ((c_macaddr)[2] << 16) | \
  9400. ((c_macaddr)[3] << 24)); \
  9401. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  9402. } while (0)
  9403. /**
  9404. * @brief target -> host monitor mac header indication message
  9405. *
  9406. * @details
  9407. * The following diagram shows the format of the monitor mac header message
  9408. * sent from the target to the host.
  9409. * This message is primarily sent when promiscuous rx mode is enabled.
  9410. * One message is sent per rx PPDU.
  9411. *
  9412. * |31 24|23 16|15 8|7 0|
  9413. * |-------------------------------------------------------------|
  9414. * | peer_id | reserved0 | msg_type |
  9415. * |-------------------------------------------------------------|
  9416. * | reserved1 | num_mpdu |
  9417. * |-------------------------------------------------------------|
  9418. * | struct hw_rx_desc |
  9419. * | (see wal_rx_desc.h) |
  9420. * |-------------------------------------------------------------|
  9421. * | struct ieee80211_frame_addr4 |
  9422. * | (see ieee80211_defs.h) |
  9423. * |-------------------------------------------------------------|
  9424. * | struct ieee80211_frame_addr4 |
  9425. * | (see ieee80211_defs.h) |
  9426. * |-------------------------------------------------------------|
  9427. * | ...... |
  9428. * |-------------------------------------------------------------|
  9429. *
  9430. * Header fields:
  9431. * - msg_type
  9432. * Bits 7:0
  9433. * Purpose: Identifies this is a monitor mac header indication message.
  9434. * Value: 0x20
  9435. * - peer_id
  9436. * Bits 31:16
  9437. * Purpose: Software peer id given by host during association,
  9438. * During promiscuous mode, the peer ID will be invalid (0xFF)
  9439. * for rx PPDUs received from unassociated peers.
  9440. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  9441. * - num_mpdu
  9442. * Bits 15:0
  9443. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  9444. * delivered within the message.
  9445. * Value: 1 to 32
  9446. * num_mpdu is limited to a maximum value of 32, due to buffer
  9447. * size limits. For PPDUs with more than 32 MPDUs, only the
  9448. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  9449. * the PPDU will be provided.
  9450. */
  9451. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  9452. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  9453. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  9454. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  9455. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  9456. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  9457. do { \
  9458. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  9459. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  9460. } while (0)
  9461. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  9462. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  9463. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  9464. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  9465. do { \
  9466. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  9467. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  9468. } while (0)
  9469. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  9470. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  9471. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  9472. /**
  9473. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE Message
  9474. *
  9475. * @details
  9476. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  9477. * the flow pool associated with the specified ID is resized
  9478. *
  9479. * The message would appear as follows:
  9480. *
  9481. * |31 16|15 8|7 0|
  9482. * |---------------------------------+----------------+----------------|
  9483. * | reserved0 | Msg type |
  9484. * |-------------------------------------------------------------------|
  9485. * | flow pool new size | flow pool ID |
  9486. * |-------------------------------------------------------------------|
  9487. *
  9488. * The message is interpreted as follows:
  9489. * b'0:7 - msg_type: This will be set to
  9490. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  9491. *
  9492. * b'0:15 - flow pool ID: Existing flow pool ID
  9493. *
  9494. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  9495. *
  9496. */
  9497. PREPACK struct htt_flow_pool_resize_t {
  9498. A_UINT32 msg_type:8,
  9499. reserved0:24;
  9500. A_UINT32 flow_pool_id:16,
  9501. flow_pool_new_size:16;
  9502. } POSTPACK;
  9503. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  9504. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  9505. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  9506. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  9507. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  9508. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  9509. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  9510. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  9511. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  9512. do { \
  9513. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  9514. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  9515. } while (0)
  9516. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  9517. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  9518. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  9519. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  9520. do { \
  9521. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  9522. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  9523. } while (0)
  9524. #endif