htt.h 624 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873
  1. /*
  2. * Copyright (c) 2011-2020 The Linux Foundation. All rights reserved.
  3. *
  4. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  5. *
  6. *
  7. * Permission to use, copy, modify, and/or distribute this software for
  8. * any purpose with or without fee is hereby granted, provided that the
  9. * above copyright notice and this permission notice appear in all
  10. * copies.
  11. *
  12. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  13. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  14. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  15. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  16. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  17. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  18. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  19. * PERFORMANCE OF THIS SOFTWARE.
  20. */
  21. /*
  22. * This file was originally distributed by Qualcomm Atheros, Inc.
  23. * under proprietary terms before Copyright ownership was assigned
  24. * to the Linux Foundation.
  25. */
  26. /**
  27. * @file htt.h
  28. *
  29. * @details the public header file of HTT layer
  30. */
  31. #ifndef _HTT_H_
  32. #define _HTT_H_
  33. #include <htt_deps.h>
  34. #include <htt_common.h>
  35. /*
  36. * Unless explicitly specified to use 64 bits to represent physical addresses
  37. * (or more precisely, bus addresses), default to 32 bits.
  38. */
  39. #ifndef HTT_PADDR64
  40. #define HTT_PADDR64 0
  41. #endif
  42. #ifndef offsetof
  43. #define offsetof(type, field) ((unsigned int)(&((type *)0)->field))
  44. #endif
  45. /*
  46. * HTT version history:
  47. * 1.0 initial numbered version
  48. * 1.1 modifications to STATS messages.
  49. * These modifications are not backwards compatible, but since the
  50. * STATS messages themselves are non-essential (they are for debugging),
  51. * the 1.1 version of the HTT message library as a whole is compatible
  52. * with the 1.0 version.
  53. * 1.2 reset mask IE added to STATS_REQ message
  54. * 1.3 stat config IE added to STATS_REQ message
  55. *----
  56. * 2.0 FW rx PPDU desc added to RX_IND message
  57. * 2.1 Enable msdu_ext/frag_desc banking change for WIFI2.0
  58. *----
  59. * 3.0 Remove HTT_H2T_MSG_TYPE_MGMT_TX message
  60. * 3.1 Added HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND message
  61. * 3.2 Added HTT_H2T_MSG_TYPE_WDI_IPA_CFG,
  62. * HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST messages
  63. * 3.3 Added HTT_H2T_MSG_TYPE_AGGR_CFG_EX message
  64. * 3.4 Added tx_compl_req flag in HTT tx descriptor
  65. * 3.5 Added flush and fail stats in rx_reorder stats structure
  66. * 3.6 Added frag flag in HTT RX INORDER PADDR IND header
  67. * 3.7 Made changes to support EOS Mac_core 3.0
  68. * 3.8 Added txq_group information element definition;
  69. * added optional txq_group suffix to TX_CREDIT_UPDATE_IND message
  70. * 3.9 Added HTT_T2H CHAN_CHANGE message;
  71. * Allow buffer addresses in bus-address format to be stored as
  72. * either 32 bits or 64 bits.
  73. * 3.10 Add optional TLV extensions to the VERSION_REQ and VERSION_CONF
  74. * messages to specify which HTT options to use.
  75. * Initial TLV options cover:
  76. * - whether to use 32 or 64 bits to represent LL bus addresses
  77. * - whether to use TX_COMPL_IND or TX_CREDIT_UPDATE_IND in HL systems
  78. * - how many tx queue groups to use
  79. * 3.11 Expand rx debug stats:
  80. * - Expand the rx_reorder_stats struct with stats about successful and
  81. * failed rx buffer allcoations.
  82. * - Add a new rx_remote_buffer_mgmt_stats struct with stats about
  83. * the supply, allocation, use, and recycling of rx buffers for the
  84. * "remote ring" of rx buffers in host member in LL systems.
  85. * Add RX_REMOTE_RING_BUFFER_INFO stats type for uploading these stats.
  86. * 3.12 Add "rx offload packet error" message with initial "MIC error" subtype
  87. * 3.13 Add constants + macros to support 64-bit address format for the
  88. * tx fragments descriptor, the rx ring buffer, and the rx ring
  89. * index shadow register.
  90. * 3.14 Add a method for the host to provide detailed per-frame tx specs:
  91. * - Add htt_tx_msdu_desc_ext_t struct def.
  92. * - Add TLV to specify whether the target supports the HTT tx MSDU
  93. * extension descriptor.
  94. * - Change a reserved bit in the HTT tx MSDU descriptor to an
  95. * "extension" bit, to specify whether a HTT tx MSDU extension
  96. * descriptor is present.
  97. * 3.15 Add HW rx desc info to per-MSDU info elems in RX_IN_ORD_PADDR_IND msg.
  98. * (This allows the host to obtain key information about the MSDU
  99. * from a memory location already in the cache, rather than taking a
  100. * cache miss for each MSDU by reading the HW rx descs.)
  101. * 3.16 Add htt_pkt_type_eth2 and define pkt_subtype flags to indicate
  102. * whether a copy-engine classification result is appended to TX_FRM.
  103. * 3.17 Add a version of the WDI_IPA_CFG message; add RX_RING2 to WDI_IPA_CFG
  104. * 3.18 Add a PEER_DEL tx completion indication status, for HL cleanup of
  105. * tx frames in the target after the peer has already been deleted.
  106. * 3.19 Add HTT_DBG_STATS_RX_RATE_INFO_V2 and HTT_DBG_STATS_TX_RATE_INFO_V2
  107. * 3.20 Expand rx_reorder_stats.
  108. * 3.21 Add optional rx channel spec to HL RX_IND.
  109. * 3.22 Expand rx_reorder_stats
  110. * (distinguish duplicates within vs. outside block ack window)
  111. * 3.23 Add HTT_T2H_MSG_TYPE_RATE_REPORT to report peer justified rate.
  112. * The justified rate is calculated by two steps. The first is to multiply
  113. * user-rate by (1 - PER) and the other is to smooth the step 1's result
  114. * by a low pass filter.
  115. * This change allows HL download scheduling to consider the WLAN rate
  116. * that will be used for transmitting the downloaded frames.
  117. * 3.24 Expand rx_reorder_stats
  118. * (add counter for decrypt / MIC errors)
  119. * 3.25 Expand rx_reorder_stats
  120. * (add counter of frames received into both local + remote rings)
  121. * 3.26 Add stats struct for counting rx of tx BF, MU, SU, and NDPA frames
  122. * (HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT, rx_txbf_musu_ndpa_pkts_stats)
  123. * 3.27 Add a new interface for flow-control. The following t2h messages have
  124. * been included: HTT_T2H_MSG_TYPE_FLOW_POOL_MAP and
  125. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  126. * 3.28 Add a new interface for ring interface change. The following two h2t
  127. * and one t2h messages have been included:
  128. * HTT_H2T_MSG_TYPE_SRING_SETUP, HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG,
  129. * and HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  130. * 3.29 Add definitions of htt_tx_msdu_desc_ext2_t descriptor and other
  131. * information elements passed from the host to a Lithium target,
  132. * Add definitions of the HTT_H2T ADD_WDS_ENTRY and DELETE_WDS_ENTRY
  133. * messages and the HTT_T2H MAP_FLOW_INFO message (for use with Lithium
  134. * targets).
  135. * 3.30 Add pktlog flag inside HTT_T2H RX_IN_ORD_PADDR_IND message
  136. * 3.31 Add HTT_H2T_MSG_TYPE_RFS_CONFIG
  137. * 3.32 Add HTT_WDI_IPA_OPCODE_SHARING_STATS, HTT_WDI_IPA_OPCODE_SET_QUOTA and
  138. * HTT_WDI_IPA_OPCODE_IND_QUOTA for getting quota and reporting WiFi
  139. * sharing stats
  140. * 3.33 Add HTT_TX_COMPL_IND_STAT_DROP and HTT_TX_COMPL_IND_STAT_HOST_INSPECT
  141. * 3.34 Add HW_PEER_ID field to PEER_MAP
  142. * 3.35 Revise bitfield defs of HTT_SRING_SETUP message
  143. * (changes are not backwards compatible, but HTT_SRING_SETUP message is
  144. * not yet in use)
  145. * 3.36 Add HTT_H2T_MSG_TYPE_EXT_STATS_REQ and HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  146. * 3.37 Add HTT_PEER_TYPE and htt_mac_addr defs
  147. * 3.38 Add holes_no_filled field to rx_reorder_stats
  148. * 3.39 Add host_inspected flag to htt_tx_tcl_vdev_metadata
  149. * 3.40 Add optional timestamps in the HTT tx completion
  150. * 3.41 Add optional tx power spec in the HTT tx completion (for DSRC use)
  151. * 3.42 Add PPDU_STATS_CFG + PPDU_STATS_IND
  152. * 3.43 Add HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR defs
  153. * 3.44 Add htt_tx_wbm_completion_v2
  154. * 3.45 Add host_tx_desc_pool flag in htt_tx_msdu_desc_ext2_t
  155. * 3.46 Add MAC ID and payload size fields to HTT_T2H_MSG_TYPE_PKTLOG header
  156. * 3.47 Add HTT_T2H PEER_MAP_V2 and PEER_UNMAP_V2
  157. * 3.48 Add pdev ID field to HTT_T2H_MSG_TYPE_PPDU_STATS_IND and
  158. * HTT_T2H_MSG_TYPE_PKTLOG
  159. * 3.49 Add HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND def
  160. * 3.50 Add learning_frame flag to htt_tx_msdu_desc_ext2_t
  161. * 3.51 Add SW peer ID and TID num to HTT TX WBM COMPLETION
  162. * 3.52 Add HTT_T2H FLOW_POOL_RESIZE msg def
  163. * 3.53 Update HTT_T2H FLOW_POOL_RESIZE msg def
  164. * 3.54 Define mcast and mcast_valid flags within htt_tx_wbm_transmit_status
  165. * 3.55 Add initiator / responder flags to RX_DELBA indication
  166. * 3.56 Fix HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE bit-mask defs
  167. * 3.57 Add support for in-band data within HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  168. * 3.58 Add optional MSDU ack RSSI array to end of HTT_T2H TX_COMPL_IND msg
  169. * 3.59 Add HTT_RXDMA_HOST_BUF_RING2 def
  170. * 3.60 Add HTT_T2H_MSG_TYPE_PEER_STATS_IND def
  171. * 3.61 Add rx offset fields to HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG msg
  172. * 3.62 Add antenna mask to reserved space in htt_rx_ppdu_desc_t
  173. * 3.63 Add HTT_HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND def
  174. * 3.64 Add struct htt_tx_compl_ind_append_tx_tsf64 and add tx_tsf64
  175. * array to the end of HTT_T2H TX_COMPL_IND msg
  176. * 3.65 Add fields in htt_tx_msdu_desc_ext2_t to allow the host to provide
  177. * a "cookie" to identify a MSDU, and to specify to not apply aggregation
  178. * for a MSDU.
  179. * 3.66 Add HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND msg.
  180. * Add PKT_CAPTURE_MODE flag within HTT_T2H TX_I_ORD_PADDR_IND msg.
  181. * 3.67 Add drop threshold field to HTT_H2T RX_RING_SELECTION_CFG msg.
  182. * 3.68 Add ipa_drop threshold fields to HTT_H2T_MSG_TYPE_SRING_SETUP
  183. * 3.69 Add htt_ul_ofdma_user_info_v0 defs
  184. * 3.70 Add AST1-AST3 fields to HTT_T2H PEER_MAP_V2 msg
  185. * 3.71 Add rx offload engine / flow search engine htt setup message defs for
  186. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG, HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  187. * 3.72 Add tx_retry_cnt fields to htt_tx_offload_deliver_ind_hdr_t and
  188. * htt_tx_data_hdr_information
  189. * 3.73 Add channel pre-calibration data upload and download messages defs for
  190. * HTT_T2H_MSG_TYPE_CHAN_CALDATA and HTT_H2T_MSG_TYPE_CHAN_CALDATA
  191. * 3.74 Add HTT_T2H_MSG_TYPE_RX_FISA_CFG msg.
  192. * 3.75 Add fp_ndp and mo_ndp flags in HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG.
  193. * 3.76 Add HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG msg.
  194. */
  195. #define HTT_CURRENT_VERSION_MAJOR 3
  196. #define HTT_CURRENT_VERSION_MINOR 76
  197. #define HTT_NUM_TX_FRAG_DESC 1024
  198. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  199. #define HTT_CHECK_SET_VAL(field, val) \
  200. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  201. /* macros to assist in sign-extending fields from HTT messages */
  202. #define HTT_SIGN_BIT_MASK(field) \
  203. ((field ## _M + (1 << field ## _S)) >> 1)
  204. #define HTT_SIGN_BIT(_val, field) \
  205. (_val & HTT_SIGN_BIT_MASK(field))
  206. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  207. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  208. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  209. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  210. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  211. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  212. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  213. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  214. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  215. /*
  216. * TEMPORARY:
  217. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  218. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  219. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  220. * updated.
  221. */
  222. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  223. /*
  224. * TEMPORARY:
  225. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  226. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  227. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  228. * updated.
  229. */
  230. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  231. /* HTT Access Category values */
  232. enum HTT_AC_WMM {
  233. /* WMM Access Categories */
  234. HTT_AC_WMM_BE = 0x0,
  235. HTT_AC_WMM_BK = 0x1,
  236. HTT_AC_WMM_VI = 0x2,
  237. HTT_AC_WMM_VO = 0x3,
  238. /* extension Access Categories */
  239. HTT_AC_EXT_NON_QOS = 0x4,
  240. HTT_AC_EXT_UCAST_MGMT = 0x5,
  241. HTT_AC_EXT_MCAST_DATA = 0x6,
  242. HTT_AC_EXT_MCAST_MGMT = 0x7,
  243. };
  244. enum HTT_AC_WMM_MASK {
  245. /* WMM Access Categories */
  246. HTT_AC_WMM_BE_MASK = (1 << HTT_AC_WMM_BE),
  247. HTT_AC_WMM_BK_MASK = (1 << HTT_AC_WMM_BK),
  248. HTT_AC_WMM_VI_MASK = (1 << HTT_AC_WMM_VI),
  249. HTT_AC_WMM_VO_MASK = (1 << HTT_AC_WMM_VO),
  250. /* extension Access Categories */
  251. HTT_AC_EXT_NON_QOS_MASK = (1 << HTT_AC_EXT_NON_QOS),
  252. HTT_AC_EXT_UCAST_MGMT_MASK = (1 << HTT_AC_EXT_UCAST_MGMT),
  253. HTT_AC_EXT_MCAST_DATA_MASK = (1 << HTT_AC_EXT_MCAST_DATA),
  254. HTT_AC_EXT_MCAST_MGMT_MASK = (1 << HTT_AC_EXT_MCAST_MGMT),
  255. };
  256. #define HTT_AC_MASK_WMM \
  257. (HTT_AC_WMM_BE_MASK | HTT_AC_WMM_BK_MASK | \
  258. HTT_AC_WMM_VI_MASK | HTT_AC_WMM_VO_MASK)
  259. #define HTT_AC_MASK_EXT \
  260. (HTT_AC_EXT_NON_QOS_MASK | HTT_AC_EXT_UCAST_MGMT_MASK | \
  261. HTT_AC_EXT_MCAST_DATA_MASK | HTT_AC_EXT_MCAST_MGMT_MASK)
  262. #define HTT_AC_MASK_ALL (HTT_AC_MASK_WMM | HTT_AC_MASK_EXT)
  263. /*
  264. * htt_dbg_stats_type -
  265. * bit positions for each stats type within a stats type bitmask
  266. * The bitmask contains 24 bits.
  267. */
  268. enum htt_dbg_stats_type {
  269. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  270. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  271. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  272. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  273. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  274. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  275. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  276. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  277. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  278. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  279. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  280. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  281. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  282. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  283. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  284. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  285. /* bits 16-23 currently reserved */
  286. /* keep this last */
  287. HTT_DBG_NUM_STATS
  288. };
  289. /*=== HTT option selection TLVs ===
  290. * Certain HTT messages have alternatives or options.
  291. * For such cases, the host and target need to agree on which option to use.
  292. * Option specification TLVs can be appended to the VERSION_REQ and
  293. * VERSION_CONF messages to select options other than the default.
  294. * These TLVs are entirely optional - if they are not provided, there is a
  295. * well-defined default for each option. If they are provided, they can be
  296. * provided in any order. Each TLV can be present or absent independent of
  297. * the presence / absence of other TLVs.
  298. *
  299. * The HTT option selection TLVs use the following format:
  300. * |31 16|15 8|7 0|
  301. * |---------------------------------+----------------+----------------|
  302. * | value (payload) | length | tag |
  303. * |-------------------------------------------------------------------|
  304. * The value portion need not be only 2 bytes; it can be extended by any
  305. * integer number of 4-byte units. The total length of the TLV, including
  306. * the tag and length fields, must be a multiple of 4 bytes. The length
  307. * field specifies the total TLV size in 4-byte units. Thus, the typical
  308. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  309. * field, would store 0x1 in its length field, to show that the TLV occupies
  310. * a single 4-byte unit.
  311. */
  312. /*--- TLV header format - applies to all HTT option TLVs ---*/
  313. enum HTT_OPTION_TLV_TAGS {
  314. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  315. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  316. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  317. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  318. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  319. };
  320. PREPACK struct htt_option_tlv_header_t {
  321. A_UINT8 tag;
  322. A_UINT8 length;
  323. } POSTPACK;
  324. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  325. #define HTT_OPTION_TLV_TAG_S 0
  326. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  327. #define HTT_OPTION_TLV_LENGTH_S 8
  328. /*
  329. * value0 - 16 bit value field stored in word0
  330. * The TLV's value field may be longer than 2 bytes, in which case
  331. * the remainder of the value is stored in word1, word2, etc.
  332. */
  333. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  334. #define HTT_OPTION_TLV_VALUE0_S 16
  335. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  336. do { \
  337. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  338. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  339. } while (0)
  340. #define HTT_OPTION_TLV_TAG_GET(word) \
  341. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  342. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  343. do { \
  344. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  345. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  346. } while (0)
  347. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  348. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  349. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  350. do { \
  351. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  352. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  353. } while (0)
  354. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  355. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  356. /*--- format of specific HTT option TLVs ---*/
  357. /*
  358. * HTT option TLV for specifying LL bus address size
  359. * Some chips require bus addresses used by the target to access buffers
  360. * within the host's memory to be 32 bits; others require bus addresses
  361. * used by the target to access buffers within the host's memory to be
  362. * 64 bits.
  363. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  364. * a suffix to the VERSION_CONF message to specify which bus address format
  365. * the target requires.
  366. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  367. * default to providing bus addresses to the target in 32-bit format.
  368. */
  369. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  370. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  371. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  372. };
  373. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  374. struct htt_option_tlv_header_t hdr;
  375. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  376. } POSTPACK;
  377. /*
  378. * HTT option TLV for specifying whether HL systems should indicate
  379. * over-the-air tx completion for individual frames, or should instead
  380. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  381. * requests an OTA tx completion for a particular tx frame.
  382. * This option does not apply to LL systems, where the TX_COMPL_IND
  383. * is mandatory.
  384. * This option is primarily intended for HL systems in which the tx frame
  385. * downloads over the host --> target bus are as slow as or slower than
  386. * the transmissions over the WLAN PHY. For cases where the bus is faster
  387. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  388. * and consquently will send one TX_COMPL_IND message that covers several
  389. * tx frames. For cases where the WLAN PHY is faster than the bus,
  390. * the target will end up transmitting very short A-MPDUs, and consequently
  391. * sending many TX_COMPL_IND messages, which each cover a very small number
  392. * of tx frames.
  393. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  394. * a suffix to the VERSION_REQ message to request whether the host desires to
  395. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  396. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  397. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  398. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  399. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  400. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  401. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  402. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  403. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  404. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  405. * TLV.
  406. */
  407. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  408. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  409. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  410. };
  411. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  412. struct htt_option_tlv_header_t hdr;
  413. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  414. } POSTPACK;
  415. /*
  416. * HTT option TLV for specifying how many tx queue groups the target
  417. * may establish.
  418. * This TLV specifies the maximum value the target may send in the
  419. * txq_group_id field of any TXQ_GROUP information elements sent by
  420. * the target to the host. This allows the host to pre-allocate an
  421. * appropriate number of tx queue group structs.
  422. *
  423. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  424. * a suffix to the VERSION_REQ message to specify whether the host supports
  425. * tx queue groups at all, and if so if there is any limit on the number of
  426. * tx queue groups that the host supports.
  427. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  428. * a suffix to the VERSION_CONF message. If the host has specified in the
  429. * VER_REQ message a limit on the number of tx queue groups the host can
  430. * supprt, the target shall limit its specification of the maximum tx groups
  431. * to be no larger than this host-specified limit.
  432. *
  433. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  434. * shall preallocate 4 tx queue group structs, and the target shall not
  435. * specify a txq_group_id larger than 3.
  436. */
  437. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  438. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  439. /*
  440. * values 1 through N specify the max number of tx queue groups
  441. * the sender supports
  442. */
  443. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  444. };
  445. /* TEMPORARY backwards-compatibility alias for a typo fix -
  446. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  447. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  448. * to support the old name (with the typo) until all references to the
  449. * old name are replaced with the new name.
  450. */
  451. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  452. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  453. struct htt_option_tlv_header_t hdr;
  454. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  455. } POSTPACK;
  456. /*
  457. * HTT option TLV for specifying whether the target supports an extended
  458. * version of the HTT tx descriptor. If the target provides this TLV
  459. * and specifies in the TLV that the target supports an extended version
  460. * of the HTT tx descriptor, the target must check the "extension" bit in
  461. * the HTT tx descriptor, and if the extension bit is set, to expect a
  462. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  463. * descriptor. Furthermore, the target must provide room for the HTT
  464. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  465. * This option is intended for systems where the host needs to explicitly
  466. * control the transmission parameters such as tx power for individual
  467. * tx frames.
  468. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  469. * as a suffix to the VERSION_CONF message to explicitly specify whether
  470. * the target supports the HTT tx MSDU extension descriptor.
  471. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  472. * by the host as lack of target support for the HTT tx MSDU extension
  473. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  474. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  475. * the HTT tx MSDU extension descriptor.
  476. * The host is not required to provide the HTT tx MSDU extension descriptor
  477. * just because the target supports it; the target must check the
  478. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  479. * extension descriptor is present.
  480. */
  481. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  482. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  483. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  484. };
  485. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  486. struct htt_option_tlv_header_t hdr;
  487. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  488. } POSTPACK;
  489. /*=== host -> target messages ===============================================*/
  490. enum htt_h2t_msg_type {
  491. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  492. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  493. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  494. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  495. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  496. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  497. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  498. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  499. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  500. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  501. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  502. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  503. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  504. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  505. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  506. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  507. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  508. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  509. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  510. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  511. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  512. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  513. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  514. /* keep this last */
  515. HTT_H2T_NUM_MSGS
  516. };
  517. /*
  518. * HTT host to target message type -
  519. * stored in bits 7:0 of the first word of the message
  520. */
  521. #define HTT_H2T_MSG_TYPE_M 0xff
  522. #define HTT_H2T_MSG_TYPE_S 0
  523. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  524. do { \
  525. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  526. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  527. } while (0)
  528. #define HTT_H2T_MSG_TYPE_GET(word) \
  529. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  530. /**
  531. * @brief host -> target version number request message definition
  532. *
  533. * |31 24|23 16|15 8|7 0|
  534. * |----------------+----------------+----------------+----------------|
  535. * | reserved | msg type |
  536. * |-------------------------------------------------------------------|
  537. * : option request TLV (optional) |
  538. * :...................................................................:
  539. *
  540. * The VER_REQ message may consist of a single 4-byte word, or may be
  541. * extended with TLVs that specify which HTT options the host is requesting
  542. * from the target.
  543. * The following option TLVs may be appended to the VER_REQ message:
  544. * - HL_SUPPRESS_TX_COMPL_IND
  545. * - HL_MAX_TX_QUEUE_GROUPS
  546. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  547. * may be appended to the VER_REQ message (but only one TLV of each type).
  548. *
  549. * Header fields:
  550. * - MSG_TYPE
  551. * Bits 7:0
  552. * Purpose: identifies this as a version number request message
  553. * Value: 0x0
  554. */
  555. #define HTT_VER_REQ_BYTES 4
  556. /* TBDXXX: figure out a reasonable number */
  557. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  558. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  559. /**
  560. * @brief HTT tx MSDU descriptor
  561. *
  562. * @details
  563. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  564. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  565. * the target firmware needs for the FW's tx processing, particularly
  566. * for creating the HW msdu descriptor.
  567. * The same HTT tx descriptor is used for HL and LL systems, though
  568. * a few fields within the tx descriptor are used only by LL or
  569. * only by HL.
  570. * The HTT tx descriptor is defined in two manners: by a struct with
  571. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  572. * definitions.
  573. * The target should use the struct def, for simplicitly and clarity,
  574. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  575. * neutral. Specifically, the host shall use the get/set macros built
  576. * around the mask + shift defs.
  577. */
  578. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  579. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  580. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  581. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  582. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  583. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  584. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  585. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  586. #define HTT_TX_VDEV_ID_WORD 0
  587. #define HTT_TX_VDEV_ID_MASK 0x3f
  588. #define HTT_TX_VDEV_ID_SHIFT 16
  589. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  590. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  591. #define HTT_TX_MSDU_LEN_DWORD 1
  592. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  593. /*
  594. * HTT_VAR_PADDR macros
  595. * Allow physical / bus addresses to be either a single 32-bit value,
  596. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  597. */
  598. #define HTT_VAR_PADDR32(var_name) \
  599. A_UINT32 var_name
  600. #define HTT_VAR_PADDR64_LE(var_name) \
  601. struct { \
  602. /* little-endian: lo precedes hi */ \
  603. A_UINT32 lo; \
  604. A_UINT32 hi; \
  605. } var_name
  606. /*
  607. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  608. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  609. * addresses are stored in a XXX-bit field.
  610. * This macro is used to define both htt_tx_msdu_desc32_t and
  611. * htt_tx_msdu_desc64_t structs.
  612. */
  613. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  614. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  615. { \
  616. /* DWORD 0: flags and meta-data */ \
  617. A_UINT32 \
  618. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  619. \
  620. /* pkt_subtype - \
  621. * Detailed specification of the tx frame contents, extending the \
  622. * general specification provided by pkt_type. \
  623. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  624. * pkt_type | pkt_subtype \
  625. * ============================================================== \
  626. * 802.3 | bit 0:3 - Reserved \
  627. * | bit 4: 0x0 - Copy-Engine Classification Results \
  628. * | not appended to the HTT message \
  629. * | 0x1 - Copy-Engine Classification Results \
  630. * | appended to the HTT message in the \
  631. * | format: \
  632. * | [HTT tx desc, frame header, \
  633. * | CE classification results] \
  634. * | The CE classification results begin \
  635. * | at the next 4-byte boundary after \
  636. * | the frame header. \
  637. * ------------+------------------------------------------------- \
  638. * Eth2 | bit 0:3 - Reserved \
  639. * | bit 4: 0x0 - Copy-Engine Classification Results \
  640. * | not appended to the HTT message \
  641. * | 0x1 - Copy-Engine Classification Results \
  642. * | appended to the HTT message. \
  643. * | See the above specification of the \
  644. * | CE classification results location. \
  645. * ------------+------------------------------------------------- \
  646. * native WiFi | bit 0:3 - Reserved \
  647. * | bit 4: 0x0 - Copy-Engine Classification Results \
  648. * | not appended to the HTT message \
  649. * | 0x1 - Copy-Engine Classification Results \
  650. * | appended to the HTT message. \
  651. * | See the above specification of the \
  652. * | CE classification results location. \
  653. * ------------+------------------------------------------------- \
  654. * mgmt | 0x0 - 802.11 MAC header absent \
  655. * | 0x1 - 802.11 MAC header present \
  656. * ------------+------------------------------------------------- \
  657. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  658. * | 0x1 - 802.11 MAC header present \
  659. * | bit 1: 0x0 - allow aggregation \
  660. * | 0x1 - don't allow aggregation \
  661. * | bit 2: 0x0 - perform encryption \
  662. * | 0x1 - don't perform encryption \
  663. * | bit 3: 0x0 - perform tx classification / queuing \
  664. * | 0x1 - don't perform tx classification; \
  665. * | insert the frame into the "misc" \
  666. * | tx queue \
  667. * | bit 4: 0x0 - Copy-Engine Classification Results \
  668. * | not appended to the HTT message \
  669. * | 0x1 - Copy-Engine Classification Results \
  670. * | appended to the HTT message. \
  671. * | See the above specification of the \
  672. * | CE classification results location. \
  673. */ \
  674. pkt_subtype: 5, \
  675. \
  676. /* pkt_type - \
  677. * General specification of the tx frame contents. \
  678. * The htt_pkt_type enum should be used to specify and check the \
  679. * value of this field. \
  680. */ \
  681. pkt_type: 3, \
  682. \
  683. /* vdev_id - \
  684. * ID for the vdev that is sending this tx frame. \
  685. * For certain non-standard packet types, e.g. pkt_type == raw \
  686. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  687. * This field is used primarily for determining where to queue \
  688. * broadcast and multicast frames. \
  689. */ \
  690. vdev_id: 6, \
  691. /* ext_tid - \
  692. * The extended traffic ID. \
  693. * If the TID is unknown, the extended TID is set to \
  694. * HTT_TX_EXT_TID_INVALID. \
  695. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  696. * value of the QoS TID. \
  697. * If the tx frame is non-QoS data, then the extended TID is set to \
  698. * HTT_TX_EXT_TID_NON_QOS. \
  699. * If the tx frame is multicast or broadcast, then the extended TID \
  700. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  701. */ \
  702. ext_tid: 5, \
  703. \
  704. /* postponed - \
  705. * This flag indicates whether the tx frame has been downloaded to \
  706. * the target before but discarded by the target, and now is being \
  707. * downloaded again; or if this is a new frame that is being \
  708. * downloaded for the first time. \
  709. * This flag allows the target to determine the correct order for \
  710. * transmitting new vs. old frames. \
  711. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  712. * This flag only applies to HL systems, since in LL systems, \
  713. * the tx flow control is handled entirely within the target. \
  714. */ \
  715. postponed: 1, \
  716. \
  717. /* extension - \
  718. * This flag indicates whether a HTT tx MSDU extension descriptor \
  719. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  720. * \
  721. * 0x0 - no extension MSDU descriptor is present \
  722. * 0x1 - an extension MSDU descriptor immediately follows the \
  723. * regular MSDU descriptor \
  724. */ \
  725. extension: 1, \
  726. \
  727. /* cksum_offload - \
  728. * This flag indicates whether checksum offload is enabled or not \
  729. * for this frame. Target FW use this flag to turn on HW checksumming \
  730. * 0x0 - No checksum offload \
  731. * 0x1 - L3 header checksum only \
  732. * 0x2 - L4 checksum only \
  733. * 0x3 - L3 header checksum + L4 checksum \
  734. */ \
  735. cksum_offload: 2, \
  736. \
  737. /* tx_comp_req - \
  738. * This flag indicates whether Tx Completion \
  739. * from fw is required or not. \
  740. * This flag is only relevant if tx completion is not \
  741. * universally enabled. \
  742. * For all LL systems, tx completion is mandatory, \
  743. * so this flag will be irrelevant. \
  744. * For HL systems tx completion is optional, but HL systems in which \
  745. * the bus throughput exceeds the WLAN throughput will \
  746. * probably want to always use tx completion, and thus \
  747. * would not check this flag. \
  748. * This flag is required when tx completions are not used universally, \
  749. * but are still required for certain tx frames for which \
  750. * an OTA delivery acknowledgment is needed by the host. \
  751. * In practice, this would be for HL systems in which the \
  752. * bus throughput is less than the WLAN throughput. \
  753. * \
  754. * 0x0 - Tx Completion Indication from Fw not required \
  755. * 0x1 - Tx Completion Indication from Fw is required \
  756. */ \
  757. tx_compl_req: 1; \
  758. \
  759. \
  760. /* DWORD 1: MSDU length and ID */ \
  761. A_UINT32 \
  762. len: 16, /* MSDU length, in bytes */ \
  763. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  764. * and this id is used to calculate fragmentation \
  765. * descriptor pointer inside the target based on \
  766. * the base address, configured inside the target. \
  767. */ \
  768. \
  769. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  770. /* frags_desc_ptr - \
  771. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  772. * where the tx frame's fragments reside in memory. \
  773. * This field only applies to LL systems, since in HL systems the \
  774. * (degenerate single-fragment) fragmentation descriptor is created \
  775. * within the target. \
  776. */ \
  777. _paddr__frags_desc_ptr_; \
  778. \
  779. /* DWORD 3 (or 4): peerid, chanfreq */ \
  780. /* \
  781. * Peer ID : Target can use this value to know which peer-id packet \
  782. * destined to. \
  783. * It's intended to be specified by host in case of NAWDS. \
  784. */ \
  785. A_UINT16 peerid; \
  786. \
  787. /* \
  788. * Channel frequency: This identifies the desired channel \
  789. * frequency (in mhz) for tx frames. This is used by FW to help \
  790. * determine when it is safe to transmit or drop frames for \
  791. * off-channel operation. \
  792. * The default value of zero indicates to FW that the corresponding \
  793. * VDEV's home channel (if there is one) is the desired channel \
  794. * frequency. \
  795. */ \
  796. A_UINT16 chanfreq; \
  797. \
  798. /* Reason reserved is commented is increasing the htt structure size \
  799. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  800. * A_UINT32 reserved_dword3_bits0_31; \
  801. */ \
  802. } POSTPACK
  803. /* define a htt_tx_msdu_desc32_t type */
  804. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  805. /* define a htt_tx_msdu_desc64_t type */
  806. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  807. /*
  808. * Make htt_tx_msdu_desc_t be an alias for either
  809. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  810. */
  811. #if HTT_PADDR64
  812. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  813. #else
  814. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  815. #endif
  816. /* decriptor information for Management frame*/
  817. /*
  818. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  819. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  820. */
  821. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  822. extern A_UINT32 mgmt_hdr_len;
  823. PREPACK struct htt_mgmt_tx_desc_t {
  824. A_UINT32 msg_type;
  825. #if HTT_PADDR64
  826. A_UINT64 frag_paddr; /* DMAble address of the data */
  827. #else
  828. A_UINT32 frag_paddr; /* DMAble address of the data */
  829. #endif
  830. A_UINT32 desc_id; /* returned to host during completion
  831. * to free the meory*/
  832. A_UINT32 len; /* Fragment length */
  833. A_UINT32 vdev_id; /* virtual device ID*/
  834. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  835. } POSTPACK;
  836. PREPACK struct htt_mgmt_tx_compl_ind {
  837. A_UINT32 desc_id;
  838. A_UINT32 status;
  839. } POSTPACK;
  840. /*
  841. * This SDU header size comes from the summation of the following:
  842. * 1. Max of:
  843. * a. Native WiFi header, for native WiFi frames: 24 bytes
  844. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  845. * b. 802.11 header, for raw frames: 36 bytes
  846. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  847. * QoS header, HT header)
  848. * c. 802.3 header, for ethernet frames: 14 bytes
  849. * (destination address, source address, ethertype / length)
  850. * 2. Max of:
  851. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  852. * b. IPv6 header, up through the Traffic Class: 2 bytes
  853. * 3. 802.1Q VLAN header: 4 bytes
  854. * 4. LLC/SNAP header: 8 bytes
  855. */
  856. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  857. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  858. #define HTT_TX_HDR_SIZE_ETHERNET 14
  859. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  860. A_COMPILE_TIME_ASSERT(
  861. htt_encap_hdr_size_max_check_nwifi,
  862. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  863. A_COMPILE_TIME_ASSERT(
  864. htt_encap_hdr_size_max_check_enet,
  865. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  866. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  867. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  868. #define HTT_TX_HDR_SIZE_802_1Q 4
  869. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  870. #define HTT_COMMON_TX_FRM_HDR_LEN \
  871. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  872. HTT_TX_HDR_SIZE_802_1Q + \
  873. HTT_TX_HDR_SIZE_LLC_SNAP)
  874. #define HTT_HL_TX_FRM_HDR_LEN \
  875. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  876. #define HTT_LL_TX_FRM_HDR_LEN \
  877. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  878. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  879. /* dword 0 */
  880. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  881. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  882. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  883. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  884. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  885. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  886. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  887. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  888. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  889. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  890. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  891. #define HTT_TX_DESC_PKT_TYPE_S 13
  892. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  893. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  894. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  895. #define HTT_TX_DESC_VDEV_ID_S 16
  896. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  897. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  898. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  899. #define HTT_TX_DESC_EXT_TID_S 22
  900. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  901. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  902. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  903. #define HTT_TX_DESC_POSTPONED_S 27
  904. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  905. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  906. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  907. #define HTT_TX_DESC_EXTENSION_S 28
  908. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  909. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  910. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  911. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  912. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  913. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  914. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  915. #define HTT_TX_DESC_TX_COMP_S 31
  916. /* dword 1 */
  917. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  918. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  919. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  920. #define HTT_TX_DESC_FRM_LEN_S 0
  921. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  922. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  923. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  924. #define HTT_TX_DESC_FRM_ID_S 16
  925. /* dword 2 */
  926. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  927. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  928. /* for systems using 64-bit format for bus addresses */
  929. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  930. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  931. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  932. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  933. /* for systems using 32-bit format for bus addresses */
  934. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  935. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  936. /* dword 3 */
  937. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  938. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  939. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  940. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  941. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  942. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  943. #if HTT_PADDR64
  944. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  945. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  946. #else
  947. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  948. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  949. #endif
  950. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  951. #define HTT_TX_DESC_PEER_ID_S 0
  952. /*
  953. * TEMPORARY:
  954. * The original definitions for the PEER_ID fields contained typos
  955. * (with _DESC_PADDR appended to this PEER_ID field name).
  956. * Retain deprecated original names for PEER_ID fields until all code that
  957. * refers to them has been updated.
  958. */
  959. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  960. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  961. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  962. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  963. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  964. HTT_TX_DESC_PEER_ID_M
  965. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  966. HTT_TX_DESC_PEER_ID_S
  967. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  968. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  969. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  970. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  971. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  972. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  973. #if HTT_PADDR64
  974. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  975. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  976. #else
  977. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  978. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  979. #endif
  980. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  981. #define HTT_TX_DESC_CHAN_FREQ_S 16
  982. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  983. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  984. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  985. do { \
  986. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  987. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  988. } while (0)
  989. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  990. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  991. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  992. do { \
  993. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  994. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  995. } while (0)
  996. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  997. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  998. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  999. do { \
  1000. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  1001. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1002. } while (0)
  1003. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1004. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1005. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1006. do { \
  1007. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1008. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1009. } while (0)
  1010. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1011. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1012. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1013. do { \
  1014. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1015. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1016. } while (0)
  1017. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1018. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1019. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1020. do { \
  1021. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1022. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1023. } while (0)
  1024. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1025. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1026. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1027. do { \
  1028. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1029. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1030. } while (0)
  1031. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1032. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1033. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1034. do { \
  1035. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1036. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1037. } while (0)
  1038. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1039. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1040. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1041. do { \
  1042. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1043. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1044. } while (0)
  1045. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1046. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1047. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1048. do { \
  1049. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1050. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1051. } while (0)
  1052. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1053. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1054. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1055. do { \
  1056. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1057. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1058. } while (0)
  1059. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1060. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1061. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1062. do { \
  1063. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1064. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1065. } while (0)
  1066. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1067. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1068. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1069. do { \
  1070. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1071. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1072. } while (0)
  1073. /* enums used in the HTT tx MSDU extension descriptor */
  1074. enum {
  1075. htt_tx_guard_interval_regular = 0,
  1076. htt_tx_guard_interval_short = 1,
  1077. };
  1078. enum {
  1079. htt_tx_preamble_type_ofdm = 0,
  1080. htt_tx_preamble_type_cck = 1,
  1081. htt_tx_preamble_type_ht = 2,
  1082. htt_tx_preamble_type_vht = 3,
  1083. };
  1084. enum {
  1085. htt_tx_bandwidth_5MHz = 0,
  1086. htt_tx_bandwidth_10MHz = 1,
  1087. htt_tx_bandwidth_20MHz = 2,
  1088. htt_tx_bandwidth_40MHz = 3,
  1089. htt_tx_bandwidth_80MHz = 4,
  1090. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1091. };
  1092. /**
  1093. * @brief HTT tx MSDU extension descriptor
  1094. * @details
  1095. * If the target supports HTT tx MSDU extension descriptors, the host has
  1096. * the option of appending the following struct following the regular
  1097. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1098. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1099. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1100. * tx specs for each frame.
  1101. */
  1102. PREPACK struct htt_tx_msdu_desc_ext_t {
  1103. /* DWORD 0: flags */
  1104. A_UINT32
  1105. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1106. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1107. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1108. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1109. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1110. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1111. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1112. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1113. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1114. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1115. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1116. /* DWORD 1: tx power, tx rate, tx BW */
  1117. A_UINT32
  1118. /* pwr -
  1119. * Specify what power the tx frame needs to be transmitted at.
  1120. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1121. * The value needs to be appropriately sign-extended when extracting
  1122. * the value from the message and storing it in a variable that is
  1123. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1124. * automatically handles this sign-extension.)
  1125. * If the transmission uses multiple tx chains, this power spec is
  1126. * the total transmit power, assuming incoherent combination of
  1127. * per-chain power to produce the total power.
  1128. */
  1129. pwr: 8,
  1130. /* mcs_mask -
  1131. * Specify the allowable values for MCS index (modulation and coding)
  1132. * to use for transmitting the frame.
  1133. *
  1134. * For HT / VHT preamble types, this mask directly corresponds to
  1135. * the HT or VHT MCS indices that are allowed. For each bit N set
  1136. * within the mask, MCS index N is allowed for transmitting the frame.
  1137. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1138. * rates versus OFDM rates, so the host has the option of specifying
  1139. * that the target must transmit the frame with CCK or OFDM rates
  1140. * (not HT or VHT), but leaving the decision to the target whether
  1141. * to use CCK or OFDM.
  1142. *
  1143. * For CCK and OFDM, the bits within this mask are interpreted as
  1144. * follows:
  1145. * bit 0 -> CCK 1 Mbps rate is allowed
  1146. * bit 1 -> CCK 2 Mbps rate is allowed
  1147. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1148. * bit 3 -> CCK 11 Mbps rate is allowed
  1149. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1150. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1151. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1152. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1153. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1154. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1155. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1156. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1157. *
  1158. * The MCS index specification needs to be compatible with the
  1159. * bandwidth mask specification. For example, a MCS index == 9
  1160. * specification is inconsistent with a preamble type == VHT,
  1161. * Nss == 1, and channel bandwidth == 20 MHz.
  1162. *
  1163. * Furthermore, the host has only a limited ability to specify to
  1164. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1165. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1166. */
  1167. mcs_mask: 12,
  1168. /* nss_mask -
  1169. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1170. * Each bit in this mask corresponds to a Nss value:
  1171. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1172. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1173. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1174. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1175. * The values in the Nss mask must be suitable for the recipient, e.g.
  1176. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1177. * recipient which only supports 2x2 MIMO.
  1178. */
  1179. nss_mask: 4,
  1180. /* guard_interval -
  1181. * Specify a htt_tx_guard_interval enum value to indicate whether
  1182. * the transmission should use a regular guard interval or a
  1183. * short guard interval.
  1184. */
  1185. guard_interval: 1,
  1186. /* preamble_type_mask -
  1187. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1188. * may choose from for transmitting this frame.
  1189. * The bits in this mask correspond to the values in the
  1190. * htt_tx_preamble_type enum. For example, to allow the target
  1191. * to transmit the frame as either CCK or OFDM, this field would
  1192. * be set to
  1193. * (1 << htt_tx_preamble_type_ofdm) |
  1194. * (1 << htt_tx_preamble_type_cck)
  1195. */
  1196. preamble_type_mask: 4,
  1197. reserved1_31_29: 3; /* unused, set to 0x0 */
  1198. /* DWORD 2: tx chain mask, tx retries */
  1199. A_UINT32
  1200. /* chain_mask - specify which chains to transmit from */
  1201. chain_mask: 4,
  1202. /* retry_limit -
  1203. * Specify the maximum number of transmissions, including the
  1204. * initial transmission, to attempt before giving up if no ack
  1205. * is received.
  1206. * If the tx rate is specified, then all retries shall use the
  1207. * same rate as the initial transmission.
  1208. * If no tx rate is specified, the target can choose whether to
  1209. * retain the original rate during the retransmissions, or to
  1210. * fall back to a more robust rate.
  1211. */
  1212. retry_limit: 4,
  1213. /* bandwidth_mask -
  1214. * Specify what channel widths may be used for the transmission.
  1215. * A value of zero indicates "don't care" - the target may choose
  1216. * the transmission bandwidth.
  1217. * The bits within this mask correspond to the htt_tx_bandwidth
  1218. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1219. * The bandwidth_mask must be consistent with the preamble_type_mask
  1220. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1221. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1222. */
  1223. bandwidth_mask: 6,
  1224. reserved2_31_14: 18; /* unused, set to 0x0 */
  1225. /* DWORD 3: tx expiry time (TSF) LSBs */
  1226. A_UINT32 expire_tsf_lo;
  1227. /* DWORD 4: tx expiry time (TSF) MSBs */
  1228. A_UINT32 expire_tsf_hi;
  1229. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1230. } POSTPACK;
  1231. /* DWORD 0 */
  1232. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1233. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1234. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1235. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1236. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1237. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1238. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1239. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1240. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1241. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1242. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1243. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1244. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1245. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1246. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1247. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1248. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1249. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1250. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1251. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1252. /* DWORD 1 */
  1253. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1254. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1255. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1256. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1257. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1258. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1259. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1260. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1261. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1262. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1263. /* DWORD 2 */
  1264. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1265. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1266. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1267. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1268. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1269. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1270. /* DWORD 0 */
  1271. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1272. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1273. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1274. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1275. do { \
  1276. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1277. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1278. } while (0)
  1279. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1280. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1281. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1282. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1283. do { \
  1284. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1285. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1286. } while (0)
  1287. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1288. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1289. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1290. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1291. do { \
  1292. HTT_CHECK_SET_VAL( \
  1293. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1294. ((_var) |= ((_val) \
  1295. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1296. } while (0)
  1297. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1298. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1299. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1300. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1301. do { \
  1302. HTT_CHECK_SET_VAL( \
  1303. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1304. ((_var) |= ((_val) \
  1305. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1306. } while (0)
  1307. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1308. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1309. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1310. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1311. do { \
  1312. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1313. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1314. } while (0)
  1315. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1316. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1317. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1318. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1319. do { \
  1320. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1321. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1322. } while (0)
  1323. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1324. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1325. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1326. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1327. do { \
  1328. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1329. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1330. } while (0)
  1331. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1332. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1333. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1334. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1335. do { \
  1336. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1337. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1338. } while (0)
  1339. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1340. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1341. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1342. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1343. do { \
  1344. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1345. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1346. } while (0)
  1347. /* DWORD 1 */
  1348. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1349. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1350. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1351. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1352. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1353. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1354. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1355. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1356. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1357. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1358. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1359. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1360. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1361. do { \
  1362. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1363. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1364. } while (0)
  1365. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1366. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1367. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1368. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1369. do { \
  1370. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1371. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1372. } while (0)
  1373. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1374. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1375. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1376. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1377. do { \
  1378. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1379. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1380. } while (0)
  1381. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1382. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1383. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1384. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1385. do { \
  1386. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1387. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1388. } while (0)
  1389. /* DWORD 2 */
  1390. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1391. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1392. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1393. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1394. do { \
  1395. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1396. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1397. } while (0)
  1398. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1399. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1400. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1401. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1402. do { \
  1403. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1404. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1405. } while (0)
  1406. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1407. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1408. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1409. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1410. do { \
  1411. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1412. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1413. } while (0)
  1414. typedef enum {
  1415. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1416. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1417. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1418. } htt_11ax_ltf_subtype_t;
  1419. typedef enum {
  1420. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1421. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1422. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1423. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1424. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1425. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1426. } htt_tx_ext2_preamble_type_t;
  1427. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1428. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1429. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1430. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1431. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1432. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1433. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1434. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1435. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1436. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1437. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1438. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1439. /**
  1440. * @brief HTT tx MSDU extension descriptor v2
  1441. * @details
  1442. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1443. * is received as tcl_exit_base->host_meta_info in firmware.
  1444. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1445. * are already part of tcl_exit_base.
  1446. */
  1447. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1448. /* DWORD 0: flags */
  1449. A_UINT32
  1450. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1451. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1452. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1453. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1454. valid_retries : 1, /* if set, tx retries spec is valid */
  1455. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1456. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1457. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1458. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1459. valid_key_flags : 1, /* if set, key flags is valid */
  1460. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1461. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1462. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1463. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1464. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1465. 1 = ENCRYPT,
  1466. 2 ~ 3 - Reserved */
  1467. /* retry_limit -
  1468. * Specify the maximum number of transmissions, including the
  1469. * initial transmission, to attempt before giving up if no ack
  1470. * is received.
  1471. * If the tx rate is specified, then all retries shall use the
  1472. * same rate as the initial transmission.
  1473. * If no tx rate is specified, the target can choose whether to
  1474. * retain the original rate during the retransmissions, or to
  1475. * fall back to a more robust rate.
  1476. */
  1477. retry_limit : 4,
  1478. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1479. * Valid only for 11ax preamble types HE_SU
  1480. * and HE_EXT_SU
  1481. */
  1482. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1483. * Valid only for 11ax preamble types HE_SU
  1484. * and HE_EXT_SU
  1485. */
  1486. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1487. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1488. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1489. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1490. */
  1491. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1492. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1493. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1494. * Use cases:
  1495. * Any time firmware uses TQM-BYPASS for Data
  1496. * TID, firmware expect host to set this bit.
  1497. */
  1498. /* DWORD 1: tx power, tx rate */
  1499. A_UINT32
  1500. power : 8, /* unit of the power field is 0.5 dbm
  1501. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1502. * signed value ranging from -64dbm to 63.5 dbm
  1503. */
  1504. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1505. * Setting more than one MCS isn't currently
  1506. * supported by the target (but is supported
  1507. * in the interface in case in the future
  1508. * the target supports specifications of
  1509. * a limited set of MCS values.
  1510. */
  1511. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1512. * Setting more than one Nss isn't currently
  1513. * supported by the target (but is supported
  1514. * in the interface in case in the future
  1515. * the target supports specifications of
  1516. * a limited set of Nss values.
  1517. */
  1518. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1519. update_peer_cache : 1; /* When set these custom values will be
  1520. * used for all packets, until the next
  1521. * update via this ext header.
  1522. * This is to make sure not all packets
  1523. * need to include this header.
  1524. */
  1525. /* DWORD 2: tx chain mask, tx retries */
  1526. A_UINT32
  1527. /* chain_mask - specify which chains to transmit from */
  1528. chain_mask : 8,
  1529. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1530. * TODO: Update Enum values for key_flags
  1531. */
  1532. /*
  1533. * Channel frequency: This identifies the desired channel
  1534. * frequency (in MHz) for tx frames. This is used by FW to help
  1535. * determine when it is safe to transmit or drop frames for
  1536. * off-channel operation.
  1537. * The default value of zero indicates to FW that the corresponding
  1538. * VDEV's home channel (if there is one) is the desired channel
  1539. * frequency.
  1540. */
  1541. chanfreq : 16;
  1542. /* DWORD 3: tx expiry time (TSF) LSBs */
  1543. A_UINT32 expire_tsf_lo;
  1544. /* DWORD 4: tx expiry time (TSF) MSBs */
  1545. A_UINT32 expire_tsf_hi;
  1546. /* DWORD 5: flags to control routing / processing of the MSDU */
  1547. A_UINT32
  1548. /* learning_frame
  1549. * When this flag is set, this frame will be dropped by FW
  1550. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1551. */
  1552. learning_frame : 1,
  1553. /* send_as_standalone
  1554. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1555. * i.e. with no A-MSDU or A-MPDU aggregation.
  1556. * The scope is extended to other use-cases.
  1557. */
  1558. send_as_standalone : 1,
  1559. /* is_host_opaque_valid
  1560. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1561. * with valid information.
  1562. */
  1563. is_host_opaque_valid : 1,
  1564. rsvd0 : 29;
  1565. /* DWORD 6 : Host opaque cookie for special frames */
  1566. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1567. rsvd1 : 16;
  1568. /*
  1569. * This structure can be expanded further up to 40 bytes
  1570. * by adding further DWORDs as needed.
  1571. */
  1572. } POSTPACK;
  1573. /* DWORD 0 */
  1574. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1575. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1576. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1577. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1578. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1579. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1580. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1581. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1582. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1583. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1584. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1585. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1586. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1587. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1588. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1589. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1590. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1591. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1592. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1593. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1594. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1595. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1596. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1597. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1598. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1599. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1600. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1601. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1602. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1603. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1604. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1605. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1606. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1607. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1608. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1609. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1610. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1611. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1612. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1613. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1614. /* DWORD 1 */
  1615. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1616. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1617. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1618. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1619. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1620. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1621. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1622. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1623. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1624. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1625. /* DWORD 2 */
  1626. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1627. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1628. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1629. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1630. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1631. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1632. /* DWORD 5 */
  1633. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1634. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1635. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1636. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1637. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1638. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1639. /* DWORD 6 */
  1640. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1641. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1642. /* DWORD 0 */
  1643. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1644. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1645. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1646. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1647. do { \
  1648. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1649. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1650. } while (0)
  1651. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1652. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1653. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1654. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1655. do { \
  1656. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1657. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1658. } while (0)
  1659. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1660. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1661. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1662. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1663. do { \
  1664. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1665. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1666. } while (0)
  1667. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1668. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1669. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1670. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1671. do { \
  1672. HTT_CHECK_SET_VAL( \
  1673. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1674. ((_var) |= ((_val) \
  1675. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1676. } while (0)
  1677. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1678. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1679. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1680. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1681. do { \
  1682. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1683. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1684. } while (0)
  1685. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1686. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1687. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1688. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1689. do { \
  1690. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1691. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1692. } while (0)
  1693. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1694. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1695. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1696. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1697. do { \
  1698. HTT_CHECK_SET_VAL( \
  1699. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1700. ((_var) |= ((_val) \
  1701. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1702. } while (0)
  1703. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1704. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1705. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1706. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1707. do { \
  1708. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1709. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1710. } while (0)
  1711. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1712. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1713. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1714. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1715. do { \
  1716. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1717. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1718. } while (0)
  1719. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1720. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1721. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1722. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1723. do { \
  1724. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1725. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1726. } while (0)
  1727. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1728. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1729. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1730. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1731. do { \
  1732. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1733. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1734. } while (0)
  1735. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1736. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1737. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1738. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1739. do { \
  1740. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1741. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1742. } while (0)
  1743. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1744. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1745. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1746. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1747. do { \
  1748. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1749. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1750. } while (0)
  1751. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1752. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1753. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1754. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1755. do { \
  1756. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1757. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1758. } while (0)
  1759. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1760. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1761. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1762. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1763. do { \
  1764. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1765. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1766. } while (0)
  1767. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1768. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1769. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1770. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1771. do { \
  1772. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  1773. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  1774. } while (0)
  1775. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1776. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1777. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1778. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1779. do { \
  1780. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  1781. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  1782. } while (0)
  1783. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1784. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1785. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1786. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1787. do { \
  1788. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  1789. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1790. } while (0)
  1791. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1792. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1793. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1794. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1795. do { \
  1796. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1797. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  1798. } while (0)
  1799. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1800. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1801. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1802. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1803. do { \
  1804. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  1805. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1806. } while (0)
  1807. /* DWORD 1 */
  1808. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1809. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1810. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1811. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1812. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1813. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1814. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1815. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1816. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  1817. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  1818. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  1819. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  1820. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  1821. do { \
  1822. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  1823. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  1824. } while (0)
  1825. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  1826. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  1827. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  1828. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  1829. do { \
  1830. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  1831. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  1832. } while (0)
  1833. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  1834. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  1835. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  1836. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  1837. do { \
  1838. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  1839. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  1840. } while (0)
  1841. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  1842. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  1843. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  1844. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  1845. do { \
  1846. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  1847. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  1848. } while (0)
  1849. /* DWORD 2 */
  1850. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  1851. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  1852. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  1853. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  1854. do { \
  1855. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  1856. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  1857. } while (0)
  1858. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  1859. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  1860. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  1861. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  1862. do { \
  1863. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  1864. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  1865. } while (0)
  1866. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  1867. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  1868. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  1869. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  1870. do { \
  1871. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  1872. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  1873. } while (0)
  1874. /* DWORD 5 */
  1875. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  1876. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  1877. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  1878. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  1879. do { \
  1880. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  1881. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  1882. } while (0)
  1883. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  1884. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  1885. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  1886. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  1887. do { \
  1888. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  1889. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  1890. } while (0)
  1891. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  1892. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  1893. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  1894. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  1895. do { \
  1896. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  1897. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  1898. } while (0)
  1899. /* DWORD 6 */
  1900. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  1901. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  1902. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  1903. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  1904. do { \
  1905. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  1906. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  1907. } while (0)
  1908. typedef enum {
  1909. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  1910. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  1911. } htt_tcl_metadata_type;
  1912. /**
  1913. * @brief HTT TCL command number format
  1914. * @details
  1915. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  1916. * available to firmware as tcl_exit_base->tcl_status_number.
  1917. * For regular / multicast packets host will send vdev and mac id and for
  1918. * NAWDS packets, host will send peer id.
  1919. * A_UINT32 is used to avoid endianness conversion problems.
  1920. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  1921. */
  1922. typedef struct {
  1923. A_UINT32
  1924. type: 1, /* vdev_id based or peer_id based */
  1925. rsvd: 31;
  1926. } htt_tx_tcl_vdev_or_peer_t;
  1927. typedef struct {
  1928. A_UINT32
  1929. type: 1, /* vdev_id based or peer_id based */
  1930. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1931. vdev_id: 8,
  1932. pdev_id: 2,
  1933. host_inspected:1,
  1934. rsvd: 19;
  1935. } htt_tx_tcl_vdev_metadata;
  1936. typedef struct {
  1937. A_UINT32
  1938. type: 1, /* vdev_id based or peer_id based */
  1939. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1940. peer_id: 14,
  1941. rsvd: 16;
  1942. } htt_tx_tcl_peer_metadata;
  1943. PREPACK struct htt_tx_tcl_metadata {
  1944. union {
  1945. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  1946. htt_tx_tcl_vdev_metadata vdev_meta;
  1947. htt_tx_tcl_peer_metadata peer_meta;
  1948. };
  1949. } POSTPACK;
  1950. /* DWORD 0 */
  1951. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  1952. #define HTT_TX_TCL_METADATA_TYPE_S 0
  1953. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  1954. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  1955. /* VDEV metadata */
  1956. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  1957. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  1958. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  1959. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  1960. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  1961. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  1962. /* PEER metadata */
  1963. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  1964. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  1965. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  1966. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  1967. HTT_TX_TCL_METADATA_TYPE_S)
  1968. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  1969. do { \
  1970. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  1971. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  1972. } while (0)
  1973. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  1974. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  1975. HTT_TX_TCL_METADATA_VALID_HTT_S)
  1976. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  1977. do { \
  1978. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  1979. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  1980. } while (0)
  1981. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  1982. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  1983. HTT_TX_TCL_METADATA_VDEV_ID_S)
  1984. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  1985. do { \
  1986. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  1987. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  1988. } while (0)
  1989. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  1990. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  1991. HTT_TX_TCL_METADATA_PDEV_ID_S)
  1992. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  1993. do { \
  1994. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  1995. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  1996. } while (0)
  1997. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  1998. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  1999. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  2000. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  2001. do { \
  2002. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2003. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2004. } while (0)
  2005. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2006. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2007. HTT_TX_TCL_METADATA_PEER_ID_S)
  2008. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2009. do { \
  2010. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2011. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2012. } while (0)
  2013. typedef enum {
  2014. HTT_TX_FW2WBM_TX_STATUS_OK,
  2015. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2016. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2017. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2018. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2019. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2020. HTT_TX_FW2WBM_TX_STATUS_MAX
  2021. } htt_tx_fw2wbm_tx_status_t;
  2022. typedef enum {
  2023. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2024. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2025. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2026. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2027. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2028. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2029. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2030. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2031. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2032. } htt_tx_fw2wbm_reinject_reason_t;
  2033. /**
  2034. * @brief HTT TX WBM Completion from firmware to host
  2035. * @details
  2036. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2037. * DWORD 3 and 4 for software based completions (Exception frames and
  2038. * TQM bypass frames)
  2039. * For software based completions, wbm_release_ring->release_source_module will
  2040. * be set to release_source_fw
  2041. */
  2042. PREPACK struct htt_tx_wbm_completion {
  2043. A_UINT32
  2044. sch_cmd_id: 24,
  2045. exception_frame: 1, /* If set, this packet was queued via exception path */
  2046. rsvd0_31_25: 7;
  2047. A_UINT32
  2048. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2049. * reception of an ACK or BA, this field indicates
  2050. * the RSSI of the received ACK or BA frame.
  2051. * When the frame is removed as result of a direct
  2052. * remove command from the SW, this field is set
  2053. * to 0x0 (which is never a valid value when real
  2054. * RSSI is available).
  2055. * Units: dB w.r.t noise floor
  2056. */
  2057. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2058. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2059. rsvd1_31_16: 16;
  2060. } POSTPACK;
  2061. /* DWORD 0 */
  2062. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2063. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2064. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2065. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2066. /* DWORD 1 */
  2067. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2068. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2069. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2070. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2071. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2072. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2073. /* DWORD 0 */
  2074. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2075. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2076. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2077. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2078. do { \
  2079. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2080. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2081. } while (0)
  2082. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2083. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2084. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2085. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2086. do { \
  2087. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2088. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2089. } while (0)
  2090. /* DWORD 1 */
  2091. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2092. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2093. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2094. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2095. do { \
  2096. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2097. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2098. } while (0)
  2099. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2100. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2101. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2102. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2103. do { \
  2104. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2105. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2106. } while (0)
  2107. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2108. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2109. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2110. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2111. do { \
  2112. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2113. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2114. } while (0)
  2115. /**
  2116. * @brief HTT TX WBM Completion from firmware to host
  2117. * @details
  2118. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2119. * (WBM) offload HW.
  2120. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2121. * For software based completions, release_source_module will
  2122. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2123. * struct wbm_release_ring and then switch to this after looking at
  2124. * release_source_module.
  2125. */
  2126. PREPACK struct htt_tx_wbm_completion_v2 {
  2127. A_UINT32
  2128. used_by_hw0; /* Refer to struct wbm_release_ring */
  2129. A_UINT32
  2130. used_by_hw1; /* Refer to struct wbm_release_ring */
  2131. A_UINT32
  2132. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2133. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2134. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2135. exception_frame: 1,
  2136. rsvd0: 12, /* For future use */
  2137. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2138. rsvd1: 1; /* For future use */
  2139. A_UINT32
  2140. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2141. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2142. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2143. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2144. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2145. */
  2146. A_UINT32
  2147. data1: 32;
  2148. A_UINT32
  2149. data2: 32;
  2150. A_UINT32
  2151. used_by_hw3; /* Refer to struct wbm_release_ring */
  2152. } POSTPACK;
  2153. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2154. /* DWORD 3 */
  2155. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2156. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2157. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2158. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2159. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2160. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2161. /* DWORD 3 */
  2162. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2163. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2164. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2165. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2166. do { \
  2167. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2168. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2169. } while (0)
  2170. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2171. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2172. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2173. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2174. do { \
  2175. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2176. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2177. } while (0)
  2178. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2179. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2180. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2181. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2182. do { \
  2183. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2184. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2185. } while (0)
  2186. /**
  2187. * @brief HTT TX WBM transmit status from firmware to host
  2188. * @details
  2189. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2190. * (WBM) offload HW.
  2191. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2192. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2193. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2194. */
  2195. PREPACK struct htt_tx_wbm_transmit_status {
  2196. A_UINT32
  2197. sch_cmd_id: 24,
  2198. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2199. * reception of an ACK or BA, this field indicates
  2200. * the RSSI of the received ACK or BA frame.
  2201. * When the frame is removed as result of a direct
  2202. * remove command from the SW, this field is set
  2203. * to 0x0 (which is never a valid value when real
  2204. * RSSI is available).
  2205. * Units: dB w.r.t noise floor
  2206. */
  2207. A_UINT32
  2208. sw_peer_id: 16,
  2209. tid_num: 5,
  2210. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2211. * and tid_num fields contain valid data.
  2212. * If this "valid" flag is not set, the
  2213. * sw_peer_id and tid_num fields must be ignored.
  2214. */
  2215. mcast: 1,
  2216. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2217. * contains valid data.
  2218. */
  2219. reserved0: 8;
  2220. A_UINT32
  2221. reserved1: 32;
  2222. } POSTPACK;
  2223. /* DWORD 4 */
  2224. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2225. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2226. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2227. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2228. /* DWORD 5 */
  2229. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2230. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2231. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2232. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2233. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2234. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2235. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2236. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2237. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2238. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2239. /* DWORD 4 */
  2240. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2241. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2242. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2243. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2244. do { \
  2245. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2246. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2247. } while (0)
  2248. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2249. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2250. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2251. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2252. do { \
  2253. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2254. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2255. } while (0)
  2256. /* DWORD 5 */
  2257. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2258. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2259. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2260. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2261. do { \
  2262. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2263. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2264. } while (0)
  2265. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2266. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2267. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2268. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2269. do { \
  2270. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2271. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2272. } while (0)
  2273. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2274. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2275. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2276. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2277. do { \
  2278. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2279. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2280. } while (0)
  2281. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2282. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2283. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2284. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2285. do { \
  2286. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2287. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2288. } while (0)
  2289. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2290. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2291. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2292. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2293. do { \
  2294. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2295. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2296. } while (0)
  2297. /**
  2298. * @brief HTT TX WBM reinject status from firmware to host
  2299. * @details
  2300. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2301. * (WBM) offload HW.
  2302. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2303. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2304. */
  2305. PREPACK struct htt_tx_wbm_reinject_status {
  2306. A_UINT32
  2307. reserved0: 32;
  2308. A_UINT32
  2309. reserved1: 32;
  2310. A_UINT32
  2311. reserved2: 32;
  2312. } POSTPACK;
  2313. /**
  2314. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2315. * @details
  2316. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2317. * (WBM) offload HW.
  2318. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2319. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2320. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2321. * STA side.
  2322. */
  2323. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2324. A_UINT32
  2325. mec_sa_addr_31_0;
  2326. A_UINT32
  2327. mec_sa_addr_47_32: 16,
  2328. sa_ast_index: 16;
  2329. A_UINT32
  2330. vdev_id: 8,
  2331. reserved0: 24;
  2332. } POSTPACK;
  2333. /* DWORD 4 - mec_sa_addr_31_0 */
  2334. /* DWORD 5 */
  2335. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2336. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2337. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2338. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2339. /* DWORD 6 */
  2340. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2341. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2342. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2343. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2344. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2345. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2346. do { \
  2347. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2348. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2349. } while (0)
  2350. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2351. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2352. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2353. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2354. do { \
  2355. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2356. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2357. } while (0)
  2358. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2359. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2360. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2361. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2362. do { \
  2363. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2364. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2365. } while (0)
  2366. typedef enum {
  2367. TX_FLOW_PRIORITY_BE,
  2368. TX_FLOW_PRIORITY_HIGH,
  2369. TX_FLOW_PRIORITY_LOW,
  2370. } htt_tx_flow_priority_t;
  2371. typedef enum {
  2372. TX_FLOW_LATENCY_SENSITIVE,
  2373. TX_FLOW_LATENCY_INSENSITIVE,
  2374. } htt_tx_flow_latency_t;
  2375. typedef enum {
  2376. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2377. TX_FLOW_INTERACTIVE_TRAFFIC,
  2378. TX_FLOW_PERIODIC_TRAFFIC,
  2379. TX_FLOW_BURSTY_TRAFFIC,
  2380. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2381. } htt_tx_flow_traffic_pattern_t;
  2382. /**
  2383. * @brief HTT TX Flow search metadata format
  2384. * @details
  2385. * Host will set this metadata in flow table's flow search entry along with
  2386. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2387. * firmware and TQM ring if the flow search entry wins.
  2388. * This metadata is available to firmware in that first MSDU's
  2389. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2390. * to one of the available flows for specific tid and returns the tqm flow
  2391. * pointer as part of htt_tx_map_flow_info message.
  2392. */
  2393. PREPACK struct htt_tx_flow_metadata {
  2394. A_UINT32
  2395. rsvd0_1_0: 2,
  2396. tid: 4,
  2397. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2398. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2399. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2400. * Else choose final tid based on latency, priority.
  2401. */
  2402. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2403. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2404. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2405. } POSTPACK;
  2406. /* DWORD 0 */
  2407. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2408. #define HTT_TX_FLOW_METADATA_TID_S 2
  2409. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2410. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2411. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2412. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2413. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2414. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2415. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2416. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2417. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2418. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2419. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2420. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2421. /* DWORD 0 */
  2422. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2423. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2424. HTT_TX_FLOW_METADATA_TID_S)
  2425. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2426. do { \
  2427. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2428. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2429. } while (0)
  2430. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2431. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2432. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2433. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2434. do { \
  2435. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2436. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2437. } while (0)
  2438. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2439. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2440. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2441. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2442. do { \
  2443. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2444. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2445. } while (0)
  2446. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2447. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2448. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2449. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2450. do { \
  2451. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2452. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2453. } while (0)
  2454. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2455. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2456. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2457. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2458. do { \
  2459. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2460. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2461. } while (0)
  2462. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2463. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2464. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2465. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2466. do { \
  2467. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2468. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2469. } while (0)
  2470. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2471. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2472. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2473. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2474. do { \
  2475. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2476. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2477. } while (0)
  2478. /**
  2479. * @brief Used in HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY and HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY messages
  2480. *
  2481. * @details
  2482. * HTT wds entry from source port learning
  2483. * Host will learn wds entries from rx and send this message to firmware
  2484. * to enable firmware to configure/delete AST entries for wds clients.
  2485. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2486. * and when SA's entry is deleted, firmware removes this AST entry
  2487. *
  2488. * The message would appear as follows:
  2489. *
  2490. * |31 30|29 |17 16|15 8|7 0|
  2491. * |----------------+----------------+----------------+----------------|
  2492. * | rsvd0 |PDVID| vdev_id | msg_type |
  2493. * |-------------------------------------------------------------------|
  2494. * | sa_addr_31_0 |
  2495. * |-------------------------------------------------------------------|
  2496. * | | ta_peer_id | sa_addr_47_32 |
  2497. * |-------------------------------------------------------------------|
  2498. * Where PDVID = pdev_id
  2499. *
  2500. * The message is interpreted as follows:
  2501. *
  2502. * dword0 - b'0:7 - msg_type: This will be set to
  2503. * HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY or
  2504. * HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2505. *
  2506. * dword0 - b'8:15 - vdev_id
  2507. *
  2508. * dword0 - b'16:17 - pdev_id
  2509. *
  2510. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2511. *
  2512. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2513. *
  2514. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2515. *
  2516. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2517. */
  2518. PREPACK struct htt_wds_entry {
  2519. A_UINT32
  2520. msg_type: 8,
  2521. vdev_id: 8,
  2522. pdev_id: 2,
  2523. rsvd0: 14;
  2524. A_UINT32 sa_addr_31_0;
  2525. A_UINT32
  2526. sa_addr_47_32: 16,
  2527. ta_peer_id: 14,
  2528. rsvd2: 2;
  2529. } POSTPACK;
  2530. /* DWORD 0 */
  2531. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2532. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2533. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2534. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2535. /* DWORD 2 */
  2536. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2537. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2538. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2539. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2540. /* DWORD 0 */
  2541. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2542. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2543. HTT_WDS_ENTRY_VDEV_ID_S)
  2544. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2545. do { \
  2546. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2547. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2548. } while (0)
  2549. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2550. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2551. HTT_WDS_ENTRY_PDEV_ID_S)
  2552. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2553. do { \
  2554. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2555. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2556. } while (0)
  2557. /* DWORD 2 */
  2558. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2559. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2560. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2561. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2562. do { \
  2563. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2564. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2565. } while (0)
  2566. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2567. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2568. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2569. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2570. do { \
  2571. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2572. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2573. } while (0)
  2574. /**
  2575. * @brief MAC DMA rx ring setup specification
  2576. * @details
  2577. * To allow for dynamic rx ring reconfiguration and to avoid race
  2578. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2579. * it uses. Instead, it sends this message to the target, indicating how
  2580. * the rx ring used by the host should be set up and maintained.
  2581. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2582. * specifications.
  2583. *
  2584. * |31 16|15 8|7 0|
  2585. * |---------------------------------------------------------------|
  2586. * header: | reserved | num rings | msg type |
  2587. * |---------------------------------------------------------------|
  2588. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2589. #if HTT_PADDR64
  2590. * | FW_IDX shadow register physical address (bits 63:32) |
  2591. #endif
  2592. * |---------------------------------------------------------------|
  2593. * | rx ring base physical address (bits 31:0) |
  2594. #if HTT_PADDR64
  2595. * | rx ring base physical address (bits 63:32) |
  2596. #endif
  2597. * |---------------------------------------------------------------|
  2598. * | rx ring buffer size | rx ring length |
  2599. * |---------------------------------------------------------------|
  2600. * | FW_IDX initial value | enabled flags |
  2601. * |---------------------------------------------------------------|
  2602. * | MSDU payload offset | 802.11 header offset |
  2603. * |---------------------------------------------------------------|
  2604. * | PPDU end offset | PPDU start offset |
  2605. * |---------------------------------------------------------------|
  2606. * | MPDU end offset | MPDU start offset |
  2607. * |---------------------------------------------------------------|
  2608. * | MSDU end offset | MSDU start offset |
  2609. * |---------------------------------------------------------------|
  2610. * | frag info offset | rx attention offset |
  2611. * |---------------------------------------------------------------|
  2612. * payload 2, if present, has the same format as payload 1
  2613. * Header fields:
  2614. * - MSG_TYPE
  2615. * Bits 7:0
  2616. * Purpose: identifies this as an rx ring configuration message
  2617. * Value: 0x2
  2618. * - NUM_RINGS
  2619. * Bits 15:8
  2620. * Purpose: indicates whether the host is setting up one rx ring or two
  2621. * Value: 1 or 2
  2622. * Payload:
  2623. * for systems using 64-bit format for bus addresses:
  2624. * - IDX_SHADOW_REG_PADDR_LO
  2625. * Bits 31:0
  2626. * Value: lower 4 bytes of physical address of the host's
  2627. * FW_IDX shadow register
  2628. * - IDX_SHADOW_REG_PADDR_HI
  2629. * Bits 31:0
  2630. * Value: upper 4 bytes of physical address of the host's
  2631. * FW_IDX shadow register
  2632. * - RING_BASE_PADDR_LO
  2633. * Bits 31:0
  2634. * Value: lower 4 bytes of physical address of the host's rx ring
  2635. * - RING_BASE_PADDR_HI
  2636. * Bits 31:0
  2637. * Value: uppper 4 bytes of physical address of the host's rx ring
  2638. * for systems using 32-bit format for bus addresses:
  2639. * - IDX_SHADOW_REG_PADDR
  2640. * Bits 31:0
  2641. * Value: physical address of the host's FW_IDX shadow register
  2642. * - RING_BASE_PADDR
  2643. * Bits 31:0
  2644. * Value: physical address of the host's rx ring
  2645. * - RING_LEN
  2646. * Bits 15:0
  2647. * Value: number of elements in the rx ring
  2648. * - RING_BUF_SZ
  2649. * Bits 31:16
  2650. * Value: size of the buffers referenced by the rx ring, in byte units
  2651. * - ENABLED_FLAGS
  2652. * Bits 15:0
  2653. * Value: 1-bit flags to show whether different rx fields are enabled
  2654. * bit 0: 802.11 header enabled (1) or disabled (0)
  2655. * bit 1: MSDU payload enabled (1) or disabled (0)
  2656. * bit 2: PPDU start enabled (1) or disabled (0)
  2657. * bit 3: PPDU end enabled (1) or disabled (0)
  2658. * bit 4: MPDU start enabled (1) or disabled (0)
  2659. * bit 5: MPDU end enabled (1) or disabled (0)
  2660. * bit 6: MSDU start enabled (1) or disabled (0)
  2661. * bit 7: MSDU end enabled (1) or disabled (0)
  2662. * bit 8: rx attention enabled (1) or disabled (0)
  2663. * bit 9: frag info enabled (1) or disabled (0)
  2664. * bit 10: unicast rx enabled (1) or disabled (0)
  2665. * bit 11: multicast rx enabled (1) or disabled (0)
  2666. * bit 12: ctrl rx enabled (1) or disabled (0)
  2667. * bit 13: mgmt rx enabled (1) or disabled (0)
  2668. * bit 14: null rx enabled (1) or disabled (0)
  2669. * bit 15: phy data rx enabled (1) or disabled (0)
  2670. * - IDX_INIT_VAL
  2671. * Bits 31:16
  2672. * Purpose: Specify the initial value for the FW_IDX.
  2673. * Value: the number of buffers initially present in the host's rx ring
  2674. * - OFFSET_802_11_HDR
  2675. * Bits 15:0
  2676. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2677. * - OFFSET_MSDU_PAYLOAD
  2678. * Bits 31:16
  2679. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2680. * - OFFSET_PPDU_START
  2681. * Bits 15:0
  2682. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2683. * - OFFSET_PPDU_END
  2684. * Bits 31:16
  2685. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2686. * - OFFSET_MPDU_START
  2687. * Bits 15:0
  2688. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2689. * - OFFSET_MPDU_END
  2690. * Bits 31:16
  2691. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2692. * - OFFSET_MSDU_START
  2693. * Bits 15:0
  2694. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2695. * - OFFSET_MSDU_END
  2696. * Bits 31:16
  2697. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2698. * - OFFSET_RX_ATTN
  2699. * Bits 15:0
  2700. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2701. * - OFFSET_FRAG_INFO
  2702. * Bits 31:16
  2703. * Value: offset in QUAD-bytes of frag info table
  2704. */
  2705. /* header fields */
  2706. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2707. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2708. /* payload fields */
  2709. /* for systems using a 64-bit format for bus addresses */
  2710. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2711. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2712. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2713. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2714. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2715. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2716. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2717. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2718. /* for systems using a 32-bit format for bus addresses */
  2719. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2720. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2721. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2722. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2723. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2724. #define HTT_RX_RING_CFG_LEN_S 0
  2725. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2726. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2727. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2728. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2729. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2730. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2731. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2732. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2733. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2734. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2735. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2736. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2737. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2738. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2739. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2740. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2741. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2742. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2743. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2744. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2745. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2746. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2747. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2748. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2749. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2750. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2751. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2752. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2753. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2754. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2755. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2756. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2757. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2758. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2759. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2760. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2761. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2762. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2763. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2764. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2765. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2766. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2767. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2768. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2769. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2770. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2771. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2772. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2773. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2774. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2775. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2776. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2777. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2778. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2779. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2780. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2781. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2782. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2783. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2784. #if HTT_PADDR64
  2785. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2786. #else
  2787. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2788. #endif
  2789. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2790. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2791. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2792. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2793. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2794. do { \
  2795. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2796. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2797. } while (0)
  2798. /* degenerate case for 32-bit fields */
  2799. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  2800. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  2801. ((_var) = (_val))
  2802. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  2803. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  2804. ((_var) = (_val))
  2805. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  2806. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  2807. ((_var) = (_val))
  2808. /* degenerate case for 32-bit fields */
  2809. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  2810. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  2811. ((_var) = (_val))
  2812. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  2813. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  2814. ((_var) = (_val))
  2815. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  2816. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  2817. ((_var) = (_val))
  2818. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  2819. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  2820. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  2821. do { \
  2822. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  2823. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  2824. } while (0)
  2825. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  2826. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  2827. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  2828. do { \
  2829. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  2830. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  2831. } while (0)
  2832. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  2833. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  2834. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  2835. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  2836. do { \
  2837. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  2838. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  2839. } while (0)
  2840. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  2841. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  2842. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  2843. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  2844. do { \
  2845. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  2846. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  2847. } while (0)
  2848. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  2849. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  2850. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  2851. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  2852. do { \
  2853. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  2854. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  2855. } while (0)
  2856. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  2857. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  2858. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  2859. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  2860. do { \
  2861. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  2862. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  2863. } while (0)
  2864. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  2865. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  2866. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  2867. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  2868. do { \
  2869. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  2870. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  2871. } while (0)
  2872. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  2873. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  2874. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  2875. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  2876. do { \
  2877. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  2878. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  2879. } while (0)
  2880. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  2881. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  2882. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  2883. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  2884. do { \
  2885. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  2886. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  2887. } while (0)
  2888. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  2889. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  2890. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  2891. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  2892. do { \
  2893. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  2894. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  2895. } while (0)
  2896. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  2897. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  2898. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  2899. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  2900. do { \
  2901. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  2902. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  2903. } while (0)
  2904. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  2905. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  2906. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  2907. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  2908. do { \
  2909. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  2910. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  2911. } while (0)
  2912. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  2913. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  2914. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  2915. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  2916. do { \
  2917. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  2918. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  2919. } while (0)
  2920. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  2921. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  2922. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  2923. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  2924. do { \
  2925. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  2926. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  2927. } while (0)
  2928. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  2929. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  2930. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  2931. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  2932. do { \
  2933. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  2934. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  2935. } while (0)
  2936. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  2937. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  2938. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  2939. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  2940. do { \
  2941. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  2942. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  2943. } while (0)
  2944. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  2945. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  2946. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  2947. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  2948. do { \
  2949. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  2950. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  2951. } while (0)
  2952. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  2953. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  2954. HTT_RX_RING_CFG_ENABLED_NULL_S)
  2955. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  2956. do { \
  2957. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  2958. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  2959. } while (0)
  2960. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  2961. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  2962. HTT_RX_RING_CFG_ENABLED_PHY_S)
  2963. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  2964. do { \
  2965. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  2966. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  2967. } while (0)
  2968. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  2969. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  2970. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  2971. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  2972. do { \
  2973. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  2974. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  2975. } while (0)
  2976. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  2977. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  2978. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  2979. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  2980. do { \
  2981. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  2982. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  2983. } while (0)
  2984. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  2985. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  2986. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  2987. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  2988. do { \
  2989. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  2990. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  2991. } while (0)
  2992. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  2993. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  2994. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  2995. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  2996. do { \
  2997. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  2998. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  2999. } while (0)
  3000. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3001. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3002. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3003. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3004. do { \
  3005. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3006. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3007. } while (0)
  3008. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3009. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3010. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3011. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3012. do { \
  3013. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3014. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3015. } while (0)
  3016. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3017. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3018. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3019. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3020. do { \
  3021. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3022. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3023. } while (0)
  3024. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3025. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3026. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3027. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3028. do { \
  3029. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3030. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3031. } while (0)
  3032. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3033. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3034. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3035. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3036. do { \
  3037. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3038. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3039. } while (0)
  3040. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3041. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3042. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3043. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3044. do { \
  3045. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3046. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3047. } while (0)
  3048. /**
  3049. * @brief host -> target FW statistics retrieve
  3050. *
  3051. * @details
  3052. * The following field definitions describe the format of the HTT host
  3053. * to target FW stats retrieve message. The message specifies the type of
  3054. * stats host wants to retrieve.
  3055. *
  3056. * |31 24|23 16|15 8|7 0|
  3057. * |-----------------------------------------------------------|
  3058. * | stats types request bitmask | msg type |
  3059. * |-----------------------------------------------------------|
  3060. * | stats types reset bitmask | reserved |
  3061. * |-----------------------------------------------------------|
  3062. * | stats type | config value |
  3063. * |-----------------------------------------------------------|
  3064. * | cookie LSBs |
  3065. * |-----------------------------------------------------------|
  3066. * | cookie MSBs |
  3067. * |-----------------------------------------------------------|
  3068. * Header fields:
  3069. * - MSG_TYPE
  3070. * Bits 7:0
  3071. * Purpose: identifies this is a stats upload request message
  3072. * Value: 0x3
  3073. * - UPLOAD_TYPES
  3074. * Bits 31:8
  3075. * Purpose: identifies which types of FW statistics to upload
  3076. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3077. * - RESET_TYPES
  3078. * Bits 31:8
  3079. * Purpose: identifies which types of FW statistics to reset
  3080. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3081. * - CFG_VAL
  3082. * Bits 23:0
  3083. * Purpose: give an opaque configuration value to the specified stats type
  3084. * Value: stats-type specific configuration value
  3085. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3086. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3087. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3088. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3089. * - CFG_STAT_TYPE
  3090. * Bits 31:24
  3091. * Purpose: specify which stats type (if any) the config value applies to
  3092. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3093. * a valid configuration specification
  3094. * - COOKIE_LSBS
  3095. * Bits 31:0
  3096. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3097. * message with its preceding host->target stats request message.
  3098. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3099. * - COOKIE_MSBS
  3100. * Bits 31:0
  3101. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3102. * message with its preceding host->target stats request message.
  3103. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3104. */
  3105. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3106. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3107. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3108. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3109. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3110. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3111. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3112. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3113. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3114. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3115. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3116. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3117. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3118. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3119. do { \
  3120. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3121. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3122. } while (0)
  3123. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3124. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3125. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3126. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3127. do { \
  3128. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3129. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3130. } while (0)
  3131. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3132. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3133. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3134. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3135. do { \
  3136. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3137. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3138. } while (0)
  3139. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3140. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3141. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3142. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3143. do { \
  3144. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3145. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3146. } while (0)
  3147. /**
  3148. * @brief host -> target HTT out-of-band sync request
  3149. *
  3150. * @details
  3151. * The HTT SYNC tells the target to suspend processing of subsequent
  3152. * HTT host-to-target messages until some other target agent locally
  3153. * informs the target HTT FW that the current sync counter is equal to
  3154. * or greater than (in a modulo sense) the sync counter specified in
  3155. * the SYNC message.
  3156. * This allows other host-target components to synchronize their operation
  3157. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3158. * security key has been downloaded to and activated by the target.
  3159. * In the absence of any explicit synchronization counter value
  3160. * specification, the target HTT FW will use zero as the default current
  3161. * sync value.
  3162. *
  3163. * |31 24|23 16|15 8|7 0|
  3164. * |-----------------------------------------------------------|
  3165. * | reserved | sync count | msg type |
  3166. * |-----------------------------------------------------------|
  3167. * Header fields:
  3168. * - MSG_TYPE
  3169. * Bits 7:0
  3170. * Purpose: identifies this as a sync message
  3171. * Value: 0x4
  3172. * - SYNC_COUNT
  3173. * Bits 15:8
  3174. * Purpose: specifies what sync value the HTT FW will wait for from
  3175. * an out-of-band specification to resume its operation
  3176. * Value: in-band sync counter value to compare against the out-of-band
  3177. * counter spec.
  3178. * The HTT target FW will suspend its host->target message processing
  3179. * as long as
  3180. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3181. */
  3182. #define HTT_H2T_SYNC_MSG_SZ 4
  3183. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3184. #define HTT_H2T_SYNC_COUNT_S 8
  3185. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3186. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3187. HTT_H2T_SYNC_COUNT_S)
  3188. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3189. do { \
  3190. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3191. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3192. } while (0)
  3193. /**
  3194. * @brief HTT aggregation configuration
  3195. */
  3196. #define HTT_AGGR_CFG_MSG_SZ 4
  3197. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3198. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3199. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3200. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3201. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3202. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3203. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3204. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3205. do { \
  3206. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3207. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3208. } while (0)
  3209. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3210. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3211. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3212. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3213. do { \
  3214. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3215. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3216. } while (0)
  3217. /**
  3218. * @brief host -> target HTT configure max amsdu info per vdev
  3219. *
  3220. * @details
  3221. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3222. *
  3223. * |31 21|20 16|15 8|7 0|
  3224. * |-----------------------------------------------------------|
  3225. * | reserved | vdev id | max amsdu | msg type |
  3226. * |-----------------------------------------------------------|
  3227. * Header fields:
  3228. * - MSG_TYPE
  3229. * Bits 7:0
  3230. * Purpose: identifies this as a aggr cfg ex message
  3231. * Value: 0xa
  3232. * - MAX_NUM_AMSDU_SUBFRM
  3233. * Bits 15:8
  3234. * Purpose: max MSDUs per A-MSDU
  3235. * - VDEV_ID
  3236. * Bits 20:16
  3237. * Purpose: ID of the vdev to which this limit is applied
  3238. */
  3239. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3240. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3241. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3242. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3243. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3244. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3245. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3246. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3247. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3248. do { \
  3249. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3250. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3251. } while (0)
  3252. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3253. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3254. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3255. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3256. do { \
  3257. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3258. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3259. } while (0)
  3260. /**
  3261. * @brief HTT WDI_IPA Config Message
  3262. *
  3263. * @details
  3264. * The HTT WDI_IPA config message is created/sent by host at driver
  3265. * init time. It contains information about data structures used on
  3266. * WDI_IPA TX and RX path.
  3267. * TX CE ring is used for pushing packet metadata from IPA uC
  3268. * to WLAN FW
  3269. * TX Completion ring is used for generating TX completions from
  3270. * WLAN FW to IPA uC
  3271. * RX Indication ring is used for indicating RX packets from FW
  3272. * to IPA uC
  3273. * RX Ring2 is used as either completion ring or as second
  3274. * indication ring. when Ring2 is used as completion ring, IPA uC
  3275. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3276. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3277. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3278. * indicated in RX Indication ring. Please see WDI_IPA specification
  3279. * for more details.
  3280. * |31 24|23 16|15 8|7 0|
  3281. * |----------------+----------------+----------------+----------------|
  3282. * | tx pkt pool size | Rsvd | msg_type |
  3283. * |-------------------------------------------------------------------|
  3284. * | tx comp ring base (bits 31:0) |
  3285. #if HTT_PADDR64
  3286. * | tx comp ring base (bits 63:32) |
  3287. #endif
  3288. * |-------------------------------------------------------------------|
  3289. * | tx comp ring size |
  3290. * |-------------------------------------------------------------------|
  3291. * | tx comp WR_IDX physical address (bits 31:0) |
  3292. #if HTT_PADDR64
  3293. * | tx comp WR_IDX physical address (bits 63:32) |
  3294. #endif
  3295. * |-------------------------------------------------------------------|
  3296. * | tx CE WR_IDX physical address (bits 31:0) |
  3297. #if HTT_PADDR64
  3298. * | tx CE WR_IDX physical address (bits 63:32) |
  3299. #endif
  3300. * |-------------------------------------------------------------------|
  3301. * | rx indication ring base (bits 31:0) |
  3302. #if HTT_PADDR64
  3303. * | rx indication ring base (bits 63:32) |
  3304. #endif
  3305. * |-------------------------------------------------------------------|
  3306. * | rx indication ring size |
  3307. * |-------------------------------------------------------------------|
  3308. * | rx ind RD_IDX physical address (bits 31:0) |
  3309. #if HTT_PADDR64
  3310. * | rx ind RD_IDX physical address (bits 63:32) |
  3311. #endif
  3312. * |-------------------------------------------------------------------|
  3313. * | rx ind WR_IDX physical address (bits 31:0) |
  3314. #if HTT_PADDR64
  3315. * | rx ind WR_IDX physical address (bits 63:32) |
  3316. #endif
  3317. * |-------------------------------------------------------------------|
  3318. * |-------------------------------------------------------------------|
  3319. * | rx ring2 base (bits 31:0) |
  3320. #if HTT_PADDR64
  3321. * | rx ring2 base (bits 63:32) |
  3322. #endif
  3323. * |-------------------------------------------------------------------|
  3324. * | rx ring2 size |
  3325. * |-------------------------------------------------------------------|
  3326. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3327. #if HTT_PADDR64
  3328. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3329. #endif
  3330. * |-------------------------------------------------------------------|
  3331. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3332. #if HTT_PADDR64
  3333. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3334. #endif
  3335. * |-------------------------------------------------------------------|
  3336. *
  3337. * Header fields:
  3338. * Header fields:
  3339. * - MSG_TYPE
  3340. * Bits 7:0
  3341. * Purpose: Identifies this as WDI_IPA config message
  3342. * value: = 0x8
  3343. * - TX_PKT_POOL_SIZE
  3344. * Bits 15:0
  3345. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3346. * WDI_IPA TX path
  3347. * For systems using 32-bit format for bus addresses:
  3348. * - TX_COMP_RING_BASE_ADDR
  3349. * Bits 31:0
  3350. * Purpose: TX Completion Ring base address in DDR
  3351. * - TX_COMP_RING_SIZE
  3352. * Bits 31:0
  3353. * Purpose: TX Completion Ring size (must be power of 2)
  3354. * - TX_COMP_WR_IDX_ADDR
  3355. * Bits 31:0
  3356. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3357. * updates the Write Index for WDI_IPA TX completion ring
  3358. * - TX_CE_WR_IDX_ADDR
  3359. * Bits 31:0
  3360. * Purpose: DDR address where IPA uC
  3361. * updates the WR Index for TX CE ring
  3362. * (needed for fusion platforms)
  3363. * - RX_IND_RING_BASE_ADDR
  3364. * Bits 31:0
  3365. * Purpose: RX Indication Ring base address in DDR
  3366. * - RX_IND_RING_SIZE
  3367. * Bits 31:0
  3368. * Purpose: RX Indication Ring size
  3369. * - RX_IND_RD_IDX_ADDR
  3370. * Bits 31:0
  3371. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3372. * RX indication ring
  3373. * - RX_IND_WR_IDX_ADDR
  3374. * Bits 31:0
  3375. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3376. * updates the Write Index for WDI_IPA RX indication ring
  3377. * - RX_RING2_BASE_ADDR
  3378. * Bits 31:0
  3379. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3380. * - RX_RING2_SIZE
  3381. * Bits 31:0
  3382. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3383. * - RX_RING2_RD_IDX_ADDR
  3384. * Bits 31:0
  3385. * Purpose: If Second RX ring is Indication ring, DDR address where
  3386. * IPA uC updates the Read Index for Ring2.
  3387. * If Second RX ring is completion ring, this is NOT used
  3388. * - RX_RING2_WR_IDX_ADDR
  3389. * Bits 31:0
  3390. * Purpose: If Second RX ring is Indication ring, DDR address where
  3391. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3392. * If second RX ring is completion ring, DDR address where
  3393. * IPA uC updates the Write Index for Ring 2.
  3394. * For systems using 64-bit format for bus addresses:
  3395. * - TX_COMP_RING_BASE_ADDR_LO
  3396. * Bits 31:0
  3397. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3398. * - TX_COMP_RING_BASE_ADDR_HI
  3399. * Bits 31:0
  3400. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3401. * - TX_COMP_RING_SIZE
  3402. * Bits 31:0
  3403. * Purpose: TX Completion Ring size (must be power of 2)
  3404. * - TX_COMP_WR_IDX_ADDR_LO
  3405. * Bits 31:0
  3406. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3407. * Lower 4 bytes of DDR address where WIFI FW
  3408. * updates the Write Index for WDI_IPA TX completion ring
  3409. * - TX_COMP_WR_IDX_ADDR_HI
  3410. * Bits 31:0
  3411. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3412. * Higher 4 bytes of DDR address where WIFI FW
  3413. * updates the Write Index for WDI_IPA TX completion ring
  3414. * - TX_CE_WR_IDX_ADDR_LO
  3415. * Bits 31:0
  3416. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3417. * updates the WR Index for TX CE ring
  3418. * (needed for fusion platforms)
  3419. * - TX_CE_WR_IDX_ADDR_HI
  3420. * Bits 31:0
  3421. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3422. * updates the WR Index for TX CE ring
  3423. * (needed for fusion platforms)
  3424. * - RX_IND_RING_BASE_ADDR_LO
  3425. * Bits 31:0
  3426. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3427. * - RX_IND_RING_BASE_ADDR_HI
  3428. * Bits 31:0
  3429. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3430. * - RX_IND_RING_SIZE
  3431. * Bits 31:0
  3432. * Purpose: RX Indication Ring size
  3433. * - RX_IND_RD_IDX_ADDR_LO
  3434. * Bits 31:0
  3435. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3436. * for WDI_IPA RX indication ring
  3437. * - RX_IND_RD_IDX_ADDR_HI
  3438. * Bits 31:0
  3439. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3440. * for WDI_IPA RX indication ring
  3441. * - RX_IND_WR_IDX_ADDR_LO
  3442. * Bits 31:0
  3443. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3444. * Lower 4 bytes of DDR address where WIFI FW
  3445. * updates the Write Index for WDI_IPA RX indication ring
  3446. * - RX_IND_WR_IDX_ADDR_HI
  3447. * Bits 31:0
  3448. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3449. * Higher 4 bytes of DDR address where WIFI FW
  3450. * updates the Write Index for WDI_IPA RX indication ring
  3451. * - RX_RING2_BASE_ADDR_LO
  3452. * Bits 31:0
  3453. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3454. * - RX_RING2_BASE_ADDR_HI
  3455. * Bits 31:0
  3456. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3457. * - RX_RING2_SIZE
  3458. * Bits 31:0
  3459. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3460. * - RX_RING2_RD_IDX_ADDR_LO
  3461. * Bits 31:0
  3462. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3463. * DDR address where IPA uC updates the Read Index for Ring2.
  3464. * If Second RX ring is completion ring, this is NOT used
  3465. * - RX_RING2_RD_IDX_ADDR_HI
  3466. * Bits 31:0
  3467. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3468. * DDR address where IPA uC updates the Read Index for Ring2.
  3469. * If Second RX ring is completion ring, this is NOT used
  3470. * - RX_RING2_WR_IDX_ADDR_LO
  3471. * Bits 31:0
  3472. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3473. * DDR address where WIFI FW updates the Write Index
  3474. * for WDI_IPA RX ring2
  3475. * If second RX ring is completion ring, lower 4 bytes of
  3476. * DDR address where IPA uC updates the Write Index for Ring 2.
  3477. * - RX_RING2_WR_IDX_ADDR_HI
  3478. * Bits 31:0
  3479. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3480. * DDR address where WIFI FW updates the Write Index
  3481. * for WDI_IPA RX ring2
  3482. * If second RX ring is completion ring, higher 4 bytes of
  3483. * DDR address where IPA uC updates the Write Index for Ring 2.
  3484. */
  3485. #if HTT_PADDR64
  3486. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3487. #else
  3488. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3489. #endif
  3490. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3491. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3492. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3493. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3494. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3495. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3496. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3497. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3498. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3499. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3500. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3501. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3502. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3503. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3504. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3505. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3506. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3507. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3508. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3509. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3510. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3511. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3512. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3513. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3514. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3515. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3516. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3517. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3518. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3519. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3520. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3521. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3522. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3523. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3524. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3525. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3526. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3527. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3528. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3529. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3530. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3531. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3532. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3533. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3534. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3535. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3536. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3537. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3538. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3539. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3540. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3541. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3542. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3543. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3544. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3545. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3546. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3547. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3548. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3549. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3550. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3551. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3552. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3553. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3554. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3555. do { \
  3556. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3557. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3558. } while (0)
  3559. /* for systems using 32-bit format for bus addr */
  3560. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3561. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3562. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3563. do { \
  3564. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3565. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3566. } while (0)
  3567. /* for systems using 64-bit format for bus addr */
  3568. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3569. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3570. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3571. do { \
  3572. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3573. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3574. } while (0)
  3575. /* for systems using 64-bit format for bus addr */
  3576. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3577. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3578. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3579. do { \
  3580. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3581. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3582. } while (0)
  3583. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3584. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3585. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3586. do { \
  3587. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3588. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3589. } while (0)
  3590. /* for systems using 32-bit format for bus addr */
  3591. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3592. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3593. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3594. do { \
  3595. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3596. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3597. } while (0)
  3598. /* for systems using 64-bit format for bus addr */
  3599. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3600. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3601. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3602. do { \
  3603. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3604. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3605. } while (0)
  3606. /* for systems using 64-bit format for bus addr */
  3607. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3608. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3609. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3610. do { \
  3611. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3612. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3613. } while (0)
  3614. /* for systems using 32-bit format for bus addr */
  3615. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3616. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3617. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3618. do { \
  3619. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3620. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3621. } while (0)
  3622. /* for systems using 64-bit format for bus addr */
  3623. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3624. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3625. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3626. do { \
  3627. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3628. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3629. } while (0)
  3630. /* for systems using 64-bit format for bus addr */
  3631. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3632. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3633. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3634. do { \
  3635. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3636. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3637. } while (0)
  3638. /* for systems using 32-bit format for bus addr */
  3639. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3640. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3641. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3642. do { \
  3643. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3644. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3645. } while (0)
  3646. /* for systems using 64-bit format for bus addr */
  3647. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3648. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3649. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3650. do { \
  3651. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3652. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3653. } while (0)
  3654. /* for systems using 64-bit format for bus addr */
  3655. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3656. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3657. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3658. do { \
  3659. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3660. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3661. } while (0)
  3662. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3663. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3664. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3665. do { \
  3666. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3667. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3668. } while (0)
  3669. /* for systems using 32-bit format for bus addr */
  3670. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3671. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3672. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3673. do { \
  3674. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3675. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3676. } while (0)
  3677. /* for systems using 64-bit format for bus addr */
  3678. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3679. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3680. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3681. do { \
  3682. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3683. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3684. } while (0)
  3685. /* for systems using 64-bit format for bus addr */
  3686. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3687. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3688. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3689. do { \
  3690. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3691. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3692. } while (0)
  3693. /* for systems using 32-bit format for bus addr */
  3694. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3695. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3696. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3697. do { \
  3698. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3699. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3700. } while (0)
  3701. /* for systems using 64-bit format for bus addr */
  3702. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3703. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3704. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3705. do { \
  3706. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3707. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3708. } while (0)
  3709. /* for systems using 64-bit format for bus addr */
  3710. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3711. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3712. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3713. do { \
  3714. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3715. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3716. } while (0)
  3717. /* for systems using 32-bit format for bus addr */
  3718. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3719. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3720. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3721. do { \
  3722. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3723. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3724. } while (0)
  3725. /* for systems using 64-bit format for bus addr */
  3726. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3727. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3728. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3729. do { \
  3730. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3731. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3732. } while (0)
  3733. /* for systems using 64-bit format for bus addr */
  3734. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3735. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3736. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3737. do { \
  3738. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3739. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3740. } while (0)
  3741. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3742. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3743. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3744. do { \
  3745. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3746. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3747. } while (0)
  3748. /* for systems using 32-bit format for bus addr */
  3749. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3750. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3751. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3752. do { \
  3753. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3754. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3755. } while (0)
  3756. /* for systems using 64-bit format for bus addr */
  3757. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3758. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3759. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3760. do { \
  3761. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3762. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3763. } while (0)
  3764. /* for systems using 64-bit format for bus addr */
  3765. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3766. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3767. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3768. do { \
  3769. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3770. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3771. } while (0)
  3772. /* for systems using 32-bit format for bus addr */
  3773. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3774. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3775. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3776. do { \
  3777. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3778. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3779. } while (0)
  3780. /* for systems using 64-bit format for bus addr */
  3781. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3782. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3783. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3784. do { \
  3785. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3786. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3787. } while (0)
  3788. /* for systems using 64-bit format for bus addr */
  3789. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  3790. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  3791. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  3792. do { \
  3793. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  3794. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  3795. } while (0)
  3796. /*
  3797. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  3798. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  3799. * addresses are stored in a XXX-bit field.
  3800. * This macro is used to define both htt_wdi_ipa_config32_t and
  3801. * htt_wdi_ipa_config64_t structs.
  3802. */
  3803. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  3804. _paddr__tx_comp_ring_base_addr_, \
  3805. _paddr__tx_comp_wr_idx_addr_, \
  3806. _paddr__tx_ce_wr_idx_addr_, \
  3807. _paddr__rx_ind_ring_base_addr_, \
  3808. _paddr__rx_ind_rd_idx_addr_, \
  3809. _paddr__rx_ind_wr_idx_addr_, \
  3810. _paddr__rx_ring2_base_addr_,\
  3811. _paddr__rx_ring2_rd_idx_addr_,\
  3812. _paddr__rx_ring2_wr_idx_addr_) \
  3813. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  3814. { \
  3815. /* DWORD 0: flags and meta-data */ \
  3816. A_UINT32 \
  3817. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  3818. reserved: 8, \
  3819. tx_pkt_pool_size: 16;\
  3820. /* DWORD 1 */\
  3821. _paddr__tx_comp_ring_base_addr_;\
  3822. /* DWORD 2 (or 3)*/\
  3823. A_UINT32 tx_comp_ring_size;\
  3824. /* DWORD 3 (or 4)*/\
  3825. _paddr__tx_comp_wr_idx_addr_;\
  3826. /* DWORD 4 (or 6)*/\
  3827. _paddr__tx_ce_wr_idx_addr_;\
  3828. /* DWORD 5 (or 8)*/\
  3829. _paddr__rx_ind_ring_base_addr_;\
  3830. /* DWORD 6 (or 10)*/\
  3831. A_UINT32 rx_ind_ring_size;\
  3832. /* DWORD 7 (or 11)*/\
  3833. _paddr__rx_ind_rd_idx_addr_;\
  3834. /* DWORD 8 (or 13)*/\
  3835. _paddr__rx_ind_wr_idx_addr_;\
  3836. /* DWORD 9 (or 15)*/\
  3837. _paddr__rx_ring2_base_addr_;\
  3838. /* DWORD 10 (or 17) */\
  3839. A_UINT32 rx_ring2_size;\
  3840. /* DWORD 11 (or 18) */\
  3841. _paddr__rx_ring2_rd_idx_addr_;\
  3842. /* DWORD 12 (or 20) */\
  3843. _paddr__rx_ring2_wr_idx_addr_;\
  3844. } POSTPACK
  3845. /* define a htt_wdi_ipa_config32_t type */
  3846. 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));
  3847. /* define a htt_wdi_ipa_config64_t type */
  3848. 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));
  3849. #if HTT_PADDR64
  3850. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  3851. #else
  3852. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  3853. #endif
  3854. enum htt_wdi_ipa_op_code {
  3855. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  3856. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  3857. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  3858. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  3859. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  3860. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  3861. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  3862. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  3863. /* keep this last */
  3864. HTT_WDI_IPA_OPCODE_MAX
  3865. };
  3866. /**
  3867. * @brief HTT WDI_IPA Operation Request Message
  3868. *
  3869. * @details
  3870. * HTT WDI_IPA Operation Request message is sent by host
  3871. * to either suspend or resume WDI_IPA TX or RX path.
  3872. * |31 24|23 16|15 8|7 0|
  3873. * |----------------+----------------+----------------+----------------|
  3874. * | op_code | Rsvd | msg_type |
  3875. * |-------------------------------------------------------------------|
  3876. *
  3877. * Header fields:
  3878. * - MSG_TYPE
  3879. * Bits 7:0
  3880. * Purpose: Identifies this as WDI_IPA Operation Request message
  3881. * value: = 0x9
  3882. * - OP_CODE
  3883. * Bits 31:16
  3884. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  3885. * value: = enum htt_wdi_ipa_op_code
  3886. */
  3887. PREPACK struct htt_wdi_ipa_op_request_t
  3888. {
  3889. /* DWORD 0: flags and meta-data */
  3890. A_UINT32
  3891. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  3892. reserved: 8,
  3893. op_code: 16;
  3894. } POSTPACK;
  3895. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  3896. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  3897. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  3898. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  3899. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  3900. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  3901. do { \
  3902. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  3903. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  3904. } while (0)
  3905. /*
  3906. * @brief host -> target HTT_SRING_SETUP message
  3907. *
  3908. * @details
  3909. * After target is booted up, Host can send SRING setup message for
  3910. * each host facing LMAC SRING. Target setups up HW registers based
  3911. * on setup message and confirms back to Host if response_required is set.
  3912. * Host should wait for confirmation message before sending new SRING
  3913. * setup message
  3914. *
  3915. * The message would appear as follows:
  3916. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  3917. * |--------------- +-----------------+-----------------+-----------------|
  3918. * | ring_type | ring_id | pdev_id | msg_type |
  3919. * |----------------------------------------------------------------------|
  3920. * | ring_base_addr_lo |
  3921. * |----------------------------------------------------------------------|
  3922. * | ring_base_addr_hi |
  3923. * |----------------------------------------------------------------------|
  3924. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  3925. * |----------------------------------------------------------------------|
  3926. * | ring_head_offset32_remote_addr_lo |
  3927. * |----------------------------------------------------------------------|
  3928. * | ring_head_offset32_remote_addr_hi |
  3929. * |----------------------------------------------------------------------|
  3930. * | ring_tail_offset32_remote_addr_lo |
  3931. * |----------------------------------------------------------------------|
  3932. * | ring_tail_offset32_remote_addr_hi |
  3933. * |----------------------------------------------------------------------|
  3934. * | ring_msi_addr_lo |
  3935. * |----------------------------------------------------------------------|
  3936. * | ring_msi_addr_hi |
  3937. * |----------------------------------------------------------------------|
  3938. * | ring_msi_data |
  3939. * |----------------------------------------------------------------------|
  3940. * | intr_timer_th |IM| intr_batch_counter_th |
  3941. * |----------------------------------------------------------------------|
  3942. * | reserved |ID|RR| PTCF| intr_low_threshold |
  3943. * |----------------------------------------------------------------------|
  3944. * | reserved |IPA drop thres hi|IPA drop thres lo|
  3945. * |----------------------------------------------------------------------|
  3946. * Where
  3947. * IM = sw_intr_mode
  3948. * RR = response_required
  3949. * PTCF = prefetch_timer_cfg
  3950. * IP = IPA drop flag
  3951. *
  3952. * The message is interpreted as follows:
  3953. * dword0 - b'0:7 - msg_type: This will be set to
  3954. * HTT_H2T_MSG_TYPE_SRING_SETUP
  3955. * b'8:15 - pdev_id:
  3956. * 0 (for rings at SOC/UMAC level),
  3957. * 1/2/3 mac id (for rings at LMAC level)
  3958. * b'16:23 - ring_id: identify which ring is to setup,
  3959. * more details can be got from enum htt_srng_ring_id
  3960. * b'24:31 - ring_type: identify type of host rings,
  3961. * more details can be got from enum htt_srng_ring_type
  3962. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  3963. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  3964. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  3965. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  3966. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  3967. * SW_TO_HW_RING.
  3968. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  3969. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  3970. * Lower 32 bits of memory address of the remote variable
  3971. * storing the 4-byte word offset that identifies the head
  3972. * element within the ring.
  3973. * (The head offset variable has type A_UINT32.)
  3974. * Valid for HW_TO_SW and SW_TO_SW rings.
  3975. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  3976. * Upper 32 bits of memory address of the remote variable
  3977. * storing the 4-byte word offset that identifies the head
  3978. * element within the ring.
  3979. * (The head offset variable has type A_UINT32.)
  3980. * Valid for HW_TO_SW and SW_TO_SW rings.
  3981. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  3982. * Lower 32 bits of memory address of the remote variable
  3983. * storing the 4-byte word offset that identifies the tail
  3984. * element within the ring.
  3985. * (The tail offset variable has type A_UINT32.)
  3986. * Valid for HW_TO_SW and SW_TO_SW rings.
  3987. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  3988. * Upper 32 bits of memory address of the remote variable
  3989. * storing the 4-byte word offset that identifies the tail
  3990. * element within the ring.
  3991. * (The tail offset variable has type A_UINT32.)
  3992. * Valid for HW_TO_SW and SW_TO_SW rings.
  3993. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  3994. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3995. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  3996. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3997. * dword10 - b'0:31 - ring_msi_data: MSI data
  3998. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  3999. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4000. * dword11 - b'0:14 - intr_batch_counter_th:
  4001. * batch counter threshold is in units of 4-byte words.
  4002. * HW internally maintains and increments batch count.
  4003. * (see SRING spec for detail description).
  4004. * When batch count reaches threshold value, an interrupt
  4005. * is generated by HW.
  4006. * b'15 - sw_intr_mode:
  4007. * This configuration shall be static.
  4008. * Only programmed at power up.
  4009. * 0: generate pulse style sw interrupts
  4010. * 1: generate level style sw interrupts
  4011. * b'16:31 - intr_timer_th:
  4012. * The timer init value when timer is idle or is
  4013. * initialized to start downcounting.
  4014. * In 8us units (to cover a range of 0 to 524 ms)
  4015. * dword12 - b'0:15 - intr_low_threshold:
  4016. * Used only by Consumer ring to generate ring_sw_int_p.
  4017. * Ring entries low threshold water mark, that is used
  4018. * in combination with the interrupt timer as well as
  4019. * the the clearing of the level interrupt.
  4020. * b'16:18 - prefetch_timer_cfg:
  4021. * Used only by Consumer ring to set timer mode to
  4022. * support Application prefetch handling.
  4023. * The external tail offset/pointer will be updated
  4024. * at following intervals:
  4025. * 3'b000: (Prefetch feature disabled; used only for debug)
  4026. * 3'b001: 1 usec
  4027. * 3'b010: 4 usec
  4028. * 3'b011: 8 usec (default)
  4029. * 3'b100: 16 usec
  4030. * Others: Reserverd
  4031. * b'19 - response_required:
  4032. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4033. * b'20 - ipa_drop_flag:
  4034. Indicates that host will config ipa drop threshold percentage
  4035. * b'21:31 - reserved: reserved for future use
  4036. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4037. * b'8:15 - ipa drop high threshold percentage:
  4038. * b'16:31 - Reserved
  4039. */
  4040. PREPACK struct htt_sring_setup_t {
  4041. A_UINT32 msg_type: 8,
  4042. pdev_id: 8,
  4043. ring_id: 8,
  4044. ring_type: 8;
  4045. A_UINT32 ring_base_addr_lo;
  4046. A_UINT32 ring_base_addr_hi;
  4047. A_UINT32 ring_size: 16,
  4048. ring_entry_size: 8,
  4049. ring_misc_cfg_flag: 8;
  4050. A_UINT32 ring_head_offset32_remote_addr_lo;
  4051. A_UINT32 ring_head_offset32_remote_addr_hi;
  4052. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4053. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4054. A_UINT32 ring_msi_addr_lo;
  4055. A_UINT32 ring_msi_addr_hi;
  4056. A_UINT32 ring_msi_data;
  4057. A_UINT32 intr_batch_counter_th: 15,
  4058. sw_intr_mode: 1,
  4059. intr_timer_th: 16;
  4060. A_UINT32 intr_low_threshold: 16,
  4061. prefetch_timer_cfg: 3,
  4062. response_required: 1,
  4063. ipa_drop_flag: 1,
  4064. reserved1: 11;
  4065. A_UINT32 ipa_drop_low_threshold: 8,
  4066. ipa_drop_high_threshold: 8,
  4067. reserved: 16;
  4068. } POSTPACK;
  4069. enum htt_srng_ring_type {
  4070. HTT_HW_TO_SW_RING = 0,
  4071. HTT_SW_TO_HW_RING,
  4072. HTT_SW_TO_SW_RING,
  4073. /* Insert new ring types above this line */
  4074. };
  4075. enum htt_srng_ring_id {
  4076. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4077. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4078. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4079. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4080. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4081. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4082. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4083. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4084. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4085. /* Add Other SRING which can't be directly configured by host software above this line */
  4086. };
  4087. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4088. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4089. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4090. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4091. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4092. HTT_SRING_SETUP_PDEV_ID_S)
  4093. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4094. do { \
  4095. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4096. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4097. } while (0)
  4098. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4099. #define HTT_SRING_SETUP_RING_ID_S 16
  4100. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4101. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4102. HTT_SRING_SETUP_RING_ID_S)
  4103. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4104. do { \
  4105. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4106. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4107. } while (0)
  4108. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4109. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4110. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4111. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4112. HTT_SRING_SETUP_RING_TYPE_S)
  4113. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4114. do { \
  4115. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4116. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4117. } while (0)
  4118. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4119. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4120. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4121. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4122. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4123. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4124. do { \
  4125. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4126. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4127. } while (0)
  4128. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4129. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4130. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4131. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4132. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4133. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4134. do { \
  4135. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4136. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4137. } while (0)
  4138. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4139. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4140. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4141. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4142. HTT_SRING_SETUP_RING_SIZE_S)
  4143. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4144. do { \
  4145. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4146. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4147. } while (0)
  4148. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4149. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4150. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4151. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4152. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4153. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4154. do { \
  4155. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4156. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4157. } while (0)
  4158. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4159. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4160. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4161. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4162. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4163. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4164. do { \
  4165. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4166. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4167. } while (0)
  4168. /* This control bit is applicable to only Producer, which updates Ring ID field
  4169. * of each descriptor before pushing into the ring.
  4170. * 0: updates ring_id(default)
  4171. * 1: ring_id updating disabled */
  4172. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4173. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4174. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4175. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4176. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4177. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4178. do { \
  4179. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4180. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4181. } while (0)
  4182. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4183. * of each descriptor before pushing into the ring.
  4184. * 0: updates Loopcnt(default)
  4185. * 1: Loopcnt updating disabled */
  4186. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4187. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4188. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4189. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4190. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4191. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4192. do { \
  4193. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4194. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4195. } while (0)
  4196. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4197. * into security_id port of GXI/AXI. */
  4198. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4199. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4200. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4201. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4202. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4203. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4204. do { \
  4205. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4206. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4207. } while (0)
  4208. /* During MSI write operation, SRNG drives value of this register bit into
  4209. * swap bit of GXI/AXI. */
  4210. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4211. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4212. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4213. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4214. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4215. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4216. do { \
  4217. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4218. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4219. } while (0)
  4220. /* During Pointer write operation, SRNG drives value of this register bit into
  4221. * swap bit of GXI/AXI. */
  4222. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4223. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4224. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4225. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4226. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4227. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4228. do { \
  4229. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4230. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4231. } while (0)
  4232. /* During any data or TLV write operation, SRNG drives value of this register
  4233. * bit into swap bit of GXI/AXI. */
  4234. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4235. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4236. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4237. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4238. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4239. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4240. do { \
  4241. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4242. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4243. } while (0)
  4244. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4245. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4246. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4247. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4248. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4249. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4250. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4251. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4252. do { \
  4253. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4254. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4255. } while (0)
  4256. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4257. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4258. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4259. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4260. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4261. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4262. do { \
  4263. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4264. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4265. } while (0)
  4266. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4267. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4268. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4269. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4270. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4271. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4272. do { \
  4273. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4274. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4275. } while (0)
  4276. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4277. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4278. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4279. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4280. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4281. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4282. do { \
  4283. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4284. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4285. } while (0)
  4286. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4287. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4288. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4289. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4290. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4291. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4292. do { \
  4293. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4294. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4295. } while (0)
  4296. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4297. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4298. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4299. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4300. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4301. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4302. do { \
  4303. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4304. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4305. } while (0)
  4306. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4307. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4308. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4309. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4310. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4311. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4312. do { \
  4313. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4314. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4315. } while (0)
  4316. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4317. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4318. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4319. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4320. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4321. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4322. do { \
  4323. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4324. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4325. } while (0)
  4326. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4327. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4328. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4329. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4330. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4331. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4332. do { \
  4333. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4334. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4335. } while (0)
  4336. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4337. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4338. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4339. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4340. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4341. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4342. do { \
  4343. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4344. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4345. } while (0)
  4346. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4347. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4348. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4349. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4350. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4351. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4352. do { \
  4353. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4354. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4355. } while (0)
  4356. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4357. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4358. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4359. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4360. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4361. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4362. do { \
  4363. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4364. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4365. } while (0)
  4366. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4367. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4368. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4369. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4370. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4371. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4372. do { \
  4373. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4374. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4375. } while (0)
  4376. /**
  4377. * @brief HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG Message
  4378. *
  4379. * @details
  4380. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4381. * configure RXDMA rings.
  4382. * The configuration is per ring based and includes both packet subtypes
  4383. * and PPDU/MPDU TLVs.
  4384. *
  4385. * The message would appear as follows:
  4386. *
  4387. * |31 28|27|26|25|24|23 16|15 | 11| 10|9 8|7 0|
  4388. * |-----+--+--+--+--+----------------+----+---+---+---+---------------|
  4389. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  4390. * |-------------------------------------------------------------------|
  4391. * | rsvd2 | ring_buffer_size |
  4392. * |-------------------------------------------------------------------|
  4393. * | packet_type_enable_flags_0 |
  4394. * |-------------------------------------------------------------------|
  4395. * | packet_type_enable_flags_1 |
  4396. * |-------------------------------------------------------------------|
  4397. * | packet_type_enable_flags_2 |
  4398. * |-------------------------------------------------------------------|
  4399. * | packet_type_enable_flags_3 |
  4400. * |-------------------------------------------------------------------|
  4401. * | tlv_filter_in_flags |
  4402. * |-------------------------------------------------------------------|
  4403. * | rx_header_offset | rx_packet_offset |
  4404. * |-------------------------------------------------------------------|
  4405. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  4406. * |-------------------------------------------------------------------|
  4407. * | rx_msdu_start_offset | rx_msdu_end_offset |
  4408. * |-------------------------------------------------------------------|
  4409. * | rsvd3 | rx_attention_offset |
  4410. * |-------------------------------------------------------------------|
  4411. * | rsvd4 | mo| fp| rx_drop_threshold |
  4412. * | |ndp|ndp| |
  4413. * |-------------------------------------------------------------------|
  4414. * Where:
  4415. * PS = pkt_swap
  4416. * SS = status_swap
  4417. * OV = rx_offsets_valid
  4418. * DT = drop_thresh_valid
  4419. * The message is interpreted as follows:
  4420. * dword0 - b'0:7 - msg_type: This will be set to
  4421. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4422. * b'8:15 - pdev_id:
  4423. * 0 (for rings at SOC/UMAC level),
  4424. * 1/2/3 mac id (for rings at LMAC level)
  4425. * b'16:23 - ring_id : Identify the ring to configure.
  4426. * More details can be got from enum htt_srng_ring_id
  4427. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  4428. * BUF_RING_CFG_0 defs within HW .h files,
  4429. * e.g. wmac_top_reg_seq_hwioreg.h
  4430. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  4431. * BUF_RING_CFG_0 defs within HW .h files,
  4432. * e.g. wmac_top_reg_seq_hwioreg.h
  4433. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  4434. * configuration fields are valid
  4435. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  4436. * rx_drop_threshold field is valid
  4437. * b'28:31 - rsvd1: reserved for future use
  4438. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4439. * in byte units.
  4440. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4441. * - b'16:31 - rsvd2: Reserved for future use
  4442. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4443. * Enable MGMT packet from 0b0000 to 0b1001
  4444. * bits from low to high: FP, MD, MO - 3 bits
  4445. * FP: Filter_Pass
  4446. * MD: Monitor_Direct
  4447. * MO: Monitor_Other
  4448. * 10 mgmt subtypes * 3 bits -> 30 bits
  4449. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4450. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4451. * Enable MGMT packet from 0b1010 to 0b1111
  4452. * bits from low to high: FP, MD, MO - 3 bits
  4453. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4454. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4455. * Enable CTRL packet from 0b0000 to 0b1001
  4456. * bits from low to high: FP, MD, MO - 3 bits
  4457. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4458. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4459. * Enable CTRL packet from 0b1010 to 0b1111,
  4460. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4461. * bits from low to high: FP, MD, MO - 3 bits
  4462. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4463. * dword6 - b'0:31 - tlv_filter_in_flags:
  4464. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4465. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4466. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  4467. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4468. * A value of 0 will be considered as ignore this config.
  4469. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4470. * e.g. wmac_top_reg_seq_hwioreg.h
  4471. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  4472. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4473. * A value of 0 will be considered as ignore this config.
  4474. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4475. * e.g. wmac_top_reg_seq_hwioreg.h
  4476. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  4477. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4478. * A value of 0 will be considered as ignore this config.
  4479. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4480. * e.g. wmac_top_reg_seq_hwioreg.h
  4481. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  4482. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4483. * A value of 0 will be considered as ignore this config.
  4484. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4485. * e.g. wmac_top_reg_seq_hwioreg.h
  4486. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  4487. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4488. * A value of 0 will be considered as ignore this config.
  4489. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4490. * e.g. wmac_top_reg_seq_hwioreg.h
  4491. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  4492. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4493. * A value of 0 will be considered as ignore this config.
  4494. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4495. * e.g. wmac_top_reg_seq_hwioreg.h
  4496. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  4497. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4498. * A value of 0 will be considered as ignore this config.
  4499. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  4500. * e.g. wmac_top_reg_seq_hwioreg.h
  4501. * - b'16:31 - rsvd3 for future use
  4502. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  4503. * to source rings. Consumer drops packets if the available
  4504. * words in the ring falls below the configured threshold
  4505. * value.
  4506. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  4507. * by host. 1 -> subscribed
  4508. * - b`11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  4509. * by host. 1 -> subscribed
  4510. */
  4511. PREPACK struct htt_rx_ring_selection_cfg_t {
  4512. A_UINT32 msg_type: 8,
  4513. pdev_id: 8,
  4514. ring_id: 8,
  4515. status_swap: 1,
  4516. pkt_swap: 1,
  4517. rx_offsets_valid: 1,
  4518. drop_thresh_valid: 1,
  4519. rsvd1: 4;
  4520. A_UINT32 ring_buffer_size: 16,
  4521. rsvd2: 16;
  4522. A_UINT32 packet_type_enable_flags_0;
  4523. A_UINT32 packet_type_enable_flags_1;
  4524. A_UINT32 packet_type_enable_flags_2;
  4525. A_UINT32 packet_type_enable_flags_3;
  4526. A_UINT32 tlv_filter_in_flags;
  4527. A_UINT32 rx_packet_offset: 16,
  4528. rx_header_offset: 16;
  4529. A_UINT32 rx_mpdu_end_offset: 16,
  4530. rx_mpdu_start_offset: 16;
  4531. A_UINT32 rx_msdu_end_offset: 16,
  4532. rx_msdu_start_offset: 16;
  4533. A_UINT32 rx_attn_offset: 16,
  4534. rsvd3: 16;
  4535. A_UINT32 rx_drop_threshold: 10,
  4536. fp_ndp: 1,
  4537. mo_ndp: 1,
  4538. rsvd4: 20;
  4539. } POSTPACK;
  4540. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4541. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4542. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4543. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4544. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4545. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4546. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4547. do { \
  4548. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4549. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4550. } while (0)
  4551. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4552. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4553. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4554. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4555. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4556. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4557. do { \
  4558. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4559. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4560. } while (0)
  4561. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4562. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4563. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4564. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4565. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4566. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4567. do { \
  4568. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  4569. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4570. } while (0)
  4571. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4572. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4573. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4574. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4575. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4576. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4577. do { \
  4578. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  4579. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4580. } while (0)
  4581. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  4582. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  4583. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  4584. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  4585. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  4586. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  4587. do { \
  4588. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  4589. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  4590. } while (0)
  4591. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  4592. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  4593. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  4594. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  4595. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  4596. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  4597. do { \
  4598. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  4599. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  4600. } while (0)
  4601. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4602. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4603. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4604. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4605. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4606. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4607. do { \
  4608. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  4609. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4610. } while (0)
  4611. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4612. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4613. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4614. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4615. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4616. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4617. do { \
  4618. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  4619. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4620. } while (0)
  4621. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4622. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4623. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4624. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4625. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4626. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4627. do { \
  4628. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  4629. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4630. } while (0)
  4631. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4632. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4633. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4634. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4635. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4636. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4637. do { \
  4638. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  4639. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4640. } while (0)
  4641. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4642. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4643. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4644. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4645. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4646. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4647. do { \
  4648. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  4649. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4650. } while (0)
  4651. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4652. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4653. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4654. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4655. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4656. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4657. do { \
  4658. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4659. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4660. } while (0)
  4661. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  4662. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  4663. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  4664. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  4665. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  4666. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  4667. do { \
  4668. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  4669. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  4670. } while (0)
  4671. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  4672. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  4673. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  4674. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  4675. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  4676. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  4677. do { \
  4678. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  4679. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  4680. } while (0)
  4681. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  4682. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  4683. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  4684. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  4685. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  4686. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  4687. do { \
  4688. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  4689. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  4690. } while (0)
  4691. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  4692. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  4693. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  4694. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  4695. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  4696. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  4697. do { \
  4698. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  4699. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  4700. } while (0)
  4701. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  4702. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  4703. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  4704. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  4705. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  4706. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  4707. do { \
  4708. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  4709. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  4710. } while (0)
  4711. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  4712. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  4713. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  4714. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  4715. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  4716. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  4717. do { \
  4718. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  4719. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  4720. } while (0)
  4721. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  4722. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  4723. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  4724. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  4725. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  4726. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  4727. do { \
  4728. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  4729. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  4730. } while (0)
  4731. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  4732. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  4733. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  4734. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  4735. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  4736. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  4737. do { \
  4738. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  4739. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  4740. } while (0)
  4741. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  4742. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  4743. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  4744. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  4745. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  4746. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  4747. do { \
  4748. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  4749. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  4750. } while (0)
  4751. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  4752. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  4753. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  4754. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  4755. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  4756. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  4757. do { \
  4758. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  4759. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  4760. } while (0)
  4761. /*
  4762. * Subtype based MGMT frames enable bits.
  4763. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4764. */
  4765. /* association request */
  4766. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  4767. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4768. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  4769. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4770. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  4771. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4772. /* association response */
  4773. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  4774. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4775. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  4776. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4777. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  4778. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4779. /* Reassociation request */
  4780. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  4781. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  4782. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  4783. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  4784. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  4785. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  4786. /* Reassociation response */
  4787. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  4788. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  4789. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  4790. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  4791. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  4792. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  4793. /* Probe request */
  4794. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  4795. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  4796. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  4797. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  4798. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  4799. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  4800. /* Probe response */
  4801. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  4802. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  4803. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  4804. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  4805. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  4806. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  4807. /* Timing Advertisement */
  4808. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  4809. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  4810. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  4811. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  4812. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  4813. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  4814. /* Reserved */
  4815. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  4816. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  4817. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  4818. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  4819. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  4820. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  4821. /* Beacon */
  4822. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  4823. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  4824. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  4825. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  4826. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  4827. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  4828. /* ATIM */
  4829. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  4830. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  4831. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  4832. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  4833. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  4834. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  4835. /* Disassociation */
  4836. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  4837. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  4838. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  4839. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  4840. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  4841. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  4842. /* Authentication */
  4843. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  4844. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  4845. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  4846. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  4847. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  4848. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  4849. /* Deauthentication */
  4850. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  4851. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  4852. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  4853. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  4854. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  4855. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  4856. /* Action */
  4857. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  4858. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  4859. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  4860. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  4861. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  4862. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  4863. /* Action No Ack */
  4864. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  4865. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  4866. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  4867. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  4868. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  4869. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  4870. /* Reserved */
  4871. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  4872. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  4873. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  4874. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  4875. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  4876. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  4877. /*
  4878. * Subtype based CTRL frames enable bits.
  4879. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  4880. */
  4881. /* Reserved */
  4882. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  4883. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  4884. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  4885. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  4886. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  4887. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  4888. /* Reserved */
  4889. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  4890. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  4891. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  4892. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  4893. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  4894. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  4895. /* Reserved */
  4896. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  4897. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  4898. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  4899. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  4900. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  4901. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  4902. /* Reserved */
  4903. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  4904. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  4905. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  4906. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  4907. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  4908. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  4909. /* Reserved */
  4910. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  4911. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  4912. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  4913. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  4914. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  4915. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  4916. /* Reserved */
  4917. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  4918. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  4919. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  4920. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  4921. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  4922. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  4923. /* Reserved */
  4924. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  4925. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  4926. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  4927. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  4928. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  4929. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  4930. /* Control Wrapper */
  4931. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  4932. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  4933. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  4934. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  4935. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  4936. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  4937. /* Block Ack Request */
  4938. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  4939. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  4940. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  4941. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  4942. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  4943. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  4944. /* Block Ack*/
  4945. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  4946. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  4947. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  4948. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  4949. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  4950. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  4951. /* PS-POLL */
  4952. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  4953. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  4954. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  4955. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  4956. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  4957. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  4958. /* RTS */
  4959. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  4960. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  4961. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  4962. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  4963. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  4964. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  4965. /* CTS */
  4966. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  4967. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  4968. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  4969. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  4970. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  4971. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  4972. /* ACK */
  4973. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  4974. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  4975. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  4976. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  4977. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  4978. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  4979. /* CF-END */
  4980. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  4981. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  4982. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  4983. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  4984. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  4985. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  4986. /* CF-END + CF-ACK */
  4987. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  4988. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  4989. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  4990. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  4991. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  4992. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  4993. /* Multicast data */
  4994. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  4995. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  4996. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  4997. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  4998. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  4999. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  5000. /* Unicast data */
  5001. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  5002. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  5003. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  5004. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  5005. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  5006. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  5007. /* NULL data */
  5008. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  5009. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  5010. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  5011. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  5012. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  5013. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  5014. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  5015. do { \
  5016. HTT_CHECK_SET_VAL(httsym, value); \
  5017. (word) |= (value) << httsym##_S; \
  5018. } while (0)
  5019. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  5020. (((word) & httsym##_M) >> httsym##_S)
  5021. #define htt_rx_ring_pkt_enable_subtype_set( \
  5022. word, flag, mode, type, subtype, val) \
  5023. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  5024. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  5025. #define htt_rx_ring_pkt_enable_subtype_get( \
  5026. word, flag, mode, type, subtype) \
  5027. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  5028. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  5029. /* Definition to filter in TLVs */
  5030. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  5031. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  5032. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  5033. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  5034. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  5035. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  5036. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  5037. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  5038. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  5039. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  5040. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  5041. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  5042. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  5043. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  5044. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  5045. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  5046. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  5047. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  5048. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  5049. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  5050. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  5051. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  5052. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  5053. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  5054. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  5055. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  5056. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  5057. do { \
  5058. HTT_CHECK_SET_VAL(httsym, enable); \
  5059. (word) |= (enable) << httsym##_S; \
  5060. } while (0)
  5061. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  5062. (((word) & httsym##_M) >> httsym##_S)
  5063. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  5064. HTT_RX_RING_TLV_ENABLE_SET( \
  5065. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  5066. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  5067. HTT_RX_RING_TLV_ENABLE_GET( \
  5068. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  5069. /**
  5070. * @brief HTT_H2T_MSG_TYPE_RFS_CONFIG
  5071. * host --> target Receive Flow Steering configuration message definition.
  5072. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5073. * The reason for this is we want RFS to be configured and ready before MAC
  5074. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5075. *
  5076. * |31 24|23 16|15 9|8|7 0|
  5077. * |----------------+----------------+----------------+----------------|
  5078. * | reserved |E| msg type |
  5079. * |-------------------------------------------------------------------|
  5080. * Where E = RFS enable flag
  5081. *
  5082. * The RFS_CONFIG message consists of a single 4-byte word.
  5083. *
  5084. * Header fields:
  5085. * - MSG_TYPE
  5086. * Bits 7:0
  5087. * Purpose: identifies this as a RFS config msg
  5088. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  5089. * - RFS_CONFIG
  5090. * Bit 8
  5091. * Purpose: Tells target whether to enable (1) or disable (0)
  5092. * flow steering feature when sending rx indication messages to host
  5093. */
  5094. #define HTT_H2T_RFS_CONFIG_M 0x100
  5095. #define HTT_H2T_RFS_CONFIG_S 8
  5096. #define HTT_RX_RFS_CONFIG_GET(_var) \
  5097. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  5098. HTT_H2T_RFS_CONFIG_S)
  5099. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  5100. do { \
  5101. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  5102. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  5103. } while (0)
  5104. #define HTT_RFS_CFG_REQ_BYTES 4
  5105. /**
  5106. * @brief host -> target FW extended statistics retrieve
  5107. *
  5108. * @details
  5109. * The following field definitions describe the format of the HTT host
  5110. * to target FW extended stats retrieve message.
  5111. * The message specifies the type of stats the host wants to retrieve.
  5112. *
  5113. * |31 24|23 16|15 8|7 0|
  5114. * |-----------------------------------------------------------|
  5115. * | reserved | stats type | pdev_mask | msg type |
  5116. * |-----------------------------------------------------------|
  5117. * | config param [0] |
  5118. * |-----------------------------------------------------------|
  5119. * | config param [1] |
  5120. * |-----------------------------------------------------------|
  5121. * | config param [2] |
  5122. * |-----------------------------------------------------------|
  5123. * | config param [3] |
  5124. * |-----------------------------------------------------------|
  5125. * | reserved |
  5126. * |-----------------------------------------------------------|
  5127. * | cookie LSBs |
  5128. * |-----------------------------------------------------------|
  5129. * | cookie MSBs |
  5130. * |-----------------------------------------------------------|
  5131. * Header fields:
  5132. * - MSG_TYPE
  5133. * Bits 7:0
  5134. * Purpose: identifies this is a extended stats upload request message
  5135. * Value: 0x10
  5136. * - PDEV_MASK
  5137. * Bits 8:15
  5138. * Purpose: identifies the mask of PDEVs to retrieve stats from
  5139. * Value: This is a overloaded field, refer to usage and interpretation of
  5140. * PDEV in interface document.
  5141. * Bit 8 : Reserved for SOC stats
  5142. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5143. * Indicates MACID_MASK in DBS
  5144. * - STATS_TYPE
  5145. * Bits 23:16
  5146. * Purpose: identifies which FW statistics to upload
  5147. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  5148. * - Reserved
  5149. * Bits 31:24
  5150. * - CONFIG_PARAM [0]
  5151. * Bits 31:0
  5152. * Purpose: give an opaque configuration value to the specified stats type
  5153. * Value: stats-type specific configuration value
  5154. * Refer to htt_stats.h for interpretation for each stats sub_type
  5155. * - CONFIG_PARAM [1]
  5156. * Bits 31:0
  5157. * Purpose: give an opaque configuration value to the specified stats type
  5158. * Value: stats-type specific configuration value
  5159. * Refer to htt_stats.h for interpretation for each stats sub_type
  5160. * - CONFIG_PARAM [2]
  5161. * Bits 31:0
  5162. * Purpose: give an opaque configuration value to the specified stats type
  5163. * Value: stats-type specific configuration value
  5164. * Refer to htt_stats.h for interpretation for each stats sub_type
  5165. * - CONFIG_PARAM [3]
  5166. * Bits 31:0
  5167. * Purpose: give an opaque configuration value to the specified stats type
  5168. * Value: stats-type specific configuration value
  5169. * Refer to htt_stats.h for interpretation for each stats sub_type
  5170. * - Reserved [31:0] for future use.
  5171. * - COOKIE_LSBS
  5172. * Bits 31:0
  5173. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5174. * message with its preceding host->target stats request message.
  5175. * Value: LSBs of the opaque cookie specified by the host-side requestor
  5176. * - COOKIE_MSBS
  5177. * Bits 31:0
  5178. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5179. * message with its preceding host->target stats request message.
  5180. * Value: MSBs of the opaque cookie specified by the host-side requestor
  5181. */
  5182. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  5183. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  5184. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  5185. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  5186. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  5187. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  5188. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  5189. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  5190. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  5191. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  5192. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  5193. do { \
  5194. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  5195. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  5196. } while (0)
  5197. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  5198. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  5199. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  5200. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  5201. do { \
  5202. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  5203. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  5204. } while (0)
  5205. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  5206. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  5207. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  5208. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  5209. do { \
  5210. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  5211. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  5212. } while (0)
  5213. /**
  5214. * @brief host -> target FW PPDU_STATS request message
  5215. *
  5216. * @details
  5217. * The following field definitions describe the format of the HTT host
  5218. * to target FW for PPDU_STATS_CFG msg.
  5219. * The message allows the host to configure the PPDU_STATS_IND messages
  5220. * produced by the target.
  5221. *
  5222. * |31 24|23 16|15 8|7 0|
  5223. * |-----------------------------------------------------------|
  5224. * | REQ bit mask | pdev_mask | msg type |
  5225. * |-----------------------------------------------------------|
  5226. * Header fields:
  5227. * - MSG_TYPE
  5228. * Bits 7:0
  5229. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  5230. * Value: 0x11
  5231. * - PDEV_MASK
  5232. * Bits 8:15
  5233. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  5234. * Value: This is a overloaded field, refer to usage and interpretation of
  5235. * PDEV in interface document.
  5236. * Bit 8 : Reserved for SOC stats
  5237. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5238. * Indicates MACID_MASK in DBS
  5239. * - REQ_TLV_BIT_MASK
  5240. * Bits 16:31
  5241. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  5242. * needs to be included in the target's PPDU_STATS_IND messages.
  5243. * Value: refer htt_ppdu_stats_tlv_tag_t
  5244. *
  5245. */
  5246. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  5247. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  5248. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  5249. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  5250. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  5251. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  5252. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  5253. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  5254. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  5255. do { \
  5256. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  5257. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  5258. } while (0)
  5259. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  5260. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  5261. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  5262. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  5263. do { \
  5264. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  5265. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  5266. } while (0)
  5267. /**
  5268. * @brief Host-->target HTT RX FSE setup message
  5269. * @details
  5270. * Through this message, the host will provide details of the flow tables
  5271. * in host DDR along with hash keys.
  5272. * This message can be sent per SOC or per PDEV, which is differentiated
  5273. * by pdev id values.
  5274. * The host will allocate flow search table and sends table size,
  5275. * physical DMA address of flow table, and hash keys to firmware to
  5276. * program into the RXOLE FSE HW block.
  5277. *
  5278. * The following field definitions describe the format of the RX FSE setup
  5279. * message sent from the host to target
  5280. *
  5281. * Header fields:
  5282. * dword0 - b'7:0 - msg_type: This will be set to
  5283. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  5284. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5285. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  5286. * pdev's LMAC ring.
  5287. * b'31:16 - reserved : Reserved for future use
  5288. * dword1 - b'19:0 - number of records: This field indicates the number of
  5289. * entries in the flow table. For example: 8k number of
  5290. * records is equivalent to
  5291. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  5292. * b'27:20 - max search: This field specifies the skid length to FSE
  5293. * parser HW module whenever match is not found at the
  5294. * exact index pointed by hash.
  5295. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  5296. * Refer htt_ip_da_sa_prefix below for more details.
  5297. * b'31:30 - reserved: Reserved for future use
  5298. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  5299. * table allocated by host in DDR
  5300. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  5301. * table allocated by host in DDR
  5302. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  5303. * entry hashing
  5304. *
  5305. *
  5306. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  5307. * |---------------------------------------------------------------|
  5308. * | reserved | pdev_id | MSG_TYPE |
  5309. * |---------------------------------------------------------------|
  5310. * |resvd|IPDSA| max_search | Number of records |
  5311. * |---------------------------------------------------------------|
  5312. * | base address lo |
  5313. * |---------------------------------------------------------------|
  5314. * | base address high |
  5315. * |---------------------------------------------------------------|
  5316. * | toeplitz key 31_0 |
  5317. * |---------------------------------------------------------------|
  5318. * | toeplitz key 63_32 |
  5319. * |---------------------------------------------------------------|
  5320. * | toeplitz key 95_64 |
  5321. * |---------------------------------------------------------------|
  5322. * | toeplitz key 127_96 |
  5323. * |---------------------------------------------------------------|
  5324. * | toeplitz key 159_128 |
  5325. * |---------------------------------------------------------------|
  5326. * | toeplitz key 191_160 |
  5327. * |---------------------------------------------------------------|
  5328. * | toeplitz key 223_192 |
  5329. * |---------------------------------------------------------------|
  5330. * | toeplitz key 255_224 |
  5331. * |---------------------------------------------------------------|
  5332. * | toeplitz key 287_256 |
  5333. * |---------------------------------------------------------------|
  5334. * | reserved | toeplitz key 314_288(26:0 bits) |
  5335. * |---------------------------------------------------------------|
  5336. * where:
  5337. * IPDSA = ip_da_sa
  5338. */
  5339. /**
  5340. * @brief: htt_ip_da_sa_prefix
  5341. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  5342. * IPv6 addresses beginning with 0x20010db8 are reserved for
  5343. * documentation per RFC3849
  5344. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  5345. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  5346. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  5347. */
  5348. enum htt_ip_da_sa_prefix {
  5349. HTT_RX_IPV6_20010db8,
  5350. HTT_RX_IPV4_MAPPED_IPV6,
  5351. HTT_RX_IPV4_COMPATIBLE_IPV6,
  5352. HTT_RX_IPV6_64FF9B,
  5353. };
  5354. /**
  5355. * @brief Host-->target HTT RX FISA configure and enable
  5356. * @details
  5357. * The host will send this command down to configure and enable the FISA
  5358. * operational params.
  5359. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  5360. * register.
  5361. * Should configure both the MACs.
  5362. *
  5363. * dword0 - b'7:0 - msg_type: This will be set to HTT_H2T_MSG_TYPE_RX_FISA_CFG
  5364. *
  5365. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5366. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  5367. * pdev's LMAC ring.
  5368. * b'31:16 - reserved : Reserved for future use
  5369. *
  5370. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  5371. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  5372. * packets. 1 flow search will be skipped
  5373. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  5374. * tcp,udp packets
  5375. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  5376. * calculation
  5377. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  5378. * calculation
  5379. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  5380. * calculation
  5381. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  5382. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  5383. * length
  5384. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  5385. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  5386. * length
  5387. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  5388. * num jump
  5389. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  5390. * num jump
  5391. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  5392. * data type switch has happend for MPDU Sequence num jump
  5393. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  5394. * for MPDU Sequence num jump
  5395. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  5396. * for decrypt errors
  5397. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  5398. * while aggregating a msdu
  5399. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  5400. * The aggregation is done until (number of MSDUs aggregated
  5401. * < LIMIT + 1)
  5402. * b'31:18 - Reserved
  5403. *
  5404. * fisa_control_value - 32bit value FW can write to register
  5405. *
  5406. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  5407. * Threshold value for FISA timeout (units are microseconds).
  5408. * When the global timestamp exceeds this threshold, FISA
  5409. * aggregation will be restarted.
  5410. * A value of 0 means timeout is disabled.
  5411. * Compare the threshold register with timestamp field in
  5412. * flow entry to generate timeout for the flow.
  5413. *
  5414. * |31 18 |17 16|15 8|7 0|
  5415. * |-------------------------------------------------------------|
  5416. * | reserved | pdev_mask | msg type |
  5417. * |-------------------------------------------------------------|
  5418. * | reserved | FISA_CTRL |
  5419. * |-------------------------------------------------------------|
  5420. * | FISA_TIMEOUT_THRESH |
  5421. * |-------------------------------------------------------------|
  5422. */
  5423. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  5424. A_UINT32 msg_type:8,
  5425. pdev_id:8,
  5426. reserved0:16;
  5427. /**
  5428. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  5429. * [17:0]
  5430. */
  5431. union {
  5432. struct {
  5433. A_UINT32 fisa_enable: 1,
  5434. ipsec_skip_search: 1,
  5435. nontcp_skip_search: 1,
  5436. add_ipv4_fixed_hdr_len: 1,
  5437. add_ipv6_fixed_hdr_len: 1,
  5438. add_tcp_fixed_hdr_len: 1,
  5439. add_udp_hdr_len: 1,
  5440. chksum_cum_ip_len_en: 1,
  5441. disable_tid_check: 1,
  5442. disable_ta_check: 1,
  5443. disable_qos_check: 1,
  5444. disable_raw_check: 1,
  5445. disable_decrypt_err_check: 1,
  5446. disable_msdu_drop_check: 1,
  5447. fisa_aggr_limit: 4,
  5448. reserved: 14;
  5449. } fisa_control_bits;
  5450. A_UINT32 fisa_control_value;
  5451. } u_fisa_control;
  5452. /**
  5453. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  5454. * timeout threshold for aggregation. Unit in usec.
  5455. * [31:0]
  5456. */
  5457. A_UINT32 fisa_timeout_threshold;
  5458. } POSTPACK;
  5459. /* DWord 0: pdev-ID */
  5460. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  5461. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  5462. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  5463. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  5464. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  5465. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  5466. do { \
  5467. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  5468. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  5469. } while (0)
  5470. /* Dword 1: fisa_control_value fisa config */
  5471. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  5472. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  5473. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  5474. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  5475. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  5476. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  5477. do { \
  5478. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  5479. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  5480. } while (0)
  5481. /* Dword 1: fisa_control_value ipsec_skip_search */
  5482. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  5483. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  5484. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  5485. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  5486. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  5487. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  5488. do { \
  5489. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  5490. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  5491. } while (0)
  5492. /* Dword 1: fisa_control_value non_tcp_skip_search */
  5493. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  5494. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  5495. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  5496. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  5497. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  5498. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  5499. do { \
  5500. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  5501. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  5502. } while (0)
  5503. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  5504. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  5505. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  5506. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  5507. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  5508. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  5509. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  5510. do { \
  5511. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  5512. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  5513. } while (0)
  5514. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  5515. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  5516. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  5517. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  5518. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  5519. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  5520. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  5521. do { \
  5522. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  5523. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  5524. } while (0)
  5525. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  5526. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  5527. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  5528. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  5529. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  5530. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  5531. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  5532. do { \
  5533. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  5534. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  5535. } while (0)
  5536. /* Dword 1: fisa_control_value add_udp_hdr_len */
  5537. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  5538. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  5539. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  5540. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  5541. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  5542. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  5543. do { \
  5544. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  5545. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  5546. } while (0)
  5547. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  5548. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  5549. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  5550. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  5551. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  5552. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  5553. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  5554. do { \
  5555. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  5556. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  5557. } while (0)
  5558. /* Dword 1: fisa_control_value disable_tid_check */
  5559. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  5560. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  5561. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  5562. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  5563. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  5564. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  5565. do { \
  5566. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  5567. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  5568. } while (0)
  5569. /* Dword 1: fisa_control_value disable_ta_check */
  5570. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  5571. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  5572. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  5573. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  5574. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  5575. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  5576. do { \
  5577. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  5578. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  5579. } while (0)
  5580. /* Dword 1: fisa_control_value disable_qos_check */
  5581. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  5582. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  5583. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  5584. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  5585. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  5586. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  5587. do { \
  5588. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  5589. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  5590. } while (0)
  5591. /* Dword 1: fisa_control_value disable_raw_check */
  5592. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  5593. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  5594. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  5595. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  5596. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  5597. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  5598. do { \
  5599. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  5600. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  5601. } while (0)
  5602. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  5603. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  5604. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  5605. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  5606. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  5607. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  5608. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  5609. do { \
  5610. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  5611. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  5612. } while (0)
  5613. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  5614. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  5615. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  5616. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  5617. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  5618. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  5619. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  5620. do { \
  5621. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  5622. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  5623. } while (0)
  5624. /* Dword 1: fisa_control_value fisa_aggr_limit */
  5625. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  5626. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  5627. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  5628. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  5629. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  5630. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  5631. do { \
  5632. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  5633. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  5634. } while (0)
  5635. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  5636. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  5637. pdev_id:8,
  5638. reserved0:16;
  5639. A_UINT32 num_records:20,
  5640. max_search:8,
  5641. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  5642. reserved1:2;
  5643. A_UINT32 base_addr_lo;
  5644. A_UINT32 base_addr_hi;
  5645. A_UINT32 toeplitz31_0;
  5646. A_UINT32 toeplitz63_32;
  5647. A_UINT32 toeplitz95_64;
  5648. A_UINT32 toeplitz127_96;
  5649. A_UINT32 toeplitz159_128;
  5650. A_UINT32 toeplitz191_160;
  5651. A_UINT32 toeplitz223_192;
  5652. A_UINT32 toeplitz255_224;
  5653. A_UINT32 toeplitz287_256;
  5654. A_UINT32 toeplitz314_288:27,
  5655. reserved2:5;
  5656. } POSTPACK;
  5657. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  5658. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  5659. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  5660. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  5661. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  5662. /* DWORD 0: Pdev ID */
  5663. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  5664. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  5665. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  5666. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  5667. HTT_RX_FSE_SETUP_PDEV_ID_S)
  5668. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  5669. do { \
  5670. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  5671. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  5672. } while (0)
  5673. /* DWORD 1:num of records */
  5674. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  5675. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  5676. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  5677. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  5678. HTT_RX_FSE_SETUP_NUM_REC_S)
  5679. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  5680. do { \
  5681. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  5682. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  5683. } while (0)
  5684. /* DWORD 1:max_search */
  5685. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  5686. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  5687. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  5688. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  5689. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  5690. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  5691. do { \
  5692. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  5693. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  5694. } while (0)
  5695. /* DWORD 1:ip_da_sa prefix */
  5696. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  5697. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  5698. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  5699. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  5700. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  5701. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  5702. do { \
  5703. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  5704. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  5705. } while (0)
  5706. /* DWORD 2: Base Address LO */
  5707. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  5708. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  5709. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  5710. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  5711. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  5712. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  5713. do { \
  5714. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  5715. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  5716. } while (0)
  5717. /* DWORD 3: Base Address High */
  5718. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  5719. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  5720. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  5721. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  5722. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  5723. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  5724. do { \
  5725. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  5726. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  5727. } while (0)
  5728. /* DWORD 4-12: Hash Value */
  5729. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  5730. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  5731. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  5732. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  5733. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  5734. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  5735. do { \
  5736. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  5737. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  5738. } while (0)
  5739. /* DWORD 13: Hash Value 314:288 bits */
  5740. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  5741. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  5742. HTT_RX_FSE_SETUP_HASH_314_288_S)
  5743. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  5744. do { \
  5745. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  5746. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  5747. } while (0)
  5748. /**
  5749. * @brief Host-->target HTT RX FSE operation message
  5750. * @details
  5751. * The host will send this Flow Search Engine (FSE) operation message for
  5752. * every flow add/delete operation.
  5753. * The FSE operation includes FSE full cache invalidation or individual entry
  5754. * invalidation.
  5755. * This message can be sent per SOC or per PDEV which is differentiated
  5756. * by pdev id values.
  5757. *
  5758. * |31 16|15 8|7 1|0|
  5759. * |-------------------------------------------------------------|
  5760. * | reserved | pdev_id | MSG_TYPE |
  5761. * |-------------------------------------------------------------|
  5762. * | reserved | operation |I|
  5763. * |-------------------------------------------------------------|
  5764. * | ip_src_addr_31_0 |
  5765. * |-------------------------------------------------------------|
  5766. * | ip_src_addr_63_32 |
  5767. * |-------------------------------------------------------------|
  5768. * | ip_src_addr_95_64 |
  5769. * |-------------------------------------------------------------|
  5770. * | ip_src_addr_127_96 |
  5771. * |-------------------------------------------------------------|
  5772. * | ip_dst_addr_31_0 |
  5773. * |-------------------------------------------------------------|
  5774. * | ip_dst_addr_63_32 |
  5775. * |-------------------------------------------------------------|
  5776. * | ip_dst_addr_95_64 |
  5777. * |-------------------------------------------------------------|
  5778. * | ip_dst_addr_127_96 |
  5779. * |-------------------------------------------------------------|
  5780. * | l4_dst_port | l4_src_port |
  5781. * | (32-bit SPI incase of IPsec) |
  5782. * |-------------------------------------------------------------|
  5783. * | reserved | l4_proto |
  5784. * |-------------------------------------------------------------|
  5785. *
  5786. * where I is 1-bit ipsec_valid.
  5787. *
  5788. * The following field definitions describe the format of the RX FSE operation
  5789. * message sent from the host to target for every add/delete flow entry to flow
  5790. * table.
  5791. *
  5792. * Header fields:
  5793. * dword0 - b'7:0 - msg_type: This will be set to
  5794. * HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  5795. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5796. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  5797. * specified pdev's LMAC ring.
  5798. * b'31:16 - reserved : Reserved for future use
  5799. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  5800. * (Internet Protocol Security).
  5801. * IPsec describes the framework for providing security at
  5802. * IP layer. IPsec is defined for both versions of IP:
  5803. * IPV4 and IPV6.
  5804. * Please refer to htt_rx_flow_proto enumeration below for
  5805. * more info.
  5806. * ipsec_valid = 1 for IPSEC packets
  5807. * ipsec_valid = 0 for IP Packets
  5808. * b'7:1 - operation: This indicates types of FSE operation.
  5809. * Refer to htt_rx_fse_operation enumeration:
  5810. * 0 - No Cache Invalidation required
  5811. * 1 - Cache invalidate only one entry given by IP
  5812. * src/dest address at DWORD[2:9]
  5813. * 2 - Complete FSE Cache Invalidation
  5814. * 3 - FSE Disable
  5815. * 4 - FSE Enable
  5816. * b'31:8 - reserved: Reserved for future use
  5817. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  5818. * for per flow addition/deletion
  5819. * For IPV4 src/dest addresses, the first A_UINT32 is used
  5820. * and the subsequent 3 A_UINT32 will be padding bytes.
  5821. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  5822. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  5823. * from 0 to 65535 but only 0 to 1023 are designated as
  5824. * well-known ports. Refer to [RFC1700] for more details.
  5825. * This field is valid only if
  5826. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  5827. * - L4 dest port (31:16): 16-bit Destination Port numbers
  5828. * range from 0 to 65535 but only 0 to 1023 are designated
  5829. * as well-known ports. Refer to [RFC1700] for more details.
  5830. * This field is valid only if
  5831. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  5832. * - SPI (31:0): Security Parameters Index is an
  5833. * identification tag added to the header while using IPsec
  5834. * for tunneling the IP traffici.
  5835. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  5836. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  5837. * Assigned Internet Protocol Numbers.
  5838. * l4_proto numbers for standard protocol like UDP/TCP
  5839. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  5840. * l4_proto = 17 for UDP etc.
  5841. * b'31:8 - reserved: Reserved for future use.
  5842. *
  5843. */
  5844. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  5845. A_UINT32 msg_type:8,
  5846. pdev_id:8,
  5847. reserved0:16;
  5848. A_UINT32 ipsec_valid:1,
  5849. operation:7,
  5850. reserved1:24;
  5851. A_UINT32 ip_src_addr_31_0;
  5852. A_UINT32 ip_src_addr_63_32;
  5853. A_UINT32 ip_src_addr_95_64;
  5854. A_UINT32 ip_src_addr_127_96;
  5855. A_UINT32 ip_dest_addr_31_0;
  5856. A_UINT32 ip_dest_addr_63_32;
  5857. A_UINT32 ip_dest_addr_95_64;
  5858. A_UINT32 ip_dest_addr_127_96;
  5859. union {
  5860. A_UINT32 spi;
  5861. struct {
  5862. A_UINT32 l4_src_port:16,
  5863. l4_dest_port:16;
  5864. } ip;
  5865. } u;
  5866. A_UINT32 l4_proto:8,
  5867. reserved:24;
  5868. } POSTPACK;
  5869. /**
  5870. * Enumeration for IP Protocol or IPSEC Protocol
  5871. * IPsec describes the framework for providing security at IP layer.
  5872. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  5873. */
  5874. enum htt_rx_flow_proto {
  5875. HTT_RX_FLOW_IP_PROTO,
  5876. HTT_RX_FLOW_IPSEC_PROTO,
  5877. };
  5878. /**
  5879. * Enumeration for FSE Cache Invalidation
  5880. * 0 - No Cache Invalidation required
  5881. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  5882. * 2 - Complete FSE Cache Invalidation
  5883. * 3 - FSE Disable
  5884. * 4 - FSE Enable
  5885. */
  5886. enum htt_rx_fse_operation {
  5887. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  5888. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  5889. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  5890. HTT_RX_FSE_DISABLE,
  5891. HTT_RX_FSE_ENABLE,
  5892. };
  5893. /* DWORD 0: Pdev ID */
  5894. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  5895. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  5896. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  5897. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  5898. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  5899. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  5900. do { \
  5901. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  5902. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  5903. } while (0)
  5904. /* DWORD 1:IP PROTO or IPSEC */
  5905. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  5906. #define HTT_RX_FSE_IPSEC_VALID_S 0
  5907. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  5908. do { \
  5909. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  5910. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  5911. } while (0)
  5912. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  5913. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  5914. /* DWORD 1:FSE Operation */
  5915. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  5916. #define HTT_RX_FSE_OPERATION_S 1
  5917. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  5918. do { \
  5919. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  5920. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  5921. } while (0)
  5922. #define HTT_RX_FSE_OPERATION_GET(word) \
  5923. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  5924. /* DWORD 2-9:IP Address */
  5925. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  5926. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  5927. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  5928. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  5929. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  5930. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  5931. do { \
  5932. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  5933. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  5934. } while (0)
  5935. /* DWORD 10:Source Port Number */
  5936. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  5937. #define HTT_RX_FSE_SOURCEPORT_S 0
  5938. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  5939. do { \
  5940. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  5941. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  5942. } while (0)
  5943. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  5944. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  5945. /* DWORD 11:Destination Port Number */
  5946. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  5947. #define HTT_RX_FSE_DESTPORT_S 16
  5948. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  5949. do { \
  5950. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  5951. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  5952. } while (0)
  5953. #define HTT_RX_FSE_DESTPORT_GET(word) \
  5954. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  5955. /* DWORD 10-11:SPI (In case of IPSEC) */
  5956. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  5957. #define HTT_RX_FSE_OPERATION_SPI_S 0
  5958. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  5959. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  5960. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  5961. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  5962. do { \
  5963. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  5964. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  5965. } while (0)
  5966. /* DWORD 12:L4 PROTO */
  5967. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  5968. #define HTT_RX_FSE_L4_PROTO_S 0
  5969. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  5970. do { \
  5971. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  5972. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  5973. } while (0)
  5974. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  5975. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  5976. /**
  5977. * @brief HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  5978. * host --> target Receive to configure the RxOLE 3-tuple Hash
  5979. *
  5980. * |31 24|23 |15 8|7 2|1|0|
  5981. * |----------------+----------------+----------------+----------------|
  5982. * | reserved | pdev_id | msg_type |
  5983. * |---------------------------------+----------------+----------------|
  5984. * | reserved |E|F|
  5985. * |---------------------------------+----------------+----------------|
  5986. * Where E = Configure the target to provide the 3-tuple hash value in
  5987. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  5988. * F = Configure the target to provide the 3-tuple hash value in
  5989. * flow_id_toeplitz field of rx_msdu_start tlv
  5990. *
  5991. * The following field definitions describe the format of the 3 tuple hash value
  5992. * message sent from the host to target as part of initialization sequence.
  5993. *
  5994. * Header fields:
  5995. * dword0 - b'7:0 - msg_type: This will be set to
  5996. * HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  5997. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5998. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  5999. * specified pdev's LMAC ring.
  6000. * b'31:16 - reserved : Reserved for future use
  6001. * dword1 - b'0 - flow_id_toeplitz_field_enable
  6002. * b'1 - toeplitz_hash_2_or_4_field_enable
  6003. * b'31:2 - reserved : Reserved for future use
  6004. * ---------+------+----------------------------------------------------------
  6005. * bit1 | bit0 | Functionality
  6006. * ---------+------+----------------------------------------------------------
  6007. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  6008. * | | in flow_id_toeplitz field
  6009. * ---------+------+----------------------------------------------------------
  6010. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  6011. * | | in toeplitz_hash_2_or_4 field
  6012. * ---------+------+----------------------------------------------------------
  6013. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  6014. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  6015. * ---------+------+----------------------------------------------------------
  6016. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  6017. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  6018. * | | toeplitz_hash_2_or_4 field
  6019. *----------------------------------------------------------------------------
  6020. */
  6021. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  6022. A_UINT32 msg_type :8,
  6023. pdev_id :8,
  6024. reserved0 :16;
  6025. A_UINT32 flow_id_toeplitz_field_enable :1,
  6026. toeplitz_hash_2_or_4_field_enable :1,
  6027. reserved1 :30;
  6028. } POSTPACK;
  6029. /* DWORD0 : pdev_id configuration Macros */
  6030. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  6031. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  6032. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  6033. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  6034. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  6035. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  6036. do { \
  6037. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  6038. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  6039. } while (0)
  6040. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  6041. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  6042. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  6043. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  6044. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  6045. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  6046. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  6047. do { \
  6048. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  6049. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  6050. } while (0)
  6051. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  6052. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  6053. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  6054. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  6055. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  6056. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  6057. do { \
  6058. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  6059. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  6060. } while (0)
  6061. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  6062. /*=== target -> host messages ===============================================*/
  6063. enum htt_t2h_msg_type {
  6064. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  6065. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  6066. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  6067. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  6068. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  6069. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  6070. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  6071. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  6072. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  6073. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  6074. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  6075. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  6076. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  6077. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  6078. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  6079. /* only used for HL, add HTT MSG for HTT CREDIT update */
  6080. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  6081. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  6082. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  6083. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  6084. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  6085. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  6086. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  6087. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  6088. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  6089. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  6090. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  6091. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  6092. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  6093. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  6094. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  6095. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  6096. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  6097. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  6098. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  6099. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  6100. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  6101. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  6102. /* TX_OFFLOAD_DELIVER_IND:
  6103. * Forward the target's locally-generated packets to the host,
  6104. * to provide to the monitor mode interface.
  6105. */
  6106. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  6107. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  6108. HTT_T2H_MSG_TYPE_TEST,
  6109. /* keep this last */
  6110. HTT_T2H_NUM_MSGS
  6111. };
  6112. /*
  6113. * HTT target to host message type -
  6114. * stored in bits 7:0 of the first word of the message
  6115. */
  6116. #define HTT_T2H_MSG_TYPE_M 0xff
  6117. #define HTT_T2H_MSG_TYPE_S 0
  6118. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  6119. do { \
  6120. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  6121. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  6122. } while (0)
  6123. #define HTT_T2H_MSG_TYPE_GET(word) \
  6124. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  6125. /**
  6126. * @brief target -> host version number confirmation message definition
  6127. *
  6128. * |31 24|23 16|15 8|7 0|
  6129. * |----------------+----------------+----------------+----------------|
  6130. * | reserved | major number | minor number | msg type |
  6131. * |-------------------------------------------------------------------|
  6132. * : option request TLV (optional) |
  6133. * :...................................................................:
  6134. *
  6135. * The VER_CONF message may consist of a single 4-byte word, or may be
  6136. * extended with TLVs that specify HTT options selected by the target.
  6137. * The following option TLVs may be appended to the VER_CONF message:
  6138. * - LL_BUS_ADDR_SIZE
  6139. * - HL_SUPPRESS_TX_COMPL_IND
  6140. * - MAX_TX_QUEUE_GROUPS
  6141. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  6142. * may be appended to the VER_CONF message (but only one TLV of each type).
  6143. *
  6144. * Header fields:
  6145. * - MSG_TYPE
  6146. * Bits 7:0
  6147. * Purpose: identifies this as a version number confirmation message
  6148. * Value: 0x0
  6149. * - VER_MINOR
  6150. * Bits 15:8
  6151. * Purpose: Specify the minor number of the HTT message library version
  6152. * in use by the target firmware.
  6153. * The minor number specifies the specific revision within a range
  6154. * of fundamentally compatible HTT message definition revisions.
  6155. * Compatible revisions involve adding new messages or perhaps
  6156. * adding new fields to existing messages, in a backwards-compatible
  6157. * manner.
  6158. * Incompatible revisions involve changing the message type values,
  6159. * or redefining existing messages.
  6160. * Value: minor number
  6161. * - VER_MAJOR
  6162. * Bits 15:8
  6163. * Purpose: Specify the major number of the HTT message library version
  6164. * in use by the target firmware.
  6165. * The major number specifies the family of minor revisions that are
  6166. * fundamentally compatible with each other, but not with prior or
  6167. * later families.
  6168. * Value: major number
  6169. */
  6170. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  6171. #define HTT_VER_CONF_MINOR_S 8
  6172. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  6173. #define HTT_VER_CONF_MAJOR_S 16
  6174. #define HTT_VER_CONF_MINOR_SET(word, value) \
  6175. do { \
  6176. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  6177. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  6178. } while (0)
  6179. #define HTT_VER_CONF_MINOR_GET(word) \
  6180. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  6181. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  6182. do { \
  6183. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  6184. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  6185. } while (0)
  6186. #define HTT_VER_CONF_MAJOR_GET(word) \
  6187. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  6188. #define HTT_VER_CONF_BYTES 4
  6189. /**
  6190. * @brief - target -> host HTT Rx In order indication message
  6191. *
  6192. * @details
  6193. *
  6194. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  6195. * |----------------+-------------------+---------------------+---------------|
  6196. * | peer ID | P| F| O| ext TID | msg type |
  6197. * |--------------------------------------------------------------------------|
  6198. * | MSDU count | Reserved | vdev id |
  6199. * |--------------------------------------------------------------------------|
  6200. * | MSDU 0 bus address (bits 31:0) |
  6201. #if HTT_PADDR64
  6202. * | MSDU 0 bus address (bits 63:32) |
  6203. #endif
  6204. * |--------------------------------------------------------------------------|
  6205. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  6206. * |--------------------------------------------------------------------------|
  6207. * | MSDU 1 bus address (bits 31:0) |
  6208. #if HTT_PADDR64
  6209. * | MSDU 1 bus address (bits 63:32) |
  6210. #endif
  6211. * |--------------------------------------------------------------------------|
  6212. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  6213. * |--------------------------------------------------------------------------|
  6214. */
  6215. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  6216. *
  6217. * @details
  6218. * bits
  6219. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  6220. * |-----+----+-------+--------+--------+---------+---------+-----------|
  6221. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  6222. * | | frag | | | | fail |chksum fail|
  6223. * |-----+----+-------+--------+--------+---------+---------+-----------|
  6224. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  6225. */
  6226. struct htt_rx_in_ord_paddr_ind_hdr_t
  6227. {
  6228. A_UINT32 /* word 0 */
  6229. msg_type: 8,
  6230. ext_tid: 5,
  6231. offload: 1,
  6232. frag: 1,
  6233. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  6234. peer_id: 16;
  6235. A_UINT32 /* word 1 */
  6236. vap_id: 8,
  6237. /* NOTE:
  6238. * This reserved_1 field is not truly reserved - certain targets use
  6239. * this field internally to store debug information, and do not zero
  6240. * out the contents of the field before uploading the message to the
  6241. * host. Thus, any host-target communication supported by this field
  6242. * is limited to using values that are never used by the debug
  6243. * information stored by certain targets in the reserved_1 field.
  6244. * In particular, the targets in question don't use the value 0x3
  6245. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  6246. * so this previously-unused value within these bits is available to
  6247. * use as the host / target PKT_CAPTURE_MODE flag.
  6248. */
  6249. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  6250. /* if pkt_capture_mode == 0x3, host should
  6251. * send rx frames to monitor mode interface
  6252. */
  6253. msdu_cnt: 16;
  6254. };
  6255. struct htt_rx_in_ord_paddr_ind_msdu32_t
  6256. {
  6257. A_UINT32 dma_addr;
  6258. A_UINT32
  6259. length: 16,
  6260. fw_desc: 8,
  6261. msdu_info:8;
  6262. };
  6263. struct htt_rx_in_ord_paddr_ind_msdu64_t
  6264. {
  6265. A_UINT32 dma_addr_lo;
  6266. A_UINT32 dma_addr_hi;
  6267. A_UINT32
  6268. length: 16,
  6269. fw_desc: 8,
  6270. msdu_info:8;
  6271. };
  6272. #if HTT_PADDR64
  6273. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  6274. #else
  6275. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  6276. #endif
  6277. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  6278. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  6279. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  6280. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  6281. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  6282. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  6283. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  6284. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  6285. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  6286. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  6287. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  6288. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  6289. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  6290. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  6291. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  6292. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  6293. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  6294. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  6295. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  6296. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  6297. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  6298. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  6299. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  6300. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  6301. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  6302. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  6303. /* for systems using 64-bit format for bus addresses */
  6304. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  6305. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  6306. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  6307. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  6308. /* for systems using 32-bit format for bus addresses */
  6309. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  6310. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  6311. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  6312. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  6313. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  6314. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  6315. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  6316. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  6317. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  6318. do { \
  6319. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  6320. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  6321. } while (0)
  6322. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  6323. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  6324. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  6325. do { \
  6326. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  6327. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  6328. } while (0)
  6329. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  6330. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  6331. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  6332. do { \
  6333. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  6334. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  6335. } while (0)
  6336. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  6337. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  6338. /*
  6339. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  6340. * deliver the rx frames to the monitor mode interface.
  6341. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  6342. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  6343. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  6344. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  6345. */
  6346. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  6347. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  6348. do { \
  6349. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  6350. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  6351. } while (0)
  6352. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  6353. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  6354. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  6355. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  6356. do { \
  6357. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  6358. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  6359. } while (0)
  6360. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  6361. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  6362. /* for systems using 64-bit format for bus addresses */
  6363. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  6364. do { \
  6365. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  6366. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  6367. } while (0)
  6368. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  6369. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  6370. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  6371. do { \
  6372. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  6373. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  6374. } while (0)
  6375. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  6376. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  6377. /* for systems using 32-bit format for bus addresses */
  6378. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  6379. do { \
  6380. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  6381. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  6382. } while (0)
  6383. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  6384. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  6385. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  6386. do { \
  6387. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  6388. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  6389. } while (0)
  6390. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  6391. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  6392. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  6393. do { \
  6394. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  6395. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  6396. } while (0)
  6397. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  6398. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  6399. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  6400. do { \
  6401. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  6402. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  6403. } while (0)
  6404. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  6405. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  6406. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  6407. do { \
  6408. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  6409. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  6410. } while (0)
  6411. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  6412. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  6413. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  6414. do { \
  6415. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  6416. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  6417. } while (0)
  6418. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  6419. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  6420. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  6421. do { \
  6422. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  6423. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  6424. } while (0)
  6425. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  6426. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  6427. /* definitions used within target -> host rx indication message */
  6428. PREPACK struct htt_rx_ind_hdr_prefix_t
  6429. {
  6430. A_UINT32 /* word 0 */
  6431. msg_type: 8,
  6432. ext_tid: 5,
  6433. release_valid: 1,
  6434. flush_valid: 1,
  6435. reserved0: 1,
  6436. peer_id: 16;
  6437. A_UINT32 /* word 1 */
  6438. flush_start_seq_num: 6,
  6439. flush_end_seq_num: 6,
  6440. release_start_seq_num: 6,
  6441. release_end_seq_num: 6,
  6442. num_mpdu_ranges: 8;
  6443. } POSTPACK;
  6444. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  6445. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  6446. #define HTT_TGT_RSSI_INVALID 0x80
  6447. PREPACK struct htt_rx_ppdu_desc_t
  6448. {
  6449. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  6450. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  6451. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  6452. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  6453. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  6454. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  6455. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  6456. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  6457. A_UINT32 /* word 0 */
  6458. rssi_cmb: 8,
  6459. timestamp_submicrosec: 8,
  6460. phy_err_code: 8,
  6461. phy_err: 1,
  6462. legacy_rate: 4,
  6463. legacy_rate_sel: 1,
  6464. end_valid: 1,
  6465. start_valid: 1;
  6466. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  6467. union {
  6468. A_UINT32 /* word 1 */
  6469. rssi0_pri20: 8,
  6470. rssi0_ext20: 8,
  6471. rssi0_ext40: 8,
  6472. rssi0_ext80: 8;
  6473. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  6474. } u0;
  6475. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  6476. union {
  6477. A_UINT32 /* word 2 */
  6478. rssi1_pri20: 8,
  6479. rssi1_ext20: 8,
  6480. rssi1_ext40: 8,
  6481. rssi1_ext80: 8;
  6482. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  6483. } u1;
  6484. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  6485. union {
  6486. A_UINT32 /* word 3 */
  6487. rssi2_pri20: 8,
  6488. rssi2_ext20: 8,
  6489. rssi2_ext40: 8,
  6490. rssi2_ext80: 8;
  6491. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  6492. } u2;
  6493. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  6494. union {
  6495. A_UINT32 /* word 4 */
  6496. rssi3_pri20: 8,
  6497. rssi3_ext20: 8,
  6498. rssi3_ext40: 8,
  6499. rssi3_ext80: 8;
  6500. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  6501. } u3;
  6502. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  6503. A_UINT32 tsf32; /* word 5 */
  6504. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  6505. A_UINT32 timestamp_microsec; /* word 6 */
  6506. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  6507. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  6508. A_UINT32 /* word 7 */
  6509. vht_sig_a1: 24,
  6510. preamble_type: 8;
  6511. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  6512. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  6513. A_UINT32 /* word 8 */
  6514. vht_sig_a2: 24,
  6515. /* sa_ant_matrix
  6516. * For cases where a single rx chain has options to be connected to
  6517. * different rx antennas, show which rx antennas were in use during
  6518. * receipt of a given PPDU.
  6519. * This sa_ant_matrix provides a bitmask of the antennas used while
  6520. * receiving this frame.
  6521. */
  6522. sa_ant_matrix: 8;
  6523. } POSTPACK;
  6524. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  6525. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  6526. PREPACK struct htt_rx_ind_hdr_suffix_t
  6527. {
  6528. A_UINT32 /* word 0 */
  6529. fw_rx_desc_bytes: 16,
  6530. reserved0: 16;
  6531. } POSTPACK;
  6532. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  6533. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  6534. PREPACK struct htt_rx_ind_hdr_t
  6535. {
  6536. struct htt_rx_ind_hdr_prefix_t prefix;
  6537. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  6538. struct htt_rx_ind_hdr_suffix_t suffix;
  6539. } POSTPACK;
  6540. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  6541. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  6542. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  6543. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  6544. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  6545. /*
  6546. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  6547. * the offset into the HTT rx indication message at which the
  6548. * FW rx PPDU descriptor resides
  6549. */
  6550. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  6551. /*
  6552. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  6553. * the offset into the HTT rx indication message at which the
  6554. * header suffix (FW rx MSDU byte count) resides
  6555. */
  6556. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  6557. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  6558. /*
  6559. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  6560. * the offset into the HTT rx indication message at which the per-MSDU
  6561. * information starts
  6562. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  6563. * per-MSDU information portion of the message. The per-MSDU info itself
  6564. * starts at byte 12.
  6565. */
  6566. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  6567. /**
  6568. * @brief target -> host rx indication message definition
  6569. *
  6570. * @details
  6571. * The following field definitions describe the format of the rx indication
  6572. * message sent from the target to the host.
  6573. * The message consists of three major sections:
  6574. * 1. a fixed-length header
  6575. * 2. a variable-length list of firmware rx MSDU descriptors
  6576. * 3. one or more 4-octet MPDU range information elements
  6577. * The fixed length header itself has two sub-sections
  6578. * 1. the message meta-information, including identification of the
  6579. * sender and type of the received data, and a 4-octet flush/release IE
  6580. * 2. the firmware rx PPDU descriptor
  6581. *
  6582. * The format of the message is depicted below.
  6583. * in this depiction, the following abbreviations are used for information
  6584. * elements within the message:
  6585. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  6586. * elements associated with the PPDU start are valid.
  6587. * Specifically, the following fields are valid only if SV is set:
  6588. * RSSI (all variants), L, legacy rate, preamble type, service,
  6589. * VHT-SIG-A
  6590. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  6591. * elements associated with the PPDU end are valid.
  6592. * Specifically, the following fields are valid only if EV is set:
  6593. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  6594. * - L - Legacy rate selector - if legacy rates are used, this flag
  6595. * indicates whether the rate is from a CCK (L == 1) or OFDM
  6596. * (L == 0) PHY.
  6597. * - P - PHY error flag - boolean indication of whether the rx frame had
  6598. * a PHY error
  6599. *
  6600. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  6601. * |----------------+-------------------+---------------------+---------------|
  6602. * | peer ID | |RV|FV| ext TID | msg type |
  6603. * |--------------------------------------------------------------------------|
  6604. * | num | release | release | flush | flush |
  6605. * | MPDU | end | start | end | start |
  6606. * | ranges | seq num | seq num | seq num | seq num |
  6607. * |==========================================================================|
  6608. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  6609. * |V|V| | rate | | | timestamp | RSSI |
  6610. * |--------------------------------------------------------------------------|
  6611. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  6612. * |--------------------------------------------------------------------------|
  6613. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  6614. * |--------------------------------------------------------------------------|
  6615. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  6616. * |--------------------------------------------------------------------------|
  6617. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  6618. * |--------------------------------------------------------------------------|
  6619. * | TSF LSBs |
  6620. * |--------------------------------------------------------------------------|
  6621. * | microsec timestamp |
  6622. * |--------------------------------------------------------------------------|
  6623. * | preamble type | HT-SIG / VHT-SIG-A1 |
  6624. * |--------------------------------------------------------------------------|
  6625. * | service | HT-SIG / VHT-SIG-A2 |
  6626. * |==========================================================================|
  6627. * | reserved | FW rx desc bytes |
  6628. * |--------------------------------------------------------------------------|
  6629. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  6630. * | desc B3 | desc B2 | desc B1 | desc B0 |
  6631. * |--------------------------------------------------------------------------|
  6632. * : : :
  6633. * |--------------------------------------------------------------------------|
  6634. * | alignment | MSDU Rx |
  6635. * | padding | desc Bn |
  6636. * |--------------------------------------------------------------------------|
  6637. * | reserved | MPDU range status | MPDU count |
  6638. * |--------------------------------------------------------------------------|
  6639. * : reserved : MPDU range status : MPDU count :
  6640. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  6641. *
  6642. * Header fields:
  6643. * - MSG_TYPE
  6644. * Bits 7:0
  6645. * Purpose: identifies this as an rx indication message
  6646. * Value: 0x1
  6647. * - EXT_TID
  6648. * Bits 12:8
  6649. * Purpose: identify the traffic ID of the rx data, including
  6650. * special "extended" TID values for multicast, broadcast, and
  6651. * non-QoS data frames
  6652. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  6653. * - FLUSH_VALID (FV)
  6654. * Bit 13
  6655. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  6656. * is valid
  6657. * Value:
  6658. * 1 -> flush IE is valid and needs to be processed
  6659. * 0 -> flush IE is not valid and should be ignored
  6660. * - REL_VALID (RV)
  6661. * Bit 13
  6662. * Purpose: indicate whether the release IE (start/end sequence numbers)
  6663. * is valid
  6664. * Value:
  6665. * 1 -> release IE is valid and needs to be processed
  6666. * 0 -> release IE is not valid and should be ignored
  6667. * - PEER_ID
  6668. * Bits 31:16
  6669. * Purpose: Identify, by ID, which peer sent the rx data
  6670. * Value: ID of the peer who sent the rx data
  6671. * - FLUSH_SEQ_NUM_START
  6672. * Bits 5:0
  6673. * Purpose: Indicate the start of a series of MPDUs to flush
  6674. * Not all MPDUs within this series are necessarily valid - the host
  6675. * must check each sequence number within this range to see if the
  6676. * corresponding MPDU is actually present.
  6677. * This field is only valid if the FV bit is set.
  6678. * Value:
  6679. * The sequence number for the first MPDUs to check to flush.
  6680. * The sequence number is masked by 0x3f.
  6681. * - FLUSH_SEQ_NUM_END
  6682. * Bits 11:6
  6683. * Purpose: Indicate the end of a series of MPDUs to flush
  6684. * Value:
  6685. * The sequence number one larger than the sequence number of the
  6686. * last MPDU to check to flush.
  6687. * The sequence number is masked by 0x3f.
  6688. * Not all MPDUs within this series are necessarily valid - the host
  6689. * must check each sequence number within this range to see if the
  6690. * corresponding MPDU is actually present.
  6691. * This field is only valid if the FV bit is set.
  6692. * - REL_SEQ_NUM_START
  6693. * Bits 17:12
  6694. * Purpose: Indicate the start of a series of MPDUs to release.
  6695. * All MPDUs within this series are present and valid - the host
  6696. * need not check each sequence number within this range to see if
  6697. * the corresponding MPDU is actually present.
  6698. * This field is only valid if the RV bit is set.
  6699. * Value:
  6700. * The sequence number for the first MPDUs to check to release.
  6701. * The sequence number is masked by 0x3f.
  6702. * - REL_SEQ_NUM_END
  6703. * Bits 23:18
  6704. * Purpose: Indicate the end of a series of MPDUs to release.
  6705. * Value:
  6706. * The sequence number one larger than the sequence number of the
  6707. * last MPDU to check to release.
  6708. * The sequence number is masked by 0x3f.
  6709. * All MPDUs within this series are present and valid - the host
  6710. * need not check each sequence number within this range to see if
  6711. * the corresponding MPDU is actually present.
  6712. * This field is only valid if the RV bit is set.
  6713. * - NUM_MPDU_RANGES
  6714. * Bits 31:24
  6715. * Purpose: Indicate how many ranges of MPDUs are present.
  6716. * Each MPDU range consists of a series of contiguous MPDUs within the
  6717. * rx frame sequence which all have the same MPDU status.
  6718. * Value: 1-63 (typically a small number, like 1-3)
  6719. *
  6720. * Rx PPDU descriptor fields:
  6721. * - RSSI_CMB
  6722. * Bits 7:0
  6723. * Purpose: Combined RSSI from all active rx chains, across the active
  6724. * bandwidth.
  6725. * Value: RSSI dB units w.r.t. noise floor
  6726. * - TIMESTAMP_SUBMICROSEC
  6727. * Bits 15:8
  6728. * Purpose: high-resolution timestamp
  6729. * Value:
  6730. * Sub-microsecond time of PPDU reception.
  6731. * This timestamp ranges from [0,MAC clock MHz).
  6732. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  6733. * to form a high-resolution, large range rx timestamp.
  6734. * - PHY_ERR_CODE
  6735. * Bits 23:16
  6736. * Purpose:
  6737. * If the rx frame processing resulted in a PHY error, indicate what
  6738. * type of rx PHY error occurred.
  6739. * Value:
  6740. * This field is valid if the "P" (PHY_ERR) flag is set.
  6741. * TBD: document/specify the values for this field
  6742. * - PHY_ERR
  6743. * Bit 24
  6744. * Purpose: indicate whether the rx PPDU had a PHY error
  6745. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  6746. * - LEGACY_RATE
  6747. * Bits 28:25
  6748. * Purpose:
  6749. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  6750. * specify which rate was used.
  6751. * Value:
  6752. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  6753. * flag.
  6754. * If LEGACY_RATE_SEL is 0:
  6755. * 0x8: OFDM 48 Mbps
  6756. * 0x9: OFDM 24 Mbps
  6757. * 0xA: OFDM 12 Mbps
  6758. * 0xB: OFDM 6 Mbps
  6759. * 0xC: OFDM 54 Mbps
  6760. * 0xD: OFDM 36 Mbps
  6761. * 0xE: OFDM 18 Mbps
  6762. * 0xF: OFDM 9 Mbps
  6763. * If LEGACY_RATE_SEL is 1:
  6764. * 0x8: CCK 11 Mbps long preamble
  6765. * 0x9: CCK 5.5 Mbps long preamble
  6766. * 0xA: CCK 2 Mbps long preamble
  6767. * 0xB: CCK 1 Mbps long preamble
  6768. * 0xC: CCK 11 Mbps short preamble
  6769. * 0xD: CCK 5.5 Mbps short preamble
  6770. * 0xE: CCK 2 Mbps short preamble
  6771. * - LEGACY_RATE_SEL
  6772. * Bit 29
  6773. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  6774. * Value:
  6775. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  6776. * used a legacy rate.
  6777. * 0 -> OFDM, 1 -> CCK
  6778. * - END_VALID
  6779. * Bit 30
  6780. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  6781. * the start of the PPDU are valid. Specifically, the following
  6782. * fields are only valid if END_VALID is set:
  6783. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  6784. * TIMESTAMP_SUBMICROSEC
  6785. * Value:
  6786. * 0 -> rx PPDU desc end fields are not valid
  6787. * 1 -> rx PPDU desc end fields are valid
  6788. * - START_VALID
  6789. * Bit 31
  6790. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  6791. * the end of the PPDU are valid. Specifically, the following
  6792. * fields are only valid if START_VALID is set:
  6793. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  6794. * VHT-SIG-A
  6795. * Value:
  6796. * 0 -> rx PPDU desc start fields are not valid
  6797. * 1 -> rx PPDU desc start fields are valid
  6798. * - RSSI0_PRI20
  6799. * Bits 7:0
  6800. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  6801. * Value: RSSI dB units w.r.t. noise floor
  6802. *
  6803. * - RSSI0_EXT20
  6804. * Bits 7:0
  6805. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  6806. * (if the rx bandwidth was >= 40 MHz)
  6807. * Value: RSSI dB units w.r.t. noise floor
  6808. * - RSSI0_EXT40
  6809. * Bits 7:0
  6810. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  6811. * (if the rx bandwidth was >= 80 MHz)
  6812. * Value: RSSI dB units w.r.t. noise floor
  6813. * - RSSI0_EXT80
  6814. * Bits 7:0
  6815. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  6816. * (if the rx bandwidth was >= 160 MHz)
  6817. * Value: RSSI dB units w.r.t. noise floor
  6818. *
  6819. * - RSSI1_PRI20
  6820. * Bits 7:0
  6821. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  6822. * Value: RSSI dB units w.r.t. noise floor
  6823. * - RSSI1_EXT20
  6824. * Bits 7:0
  6825. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  6826. * (if the rx bandwidth was >= 40 MHz)
  6827. * Value: RSSI dB units w.r.t. noise floor
  6828. * - RSSI1_EXT40
  6829. * Bits 7:0
  6830. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  6831. * (if the rx bandwidth was >= 80 MHz)
  6832. * Value: RSSI dB units w.r.t. noise floor
  6833. * - RSSI1_EXT80
  6834. * Bits 7:0
  6835. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  6836. * (if the rx bandwidth was >= 160 MHz)
  6837. * Value: RSSI dB units w.r.t. noise floor
  6838. *
  6839. * - RSSI2_PRI20
  6840. * Bits 7:0
  6841. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  6842. * Value: RSSI dB units w.r.t. noise floor
  6843. * - RSSI2_EXT20
  6844. * Bits 7:0
  6845. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  6846. * (if the rx bandwidth was >= 40 MHz)
  6847. * Value: RSSI dB units w.r.t. noise floor
  6848. * - RSSI2_EXT40
  6849. * Bits 7:0
  6850. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  6851. * (if the rx bandwidth was >= 80 MHz)
  6852. * Value: RSSI dB units w.r.t. noise floor
  6853. * - RSSI2_EXT80
  6854. * Bits 7:0
  6855. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  6856. * (if the rx bandwidth was >= 160 MHz)
  6857. * Value: RSSI dB units w.r.t. noise floor
  6858. *
  6859. * - RSSI3_PRI20
  6860. * Bits 7:0
  6861. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  6862. * Value: RSSI dB units w.r.t. noise floor
  6863. * - RSSI3_EXT20
  6864. * Bits 7:0
  6865. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  6866. * (if the rx bandwidth was >= 40 MHz)
  6867. * Value: RSSI dB units w.r.t. noise floor
  6868. * - RSSI3_EXT40
  6869. * Bits 7:0
  6870. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  6871. * (if the rx bandwidth was >= 80 MHz)
  6872. * Value: RSSI dB units w.r.t. noise floor
  6873. * - RSSI3_EXT80
  6874. * Bits 7:0
  6875. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  6876. * (if the rx bandwidth was >= 160 MHz)
  6877. * Value: RSSI dB units w.r.t. noise floor
  6878. *
  6879. * - TSF32
  6880. * Bits 31:0
  6881. * Purpose: specify the time the rx PPDU was received, in TSF units
  6882. * Value: 32 LSBs of the TSF
  6883. * - TIMESTAMP_MICROSEC
  6884. * Bits 31:0
  6885. * Purpose: specify the time the rx PPDU was received, in microsecond units
  6886. * Value: PPDU rx time, in microseconds
  6887. * - VHT_SIG_A1
  6888. * Bits 23:0
  6889. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  6890. * from the rx PPDU
  6891. * Value:
  6892. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  6893. * VHT-SIG-A1 data.
  6894. * If PREAMBLE_TYPE specifies HT, then this field contains the
  6895. * first 24 bits of the HT-SIG data.
  6896. * Otherwise, this field is invalid.
  6897. * Refer to the the 802.11 protocol for the definition of the
  6898. * HT-SIG and VHT-SIG-A1 fields
  6899. * - VHT_SIG_A2
  6900. * Bits 23:0
  6901. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  6902. * from the rx PPDU
  6903. * Value:
  6904. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  6905. * VHT-SIG-A2 data.
  6906. * If PREAMBLE_TYPE specifies HT, then this field contains the
  6907. * last 24 bits of the HT-SIG data.
  6908. * Otherwise, this field is invalid.
  6909. * Refer to the the 802.11 protocol for the definition of the
  6910. * HT-SIG and VHT-SIG-A2 fields
  6911. * - PREAMBLE_TYPE
  6912. * Bits 31:24
  6913. * Purpose: indicate the PHY format of the received burst
  6914. * Value:
  6915. * 0x4: Legacy (OFDM/CCK)
  6916. * 0x8: HT
  6917. * 0x9: HT with TxBF
  6918. * 0xC: VHT
  6919. * 0xD: VHT with TxBF
  6920. * - SERVICE
  6921. * Bits 31:24
  6922. * Purpose: TBD
  6923. * Value: TBD
  6924. *
  6925. * Rx MSDU descriptor fields:
  6926. * - FW_RX_DESC_BYTES
  6927. * Bits 15:0
  6928. * Purpose: Indicate how many bytes in the Rx indication are used for
  6929. * FW Rx descriptors
  6930. *
  6931. * Payload fields:
  6932. * - MPDU_COUNT
  6933. * Bits 7:0
  6934. * Purpose: Indicate how many sequential MPDUs share the same status.
  6935. * All MPDUs within the indicated list are from the same RA-TA-TID.
  6936. * - MPDU_STATUS
  6937. * Bits 15:8
  6938. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  6939. * received successfully.
  6940. * Value:
  6941. * 0x1: success
  6942. * 0x2: FCS error
  6943. * 0x3: duplicate error
  6944. * 0x4: replay error
  6945. * 0x5: invalid peer
  6946. */
  6947. /* header fields */
  6948. #define HTT_RX_IND_EXT_TID_M 0x1f00
  6949. #define HTT_RX_IND_EXT_TID_S 8
  6950. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  6951. #define HTT_RX_IND_FLUSH_VALID_S 13
  6952. #define HTT_RX_IND_REL_VALID_M 0x4000
  6953. #define HTT_RX_IND_REL_VALID_S 14
  6954. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  6955. #define HTT_RX_IND_PEER_ID_S 16
  6956. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  6957. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  6958. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  6959. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  6960. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  6961. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  6962. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  6963. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  6964. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  6965. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  6966. /* rx PPDU descriptor fields */
  6967. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  6968. #define HTT_RX_IND_RSSI_CMB_S 0
  6969. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  6970. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  6971. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  6972. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  6973. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  6974. #define HTT_RX_IND_PHY_ERR_S 24
  6975. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  6976. #define HTT_RX_IND_LEGACY_RATE_S 25
  6977. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  6978. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  6979. #define HTT_RX_IND_END_VALID_M 0x40000000
  6980. #define HTT_RX_IND_END_VALID_S 30
  6981. #define HTT_RX_IND_START_VALID_M 0x80000000
  6982. #define HTT_RX_IND_START_VALID_S 31
  6983. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  6984. #define HTT_RX_IND_RSSI_PRI20_S 0
  6985. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  6986. #define HTT_RX_IND_RSSI_EXT20_S 8
  6987. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  6988. #define HTT_RX_IND_RSSI_EXT40_S 16
  6989. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  6990. #define HTT_RX_IND_RSSI_EXT80_S 24
  6991. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  6992. #define HTT_RX_IND_VHT_SIG_A1_S 0
  6993. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  6994. #define HTT_RX_IND_VHT_SIG_A2_S 0
  6995. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  6996. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  6997. #define HTT_RX_IND_SERVICE_M 0xff000000
  6998. #define HTT_RX_IND_SERVICE_S 24
  6999. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  7000. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  7001. /* rx MSDU descriptor fields */
  7002. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  7003. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  7004. /* payload fields */
  7005. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  7006. #define HTT_RX_IND_MPDU_COUNT_S 0
  7007. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  7008. #define HTT_RX_IND_MPDU_STATUS_S 8
  7009. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  7010. do { \
  7011. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  7012. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  7013. } while (0)
  7014. #define HTT_RX_IND_EXT_TID_GET(word) \
  7015. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  7016. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  7017. do { \
  7018. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  7019. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  7020. } while (0)
  7021. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  7022. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  7023. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  7024. do { \
  7025. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  7026. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  7027. } while (0)
  7028. #define HTT_RX_IND_REL_VALID_GET(word) \
  7029. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  7030. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  7031. do { \
  7032. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  7033. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  7034. } while (0)
  7035. #define HTT_RX_IND_PEER_ID_GET(word) \
  7036. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  7037. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  7038. do { \
  7039. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  7040. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  7041. } while (0)
  7042. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  7043. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  7044. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  7045. do { \
  7046. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  7047. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  7048. } while (0)
  7049. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  7050. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  7051. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  7052. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  7053. do { \
  7054. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  7055. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  7056. } while (0)
  7057. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  7058. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  7059. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  7060. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  7061. do { \
  7062. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  7063. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  7064. } while (0)
  7065. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  7066. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  7067. HTT_RX_IND_REL_SEQ_NUM_START_S)
  7068. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  7069. do { \
  7070. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  7071. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  7072. } while (0)
  7073. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  7074. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  7075. HTT_RX_IND_REL_SEQ_NUM_END_S)
  7076. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  7077. do { \
  7078. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  7079. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  7080. } while (0)
  7081. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  7082. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  7083. HTT_RX_IND_NUM_MPDU_RANGES_S)
  7084. /* FW rx PPDU descriptor fields */
  7085. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  7086. do { \
  7087. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  7088. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  7089. } while (0)
  7090. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  7091. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  7092. HTT_RX_IND_RSSI_CMB_S)
  7093. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  7094. do { \
  7095. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  7096. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  7097. } while (0)
  7098. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  7099. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  7100. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  7101. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  7102. do { \
  7103. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  7104. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  7105. } while (0)
  7106. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  7107. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  7108. HTT_RX_IND_PHY_ERR_CODE_S)
  7109. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  7110. do { \
  7111. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  7112. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  7113. } while (0)
  7114. #define HTT_RX_IND_PHY_ERR_GET(word) \
  7115. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  7116. HTT_RX_IND_PHY_ERR_S)
  7117. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  7118. do { \
  7119. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  7120. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  7121. } while (0)
  7122. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  7123. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  7124. HTT_RX_IND_LEGACY_RATE_S)
  7125. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  7126. do { \
  7127. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  7128. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  7129. } while (0)
  7130. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  7131. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  7132. HTT_RX_IND_LEGACY_RATE_SEL_S)
  7133. #define HTT_RX_IND_END_VALID_SET(word, value) \
  7134. do { \
  7135. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  7136. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  7137. } while (0)
  7138. #define HTT_RX_IND_END_VALID_GET(word) \
  7139. (((word) & HTT_RX_IND_END_VALID_M) >> \
  7140. HTT_RX_IND_END_VALID_S)
  7141. #define HTT_RX_IND_START_VALID_SET(word, value) \
  7142. do { \
  7143. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  7144. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  7145. } while (0)
  7146. #define HTT_RX_IND_START_VALID_GET(word) \
  7147. (((word) & HTT_RX_IND_START_VALID_M) >> \
  7148. HTT_RX_IND_START_VALID_S)
  7149. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  7150. do { \
  7151. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  7152. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  7153. } while (0)
  7154. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  7155. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  7156. HTT_RX_IND_RSSI_PRI20_S)
  7157. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  7158. do { \
  7159. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  7160. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  7161. } while (0)
  7162. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  7163. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  7164. HTT_RX_IND_RSSI_EXT20_S)
  7165. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  7166. do { \
  7167. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  7168. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  7169. } while (0)
  7170. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  7171. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  7172. HTT_RX_IND_RSSI_EXT40_S)
  7173. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  7174. do { \
  7175. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  7176. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  7177. } while (0)
  7178. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  7179. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  7180. HTT_RX_IND_RSSI_EXT80_S)
  7181. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  7182. do { \
  7183. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  7184. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  7185. } while (0)
  7186. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  7187. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  7188. HTT_RX_IND_VHT_SIG_A1_S)
  7189. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  7190. do { \
  7191. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  7192. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  7193. } while (0)
  7194. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  7195. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  7196. HTT_RX_IND_VHT_SIG_A2_S)
  7197. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  7198. do { \
  7199. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  7200. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  7201. } while (0)
  7202. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  7203. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  7204. HTT_RX_IND_PREAMBLE_TYPE_S)
  7205. #define HTT_RX_IND_SERVICE_SET(word, value) \
  7206. do { \
  7207. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  7208. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  7209. } while (0)
  7210. #define HTT_RX_IND_SERVICE_GET(word) \
  7211. (((word) & HTT_RX_IND_SERVICE_M) >> \
  7212. HTT_RX_IND_SERVICE_S)
  7213. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  7214. do { \
  7215. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  7216. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  7217. } while (0)
  7218. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  7219. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  7220. HTT_RX_IND_SA_ANT_MATRIX_S)
  7221. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  7222. do { \
  7223. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  7224. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  7225. } while (0)
  7226. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  7227. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  7228. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  7229. do { \
  7230. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  7231. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  7232. } while (0)
  7233. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  7234. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  7235. #define HTT_RX_IND_HL_BYTES \
  7236. (HTT_RX_IND_HDR_BYTES + \
  7237. 4 /* single FW rx MSDU descriptor */ + \
  7238. 4 /* single MPDU range information element */)
  7239. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  7240. /* Could we use one macro entry? */
  7241. #define HTT_WORD_SET(word, field, value) \
  7242. do { \
  7243. HTT_CHECK_SET_VAL(field, value); \
  7244. (word) |= ((value) << field ## _S); \
  7245. } while (0)
  7246. #define HTT_WORD_GET(word, field) \
  7247. (((word) & field ## _M) >> field ## _S)
  7248. PREPACK struct hl_htt_rx_ind_base {
  7249. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  7250. } POSTPACK;
  7251. /*
  7252. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  7253. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  7254. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  7255. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  7256. * htt_rx_ind_hl_rx_desc_t.
  7257. */
  7258. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  7259. struct htt_rx_ind_hl_rx_desc_t {
  7260. A_UINT8 ver;
  7261. A_UINT8 len;
  7262. struct {
  7263. A_UINT8
  7264. first_msdu: 1,
  7265. last_msdu: 1,
  7266. c3_failed: 1,
  7267. c4_failed: 1,
  7268. ipv6: 1,
  7269. tcp: 1,
  7270. udp: 1,
  7271. reserved: 1;
  7272. } flags;
  7273. /* NOTE: no reserved space - don't append any new fields here */
  7274. };
  7275. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  7276. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  7277. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  7278. #define HTT_RX_IND_HL_RX_DESC_VER 0
  7279. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  7280. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  7281. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  7282. #define HTT_RX_IND_HL_FLAG_OFFSET \
  7283. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  7284. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  7285. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  7286. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  7287. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  7288. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  7289. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  7290. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  7291. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  7292. /* This structure is used in HL, the basic descriptor information
  7293. * used by host. the structure is translated by FW from HW desc
  7294. * or generated by FW. But in HL monitor mode, the host would use
  7295. * the same structure with LL.
  7296. */
  7297. PREPACK struct hl_htt_rx_desc_base {
  7298. A_UINT32
  7299. seq_num:12,
  7300. encrypted:1,
  7301. chan_info_present:1,
  7302. resv0:2,
  7303. mcast_bcast:1,
  7304. fragment:1,
  7305. key_id_oct:8,
  7306. resv1:6;
  7307. A_UINT32
  7308. pn_31_0;
  7309. union {
  7310. struct {
  7311. A_UINT16 pn_47_32;
  7312. A_UINT16 pn_63_48;
  7313. } pn16;
  7314. A_UINT32 pn_63_32;
  7315. } u0;
  7316. A_UINT32
  7317. pn_95_64;
  7318. A_UINT32
  7319. pn_127_96;
  7320. } POSTPACK;
  7321. /*
  7322. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  7323. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  7324. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  7325. * Please see htt_chan_change_t for description of the fields.
  7326. */
  7327. PREPACK struct htt_chan_info_t
  7328. {
  7329. A_UINT32 primary_chan_center_freq_mhz: 16,
  7330. contig_chan1_center_freq_mhz: 16;
  7331. A_UINT32 contig_chan2_center_freq_mhz: 16,
  7332. phy_mode: 8,
  7333. reserved: 8;
  7334. } POSTPACK;
  7335. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  7336. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  7337. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  7338. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  7339. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  7340. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  7341. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  7342. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  7343. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  7344. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  7345. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  7346. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  7347. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  7348. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  7349. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  7350. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  7351. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  7352. /* Channel information */
  7353. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  7354. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  7355. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  7356. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  7357. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  7358. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  7359. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  7360. #define HTT_CHAN_INFO_PHY_MODE_S 16
  7361. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  7362. do { \
  7363. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  7364. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  7365. } while (0)
  7366. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  7367. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  7368. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  7369. do { \
  7370. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  7371. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  7372. } while (0)
  7373. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  7374. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  7375. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  7376. do { \
  7377. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  7378. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  7379. } while (0)
  7380. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  7381. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  7382. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  7383. do { \
  7384. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  7385. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  7386. } while (0)
  7387. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  7388. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  7389. /*
  7390. * HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  7391. * @brief target -> host message definition for FW offloaded pkts
  7392. *
  7393. * @details
  7394. * The following field definitions describe the format of the firmware
  7395. * offload deliver message sent from the target to the host.
  7396. *
  7397. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  7398. *
  7399. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  7400. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  7401. * | reserved_1 | msg type |
  7402. * |--------------------------------------------------------------------------|
  7403. * | phy_timestamp_l32 |
  7404. * |--------------------------------------------------------------------------|
  7405. * | WORD2 (see below) |
  7406. * |--------------------------------------------------------------------------|
  7407. * | seqno | framectrl |
  7408. * |--------------------------------------------------------------------------|
  7409. * | reserved_3 | vdev_id | tid_num|
  7410. * |--------------------------------------------------------------------------|
  7411. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  7412. * |--------------------------------------------------------------------------|
  7413. *
  7414. * where:
  7415. * STAT = status
  7416. * F = format (802.3 vs. 802.11)
  7417. *
  7418. * definition for word 2
  7419. *
  7420. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  7421. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  7422. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  7423. * |--------------------------------------------------------------------------|
  7424. *
  7425. * where:
  7426. * PR = preamble
  7427. * BF = beamformed
  7428. */
  7429. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  7430. {
  7431. A_UINT32 /* word 0 */
  7432. msg_type:8, /* [ 7: 0] */
  7433. reserved_1:24; /* [31: 8] */
  7434. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  7435. A_UINT32 /* word 2 */
  7436. /* preamble:
  7437. * 0-OFDM,
  7438. * 1-CCk,
  7439. * 2-HT,
  7440. * 3-VHT
  7441. */
  7442. preamble: 2, /* [1:0] */
  7443. /* mcs:
  7444. * In case of HT preamble interpret
  7445. * MCS along with NSS.
  7446. * Valid values for HT are 0 to 7.
  7447. * HT mcs 0 with NSS 2 is mcs 8.
  7448. * Valid values for VHT are 0 to 9.
  7449. */
  7450. mcs: 4, /* [5:2] */
  7451. /* rate:
  7452. * This is applicable only for
  7453. * CCK and OFDM preamble type
  7454. * rate 0: OFDM 48 Mbps,
  7455. * 1: OFDM 24 Mbps,
  7456. * 2: OFDM 12 Mbps
  7457. * 3: OFDM 6 Mbps
  7458. * 4: OFDM 54 Mbps
  7459. * 5: OFDM 36 Mbps
  7460. * 6: OFDM 18 Mbps
  7461. * 7: OFDM 9 Mbps
  7462. * rate 0: CCK 11 Mbps Long
  7463. * 1: CCK 5.5 Mbps Long
  7464. * 2: CCK 2 Mbps Long
  7465. * 3: CCK 1 Mbps Long
  7466. * 4: CCK 11 Mbps Short
  7467. * 5: CCK 5.5 Mbps Short
  7468. * 6: CCK 2 Mbps Short
  7469. */
  7470. rate : 3, /* [ 8: 6] */
  7471. rssi : 8, /* [16: 9] units=dBm */
  7472. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  7473. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  7474. stbc : 1, /* [22] */
  7475. sgi : 1, /* [23] */
  7476. ldpc : 1, /* [24] */
  7477. beamformed: 1, /* [25] */
  7478. reserved_2: 6; /* [31:26] */
  7479. A_UINT32 /* word 3 */
  7480. framectrl:16, /* [15: 0] */
  7481. seqno:16; /* [31:16] */
  7482. A_UINT32 /* word 4 */
  7483. tid_num:5, /* [ 4: 0] actual TID number */
  7484. vdev_id:8, /* [12: 5] */
  7485. reserved_3:19; /* [31:13] */
  7486. A_UINT32 /* word 5 */
  7487. /* status:
  7488. * 0: tx_ok
  7489. * 1: retry
  7490. * 2: drop
  7491. * 3: filtered
  7492. * 4: abort
  7493. * 5: tid delete
  7494. * 6: sw abort
  7495. * 7: dropped by peer migration
  7496. */
  7497. status:3, /* [2:0] */
  7498. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  7499. tx_mpdu_bytes:16, /* [19:4] */
  7500. /* Indicates retry count of offloaded/local generated Data tx frames */
  7501. tx_retry_cnt:6, /* [25:20] */
  7502. reserved_4:6; /* [31:26] */
  7503. } POSTPACK;
  7504. /* FW offload deliver ind message header fields */
  7505. /* DWORD one */
  7506. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  7507. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  7508. /* DWORD two */
  7509. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  7510. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  7511. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  7512. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  7513. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  7514. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  7515. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  7516. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  7517. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  7518. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  7519. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  7520. #define HTT_FW_OFFLOAD_IND_BW_S 19
  7521. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  7522. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  7523. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  7524. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  7525. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  7526. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  7527. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  7528. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  7529. /* DWORD three*/
  7530. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  7531. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  7532. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  7533. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  7534. /* DWORD four */
  7535. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  7536. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  7537. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  7538. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  7539. /* DWORD five */
  7540. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  7541. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  7542. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  7543. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  7544. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  7545. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  7546. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  7547. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  7548. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  7549. do { \
  7550. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  7551. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  7552. } while (0)
  7553. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  7554. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  7555. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  7556. do { \
  7557. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  7558. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  7559. } while (0)
  7560. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  7561. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  7562. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  7563. do { \
  7564. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  7565. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  7566. } while (0)
  7567. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  7568. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  7569. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  7570. do { \
  7571. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  7572. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  7573. } while (0)
  7574. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  7575. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  7576. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  7577. do { \
  7578. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  7579. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  7580. } while (0)
  7581. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  7582. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  7583. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  7584. do { \
  7585. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  7586. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  7587. } while (0)
  7588. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  7589. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  7590. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  7591. do { \
  7592. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  7593. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  7594. } while (0)
  7595. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  7596. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  7597. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  7598. do { \
  7599. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  7600. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  7601. } while (0)
  7602. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  7603. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  7604. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  7605. do { \
  7606. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  7607. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  7608. } while (0)
  7609. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  7610. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  7611. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  7612. do { \
  7613. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  7614. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  7615. } while (0)
  7616. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  7617. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  7618. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  7619. do { \
  7620. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  7621. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  7622. } while (0)
  7623. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  7624. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  7625. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  7626. do { \
  7627. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  7628. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  7629. } while (0)
  7630. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  7631. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  7632. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  7633. do { \
  7634. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  7635. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  7636. } while (0)
  7637. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  7638. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  7639. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  7640. do { \
  7641. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  7642. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  7643. } while (0)
  7644. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  7645. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  7646. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  7647. do { \
  7648. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  7649. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  7650. } while (0)
  7651. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  7652. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  7653. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  7654. do { \
  7655. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  7656. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  7657. } while (0)
  7658. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  7659. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  7660. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  7661. do { \
  7662. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  7663. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  7664. } while (0)
  7665. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  7666. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  7667. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  7668. do { \
  7669. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  7670. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  7671. } while (0)
  7672. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  7673. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  7674. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  7675. do { \
  7676. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  7677. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  7678. } while (0)
  7679. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  7680. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  7681. /*
  7682. * @brief target -> host rx reorder flush message definition
  7683. *
  7684. * @details
  7685. * The following field definitions describe the format of the rx flush
  7686. * message sent from the target to the host.
  7687. * The message consists of a 4-octet header, followed by one or more
  7688. * 4-octet payload information elements.
  7689. *
  7690. * |31 24|23 8|7 0|
  7691. * |--------------------------------------------------------------|
  7692. * | TID | peer ID | msg type |
  7693. * |--------------------------------------------------------------|
  7694. * | seq num end | seq num start | MPDU status | reserved |
  7695. * |--------------------------------------------------------------|
  7696. * First DWORD:
  7697. * - MSG_TYPE
  7698. * Bits 7:0
  7699. * Purpose: identifies this as an rx flush message
  7700. * Value: 0x2
  7701. * - PEER_ID
  7702. * Bits 23:8 (only bits 18:8 actually used)
  7703. * Purpose: identify which peer's rx data is being flushed
  7704. * Value: (rx) peer ID
  7705. * - TID
  7706. * Bits 31:24 (only bits 27:24 actually used)
  7707. * Purpose: Specifies which traffic identifier's rx data is being flushed
  7708. * Value: traffic identifier
  7709. * Second DWORD:
  7710. * - MPDU_STATUS
  7711. * Bits 15:8
  7712. * Purpose:
  7713. * Indicate whether the flushed MPDUs should be discarded or processed.
  7714. * Value:
  7715. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  7716. * stages of rx processing
  7717. * other: discard the MPDUs
  7718. * It is anticipated that flush messages will always have
  7719. * MPDU status == 1, but the status flag is included for
  7720. * flexibility.
  7721. * - SEQ_NUM_START
  7722. * Bits 23:16
  7723. * Purpose:
  7724. * Indicate the start of a series of consecutive MPDUs being flushed.
  7725. * Not all MPDUs within this range are necessarily valid - the host
  7726. * must check each sequence number within this range to see if the
  7727. * corresponding MPDU is actually present.
  7728. * Value:
  7729. * The sequence number for the first MPDU in the sequence.
  7730. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  7731. * - SEQ_NUM_END
  7732. * Bits 30:24
  7733. * Purpose:
  7734. * Indicate the end of a series of consecutive MPDUs being flushed.
  7735. * Value:
  7736. * The sequence number one larger than the sequence number of the
  7737. * last MPDU being flushed.
  7738. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  7739. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  7740. * are to be released for further rx processing.
  7741. * Not all MPDUs within this range are necessarily valid - the host
  7742. * must check each sequence number within this range to see if the
  7743. * corresponding MPDU is actually present.
  7744. */
  7745. /* first DWORD */
  7746. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  7747. #define HTT_RX_FLUSH_PEER_ID_S 8
  7748. #define HTT_RX_FLUSH_TID_M 0xff000000
  7749. #define HTT_RX_FLUSH_TID_S 24
  7750. /* second DWORD */
  7751. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  7752. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  7753. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  7754. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  7755. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  7756. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  7757. #define HTT_RX_FLUSH_BYTES 8
  7758. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  7759. do { \
  7760. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  7761. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  7762. } while (0)
  7763. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  7764. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  7765. #define HTT_RX_FLUSH_TID_SET(word, value) \
  7766. do { \
  7767. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  7768. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  7769. } while (0)
  7770. #define HTT_RX_FLUSH_TID_GET(word) \
  7771. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  7772. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  7773. do { \
  7774. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  7775. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  7776. } while (0)
  7777. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  7778. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  7779. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  7780. do { \
  7781. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  7782. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  7783. } while (0)
  7784. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  7785. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  7786. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  7787. do { \
  7788. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  7789. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  7790. } while (0)
  7791. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  7792. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  7793. /*
  7794. * @brief target -> host rx pn check indication message
  7795. *
  7796. * @details
  7797. * The following field definitions describe the format of the Rx PN check
  7798. * indication message sent from the target to the host.
  7799. * The message consists of a 4-octet header, followed by the start and
  7800. * end sequence numbers to be released, followed by the PN IEs. Each PN
  7801. * IE is one octet containing the sequence number that failed the PN
  7802. * check.
  7803. *
  7804. * |31 24|23 8|7 0|
  7805. * |--------------------------------------------------------------|
  7806. * | TID | peer ID | msg type |
  7807. * |--------------------------------------------------------------|
  7808. * | Reserved | PN IE count | seq num end | seq num start|
  7809. * |--------------------------------------------------------------|
  7810. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  7811. * |--------------------------------------------------------------|
  7812. * First DWORD:
  7813. * - MSG_TYPE
  7814. * Bits 7:0
  7815. * Purpose: Identifies this as an rx pn check indication message
  7816. * Value: 0x2
  7817. * - PEER_ID
  7818. * Bits 23:8 (only bits 18:8 actually used)
  7819. * Purpose: identify which peer
  7820. * Value: (rx) peer ID
  7821. * - TID
  7822. * Bits 31:24 (only bits 27:24 actually used)
  7823. * Purpose: identify traffic identifier
  7824. * Value: traffic identifier
  7825. * Second DWORD:
  7826. * - SEQ_NUM_START
  7827. * Bits 7:0
  7828. * Purpose:
  7829. * Indicates the starting sequence number of the MPDU in this
  7830. * series of MPDUs that went though PN check.
  7831. * Value:
  7832. * The sequence number for the first MPDU in the sequence.
  7833. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  7834. * - SEQ_NUM_END
  7835. * Bits 15:8
  7836. * Purpose:
  7837. * Indicates the ending sequence number of the MPDU in this
  7838. * series of MPDUs that went though PN check.
  7839. * Value:
  7840. * The sequence number one larger then the sequence number of the last
  7841. * MPDU being flushed.
  7842. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  7843. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  7844. * for invalid PN numbers and are ready to be released for further processing.
  7845. * Not all MPDUs within this range are necessarily valid - the host
  7846. * must check each sequence number within this range to see if the
  7847. * corresponding MPDU is actually present.
  7848. * - PN_IE_COUNT
  7849. * Bits 23:16
  7850. * Purpose:
  7851. * Used to determine the variable number of PN information elements in this
  7852. * message
  7853. *
  7854. * PN information elements:
  7855. * - PN_IE_x-
  7856. * Purpose:
  7857. * Each PN information element contains the sequence number of the MPDU that
  7858. * has failed the target PN check.
  7859. * Value:
  7860. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  7861. * that failed the PN check.
  7862. */
  7863. /* first DWORD */
  7864. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  7865. #define HTT_RX_PN_IND_PEER_ID_S 8
  7866. #define HTT_RX_PN_IND_TID_M 0xff000000
  7867. #define HTT_RX_PN_IND_TID_S 24
  7868. /* second DWORD */
  7869. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  7870. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  7871. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  7872. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  7873. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  7874. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  7875. #define HTT_RX_PN_IND_BYTES 8
  7876. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  7877. do { \
  7878. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  7879. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  7880. } while (0)
  7881. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  7882. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  7883. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  7884. do { \
  7885. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  7886. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  7887. } while (0)
  7888. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  7889. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  7890. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  7891. do { \
  7892. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  7893. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  7894. } while (0)
  7895. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  7896. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  7897. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  7898. do { \
  7899. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  7900. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  7901. } while (0)
  7902. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  7903. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  7904. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  7905. do { \
  7906. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  7907. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  7908. } while (0)
  7909. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  7910. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  7911. /*
  7912. * @brief target -> host rx offload deliver message for LL system
  7913. *
  7914. * @details
  7915. * In a low latency system this message is sent whenever the offload
  7916. * manager flushes out the packets it has coalesced in its coalescing buffer.
  7917. * The DMA of the actual packets into host memory is done before sending out
  7918. * this message. This message indicates only how many MSDUs to reap. The
  7919. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  7920. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  7921. * DMA'd by the MAC directly into host memory these packets do not contain
  7922. * the MAC descriptors in the header portion of the packet. Instead they contain
  7923. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  7924. * message, the packets are delivered directly to the NW stack without going
  7925. * through the regular reorder buffering and PN checking path since it has
  7926. * already been done in target.
  7927. *
  7928. * |31 24|23 16|15 8|7 0|
  7929. * |-----------------------------------------------------------------------|
  7930. * | Total MSDU count | reserved | msg type |
  7931. * |-----------------------------------------------------------------------|
  7932. *
  7933. * @brief target -> host rx offload deliver message for HL system
  7934. *
  7935. * @details
  7936. * In a high latency system this message is sent whenever the offload manager
  7937. * flushes out the packets it has coalesced in its coalescing buffer. The
  7938. * actual packets are also carried along with this message. When the host
  7939. * receives this message, it is expected to deliver these packets to the NW
  7940. * stack directly instead of routing them through the reorder buffering and
  7941. * PN checking path since it has already been done in target.
  7942. *
  7943. * |31 24|23 16|15 8|7 0|
  7944. * |-----------------------------------------------------------------------|
  7945. * | Total MSDU count | reserved | msg type |
  7946. * |-----------------------------------------------------------------------|
  7947. * | peer ID | MSDU length |
  7948. * |-----------------------------------------------------------------------|
  7949. * | MSDU payload | FW Desc | tid | vdev ID |
  7950. * |-----------------------------------------------------------------------|
  7951. * | MSDU payload contd. |
  7952. * |-----------------------------------------------------------------------|
  7953. * | peer ID | MSDU length |
  7954. * |-----------------------------------------------------------------------|
  7955. * | MSDU payload | FW Desc | tid | vdev ID |
  7956. * |-----------------------------------------------------------------------|
  7957. * | MSDU payload contd. |
  7958. * |-----------------------------------------------------------------------|
  7959. *
  7960. */
  7961. /* first DWORD */
  7962. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  7963. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  7964. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  7965. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  7966. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  7967. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  7968. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  7969. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  7970. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  7971. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  7972. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  7973. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  7974. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  7975. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  7976. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  7977. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  7978. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  7979. do { \
  7980. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  7981. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  7982. } while (0)
  7983. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  7984. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  7985. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  7986. do { \
  7987. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  7988. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  7989. } while (0)
  7990. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  7991. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  7992. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  7993. do { \
  7994. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  7995. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  7996. } while (0)
  7997. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  7998. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  7999. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  8000. do { \
  8001. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  8002. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  8003. } while (0)
  8004. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  8005. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  8006. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  8007. do { \
  8008. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  8009. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  8010. } while (0)
  8011. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  8012. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  8013. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  8014. do { \
  8015. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  8016. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  8017. } while (0)
  8018. /**
  8019. * @brief target -> host rx peer map/unmap message definition
  8020. *
  8021. * @details
  8022. * The following diagram shows the format of the rx peer map message sent
  8023. * from the target to the host. This layout assumes the target operates
  8024. * as little-endian.
  8025. *
  8026. * This message always contains a SW peer ID. The main purpose of the
  8027. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  8028. * with, so that the host can use that peer ID to determine which peer
  8029. * transmitted the rx frame. This SW peer ID is sometimes also used for
  8030. * other purposes, such as identifying during tx completions which peer
  8031. * the tx frames in question were transmitted to.
  8032. *
  8033. * In certain generations of chips, the peer map message also contains
  8034. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  8035. * to identify which peer the frame needs to be forwarded to (i.e. the
  8036. * peer assocated with the Destination MAC Address within the packet),
  8037. * and particularly which vdev needs to transmit the frame (for cases
  8038. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  8039. * meaning as AST_INDEX_0.
  8040. * This DA-based peer ID that is provided for certain rx frames
  8041. * (the rx frames that need to be re-transmitted as tx frames)
  8042. * is the ID that the HW uses for referring to the peer in question,
  8043. * rather than the peer ID that the SW+FW use to refer to the peer.
  8044. *
  8045. *
  8046. * |31 24|23 16|15 8|7 0|
  8047. * |-----------------------------------------------------------------------|
  8048. * | SW peer ID | VDEV ID | msg type |
  8049. * |-----------------------------------------------------------------------|
  8050. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  8051. * |-----------------------------------------------------------------------|
  8052. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  8053. * |-----------------------------------------------------------------------|
  8054. *
  8055. *
  8056. * The following diagram shows the format of the rx peer unmap message sent
  8057. * from the target to the host.
  8058. *
  8059. * |31 24|23 16|15 8|7 0|
  8060. * |-----------------------------------------------------------------------|
  8061. * | SW peer ID | VDEV ID | msg type |
  8062. * |-----------------------------------------------------------------------|
  8063. *
  8064. * The following field definitions describe the format of the rx peer map
  8065. * and peer unmap messages sent from the target to the host.
  8066. * - MSG_TYPE
  8067. * Bits 7:0
  8068. * Purpose: identifies this as an rx peer map or peer unmap message
  8069. * Value: peer map -> 0x3, peer unmap -> 0x4
  8070. * - VDEV_ID
  8071. * Bits 15:8
  8072. * Purpose: Indicates which virtual device the peer is associated
  8073. * with.
  8074. * Value: vdev ID (used in the host to look up the vdev object)
  8075. * - PEER_ID (a.k.a. SW_PEER_ID)
  8076. * Bits 31:16
  8077. * Purpose: The peer ID (index) that WAL is allocating (map) or
  8078. * freeing (unmap)
  8079. * Value: (rx) peer ID
  8080. * - MAC_ADDR_L32 (peer map only)
  8081. * Bits 31:0
  8082. * Purpose: Identifies which peer node the peer ID is for.
  8083. * Value: lower 4 bytes of peer node's MAC address
  8084. * - MAC_ADDR_U16 (peer map only)
  8085. * Bits 15:0
  8086. * Purpose: Identifies which peer node the peer ID is for.
  8087. * Value: upper 2 bytes of peer node's MAC address
  8088. * - HW_PEER_ID
  8089. * Bits 31:16
  8090. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  8091. * address, so for rx frames marked for rx --> tx forwarding, the
  8092. * host can determine from the HW peer ID provided as meta-data with
  8093. * the rx frame which peer the frame is supposed to be forwarded to.
  8094. * Value: ID used by the MAC HW to identify the peer
  8095. */
  8096. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  8097. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  8098. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  8099. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  8100. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  8101. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  8102. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  8103. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  8104. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  8105. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  8106. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  8107. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  8108. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  8109. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  8110. do { \
  8111. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  8112. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  8113. } while (0)
  8114. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  8115. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  8116. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  8117. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  8118. do { \
  8119. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  8120. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  8121. } while (0)
  8122. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  8123. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  8124. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  8125. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  8126. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  8127. do { \
  8128. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  8129. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  8130. } while (0)
  8131. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  8132. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  8133. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  8134. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  8135. #define HTT_RX_PEER_MAP_BYTES 12
  8136. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  8137. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  8138. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  8139. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  8140. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  8141. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  8142. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  8143. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  8144. #define HTT_RX_PEER_UNMAP_BYTES 4
  8145. /**
  8146. * @brief target -> host rx peer map V2 message definition
  8147. *
  8148. * @details
  8149. * The following diagram shows the format of the rx peer map v2 message sent
  8150. * from the target to the host. This layout assumes the target operates
  8151. * as little-endian.
  8152. *
  8153. * This message always contains a SW peer ID. The main purpose of the
  8154. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  8155. * with, so that the host can use that peer ID to determine which peer
  8156. * transmitted the rx frame. This SW peer ID is sometimes also used for
  8157. * other purposes, such as identifying during tx completions which peer
  8158. * the tx frames in question were transmitted to.
  8159. *
  8160. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  8161. * is used during rx --> tx frame forwarding to identify which peer the
  8162. * frame needs to be forwarded to (i.e. the peer assocated with the
  8163. * Destination MAC Address within the packet), and particularly which vdev
  8164. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  8165. * This DA-based peer ID that is provided for certain rx frames
  8166. * (the rx frames that need to be re-transmitted as tx frames)
  8167. * is the ID that the HW uses for referring to the peer in question,
  8168. * rather than the peer ID that the SW+FW use to refer to the peer.
  8169. *
  8170. * The HW peer id here is the same meaning as AST_INDEX_0.
  8171. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  8172. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  8173. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  8174. * AST is valid.
  8175. *
  8176. * |31 28|27 24|23 20|19 17|16|15 8|7 0|
  8177. * |-----------------------------------------------------------------------|
  8178. * | SW peer ID | VDEV ID | msg type |
  8179. * |-----------------------------------------------------------------------|
  8180. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  8181. * |-----------------------------------------------------------------------|
  8182. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  8183. * |-----------------------------------------------------------------------|
  8184. * | Reserved_20_31 |ASTVM|NH| AST Hash Value |
  8185. * |-----------------------------------------------------------------------|
  8186. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  8187. * |-----------------------------------------------------------------------|
  8188. * |TID valid low pri| TID valid hi pri| AST index 2 |
  8189. * |-----------------------------------------------------------------------|
  8190. * | Reserved_1 | AST index 3 |
  8191. * |-----------------------------------------------------------------------|
  8192. * | Reserved_2 |
  8193. * |-----------------------------------------------------------------------|
  8194. * Where:
  8195. * NH = Next Hop
  8196. * ASTVM = AST valid mask
  8197. * ASTFM = AST flow mask
  8198. *
  8199. * The following field definitions describe the format of the rx peer map v2
  8200. * messages sent from the target to the host.
  8201. * - MSG_TYPE
  8202. * Bits 7:0
  8203. * Purpose: identifies this as an rx peer map v2 message
  8204. * Value: peer map v2 -> 0x1e
  8205. * - VDEV_ID
  8206. * Bits 15:8
  8207. * Purpose: Indicates which virtual device the peer is associated with.
  8208. * Value: vdev ID (used in the host to look up the vdev object)
  8209. * - SW_PEER_ID
  8210. * Bits 31:16
  8211. * Purpose: The peer ID (index) that WAL is allocating
  8212. * Value: (rx) peer ID
  8213. * - MAC_ADDR_L32
  8214. * Bits 31:0
  8215. * Purpose: Identifies which peer node the peer ID is for.
  8216. * Value: lower 4 bytes of peer node's MAC address
  8217. * - MAC_ADDR_U16
  8218. * Bits 15:0
  8219. * Purpose: Identifies which peer node the peer ID is for.
  8220. * Value: upper 2 bytes of peer node's MAC address
  8221. * - HW_PEER_ID / AST_INDEX_0
  8222. * Bits 31:16
  8223. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  8224. * address, so for rx frames marked for rx --> tx forwarding, the
  8225. * host can determine from the HW peer ID provided as meta-data with
  8226. * the rx frame which peer the frame is supposed to be forwarded to.
  8227. * Value: ID used by the MAC HW to identify the peer
  8228. * - AST_HASH_VALUE
  8229. * Bits 15:0
  8230. * Purpose: Indicates AST Hash value is required for the TCL AST index
  8231. * override feature.
  8232. * - NEXT_HOP
  8233. * Bit 16
  8234. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  8235. * (Wireless Distribution System).
  8236. * - AST_VALID_MASK
  8237. * Bits 19:17
  8238. * Purpose: Indicate if the AST 1 through AST 3 are valid
  8239. * - AST_INDEX_1
  8240. * Bits 15:0
  8241. * Purpose: indicate the second AST index for this peer
  8242. * - AST_0_FLOW_MASK
  8243. * Bits 19:16
  8244. * Purpose: identify the which flow the AST 0 entry corresponds to.
  8245. * - AST_1_FLOW_MASK
  8246. * Bits 23:20
  8247. * Purpose: identify the which flow the AST 1 entry corresponds to.
  8248. * - AST_2_FLOW_MASK
  8249. * Bits 27:24
  8250. * Purpose: identify the which flow the AST 2 entry corresponds to.
  8251. * - AST_3_FLOW_MASK
  8252. * Bits 31:28
  8253. * Purpose: identify the which flow the AST 3 entry corresponds to.
  8254. * - AST_INDEX_2
  8255. * Bits 15:0
  8256. * Purpose: indicate the third AST index for this peer
  8257. * - TID_VALID_HI_PRI
  8258. * Bits 23:16
  8259. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  8260. * - TID_VALID_LOW_PRI
  8261. * Bits 31:24
  8262. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  8263. * - AST_INDEX_3
  8264. * Bits 15:0
  8265. * Purpose: indicate the fourth AST index for this peer
  8266. */
  8267. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  8268. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  8269. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  8270. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  8271. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  8272. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  8273. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  8274. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  8275. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  8276. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  8277. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  8278. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  8279. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  8280. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  8281. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  8282. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  8283. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  8284. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  8285. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  8286. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  8287. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  8288. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  8289. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  8290. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  8291. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  8292. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  8293. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  8294. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  8295. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  8296. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  8297. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  8298. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  8299. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  8300. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  8301. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  8302. do { \
  8303. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  8304. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  8305. } while (0)
  8306. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  8307. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  8308. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  8309. do { \
  8310. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  8311. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  8312. } while (0)
  8313. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  8314. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  8315. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  8316. do { \
  8317. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  8318. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  8319. } while (0)
  8320. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  8321. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  8322. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  8323. do { \
  8324. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  8325. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  8326. } while (0)
  8327. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  8328. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  8329. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  8330. do { \
  8331. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  8332. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  8333. } while (0)
  8334. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  8335. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  8336. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  8337. do { \
  8338. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  8339. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  8340. } while (0)
  8341. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  8342. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  8343. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  8344. do { \
  8345. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  8346. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  8347. } while (0)
  8348. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  8349. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  8350. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  8351. do { \
  8352. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  8353. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  8354. } while (0)
  8355. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  8356. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  8357. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  8358. do { \
  8359. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  8360. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  8361. } while (0)
  8362. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  8363. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  8364. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  8365. do { \
  8366. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  8367. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  8368. } while (0)
  8369. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  8370. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  8371. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  8372. do { \
  8373. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  8374. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  8375. } while (0)
  8376. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  8377. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  8378. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  8379. do { \
  8380. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  8381. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  8382. } while (0)
  8383. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  8384. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  8385. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  8386. do { \
  8387. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  8388. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  8389. } while (0)
  8390. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  8391. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  8392. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  8393. do { \
  8394. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  8395. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  8396. } while (0)
  8397. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  8398. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  8399. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  8400. do { \
  8401. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  8402. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  8403. } while (0)
  8404. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  8405. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  8406. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  8407. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  8408. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  8409. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  8410. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  8411. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  8412. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  8413. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  8414. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  8415. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  8416. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  8417. #define HTT_RX_PEER_MAP_V2_BYTES 32
  8418. /**
  8419. * @brief target -> host rx peer unmap V2 message definition
  8420. *
  8421. *
  8422. * The following diagram shows the format of the rx peer unmap message sent
  8423. * from the target to the host.
  8424. *
  8425. * |31 24|23 16|15 8|7 0|
  8426. * |-----------------------------------------------------------------------|
  8427. * | SW peer ID | VDEV ID | msg type |
  8428. * |-----------------------------------------------------------------------|
  8429. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  8430. * |-----------------------------------------------------------------------|
  8431. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  8432. * |-----------------------------------------------------------------------|
  8433. * | Peer Delete Duration |
  8434. * |-----------------------------------------------------------------------|
  8435. * | Reserved_0 |
  8436. * |-----------------------------------------------------------------------|
  8437. * | Reserved_1 |
  8438. * |-----------------------------------------------------------------------|
  8439. * | Reserved_2 |
  8440. * |-----------------------------------------------------------------------|
  8441. *
  8442. *
  8443. * The following field definitions describe the format of the rx peer unmap
  8444. * messages sent from the target to the host.
  8445. * - MSG_TYPE
  8446. * Bits 7:0
  8447. * Purpose: identifies this as an rx peer unmap v2 message
  8448. * Value: peer unmap v2 -> 0x1f
  8449. * - VDEV_ID
  8450. * Bits 15:8
  8451. * Purpose: Indicates which virtual device the peer is associated
  8452. * with.
  8453. * Value: vdev ID (used in the host to look up the vdev object)
  8454. * - SW_PEER_ID
  8455. * Bits 31:16
  8456. * Purpose: The peer ID (index) that WAL is freeing
  8457. * Value: (rx) peer ID
  8458. * - MAC_ADDR_L32
  8459. * Bits 31:0
  8460. * Purpose: Identifies which peer node the peer ID is for.
  8461. * Value: lower 4 bytes of peer node's MAC address
  8462. * - MAC_ADDR_U16
  8463. * Bits 15:0
  8464. * Purpose: Identifies which peer node the peer ID is for.
  8465. * Value: upper 2 bytes of peer node's MAC address
  8466. * - NEXT_HOP
  8467. * Bits 16
  8468. * Purpose: Bit indicates next_hop AST entry used for WDS
  8469. * (Wireless Distribution System).
  8470. * - PEER_DELETE_DURATION
  8471. * Bits 31:0
  8472. * Purpose: Time taken to delete peer, in msec,
  8473. * Used for monitoring / debugging PEER delete response delay
  8474. */
  8475. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  8476. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  8477. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  8478. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  8479. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  8480. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  8481. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  8482. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  8483. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  8484. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  8485. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  8486. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  8487. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  8488. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  8489. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  8490. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  8491. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  8492. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  8493. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  8494. do { \
  8495. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  8496. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  8497. } while (0)
  8498. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  8499. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  8500. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  8501. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  8502. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  8503. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  8504. /**
  8505. * @brief target -> host message specifying security parameters
  8506. *
  8507. * @details
  8508. * The following diagram shows the format of the security specification
  8509. * message sent from the target to the host.
  8510. * This security specification message tells the host whether a PN check is
  8511. * necessary on rx data frames, and if so, how large the PN counter is.
  8512. * This message also tells the host about the security processing to apply
  8513. * to defragmented rx frames - specifically, whether a Message Integrity
  8514. * Check is required, and the Michael key to use.
  8515. *
  8516. * |31 24|23 16|15|14 8|7 0|
  8517. * |-----------------------------------------------------------------------|
  8518. * | peer ID | U| security type | msg type |
  8519. * |-----------------------------------------------------------------------|
  8520. * | Michael Key K0 |
  8521. * |-----------------------------------------------------------------------|
  8522. * | Michael Key K1 |
  8523. * |-----------------------------------------------------------------------|
  8524. * | WAPI RSC Low0 |
  8525. * |-----------------------------------------------------------------------|
  8526. * | WAPI RSC Low1 |
  8527. * |-----------------------------------------------------------------------|
  8528. * | WAPI RSC Hi0 |
  8529. * |-----------------------------------------------------------------------|
  8530. * | WAPI RSC Hi1 |
  8531. * |-----------------------------------------------------------------------|
  8532. *
  8533. * The following field definitions describe the format of the security
  8534. * indication message sent from the target to the host.
  8535. * - MSG_TYPE
  8536. * Bits 7:0
  8537. * Purpose: identifies this as a security specification message
  8538. * Value: 0xb
  8539. * - SEC_TYPE
  8540. * Bits 14:8
  8541. * Purpose: specifies which type of security applies to the peer
  8542. * Value: htt_sec_type enum value
  8543. * - UNICAST
  8544. * Bit 15
  8545. * Purpose: whether this security is applied to unicast or multicast data
  8546. * Value: 1 -> unicast, 0 -> multicast
  8547. * - PEER_ID
  8548. * Bits 31:16
  8549. * Purpose: The ID number for the peer the security specification is for
  8550. * Value: peer ID
  8551. * - MICHAEL_KEY_K0
  8552. * Bits 31:0
  8553. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  8554. * Value: Michael Key K0 (if security type is TKIP)
  8555. * - MICHAEL_KEY_K1
  8556. * Bits 31:0
  8557. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  8558. * Value: Michael Key K1 (if security type is TKIP)
  8559. * - WAPI_RSC_LOW0
  8560. * Bits 31:0
  8561. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  8562. * Value: WAPI RSC Low0 (if security type is WAPI)
  8563. * - WAPI_RSC_LOW1
  8564. * Bits 31:0
  8565. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  8566. * Value: WAPI RSC Low1 (if security type is WAPI)
  8567. * - WAPI_RSC_HI0
  8568. * Bits 31:0
  8569. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  8570. * Value: WAPI RSC Hi0 (if security type is WAPI)
  8571. * - WAPI_RSC_HI1
  8572. * Bits 31:0
  8573. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  8574. * Value: WAPI RSC Hi1 (if security type is WAPI)
  8575. */
  8576. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  8577. #define HTT_SEC_IND_SEC_TYPE_S 8
  8578. #define HTT_SEC_IND_UNICAST_M 0x00008000
  8579. #define HTT_SEC_IND_UNICAST_S 15
  8580. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  8581. #define HTT_SEC_IND_PEER_ID_S 16
  8582. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  8583. do { \
  8584. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  8585. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  8586. } while (0)
  8587. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  8588. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  8589. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  8590. do { \
  8591. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  8592. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  8593. } while (0)
  8594. #define HTT_SEC_IND_UNICAST_GET(word) \
  8595. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  8596. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  8597. do { \
  8598. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  8599. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  8600. } while (0)
  8601. #define HTT_SEC_IND_PEER_ID_GET(word) \
  8602. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  8603. #define HTT_SEC_IND_BYTES 28
  8604. /**
  8605. * @brief target -> host rx ADDBA / DELBA message definitions
  8606. *
  8607. * @details
  8608. * The following diagram shows the format of the rx ADDBA message sent
  8609. * from the target to the host:
  8610. *
  8611. * |31 20|19 16|15 8|7 0|
  8612. * |---------------------------------------------------------------------|
  8613. * | peer ID | TID | window size | msg type |
  8614. * |---------------------------------------------------------------------|
  8615. *
  8616. * The following diagram shows the format of the rx DELBA message sent
  8617. * from the target to the host:
  8618. *
  8619. * |31 20|19 16|15 10|9 8|7 0|
  8620. * |---------------------------------------------------------------------|
  8621. * | peer ID | TID | reserved | IR| msg type |
  8622. * |---------------------------------------------------------------------|
  8623. *
  8624. * The following field definitions describe the format of the rx ADDBA
  8625. * and DELBA messages sent from the target to the host.
  8626. * - MSG_TYPE
  8627. * Bits 7:0
  8628. * Purpose: identifies this as an rx ADDBA or DELBA message
  8629. * Value: ADDBA -> 0x5, DELBA -> 0x6
  8630. * - IR (initiator / recipient)
  8631. * Bits 9:8 (DELBA only)
  8632. * Purpose: specify whether the DELBA handshake was initiated by the
  8633. * local STA/AP, or by the peer STA/AP
  8634. * Value:
  8635. * 0 - unspecified
  8636. * 1 - initiator (a.k.a. originator)
  8637. * 2 - recipient (a.k.a. responder)
  8638. * 3 - unused / reserved
  8639. * - WIN_SIZE
  8640. * Bits 15:8 (ADDBA only)
  8641. * Purpose: Specifies the length of the block ack window (max = 64).
  8642. * Value:
  8643. * block ack window length specified by the received ADDBA
  8644. * management message.
  8645. * - TID
  8646. * Bits 19:16
  8647. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  8648. * Value:
  8649. * TID specified by the received ADDBA or DELBA management message.
  8650. * - PEER_ID
  8651. * Bits 31:20
  8652. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  8653. * Value:
  8654. * ID (hash value) used by the host for fast, direct lookup of
  8655. * host SW peer info, including rx reorder states.
  8656. */
  8657. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  8658. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  8659. #define HTT_RX_ADDBA_TID_M 0xf0000
  8660. #define HTT_RX_ADDBA_TID_S 16
  8661. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  8662. #define HTT_RX_ADDBA_PEER_ID_S 20
  8663. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  8664. do { \
  8665. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  8666. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  8667. } while (0)
  8668. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  8669. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  8670. #define HTT_RX_ADDBA_TID_SET(word, value) \
  8671. do { \
  8672. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  8673. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  8674. } while (0)
  8675. #define HTT_RX_ADDBA_TID_GET(word) \
  8676. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  8677. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  8678. do { \
  8679. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  8680. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  8681. } while (0)
  8682. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  8683. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  8684. #define HTT_RX_ADDBA_BYTES 4
  8685. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  8686. #define HTT_RX_DELBA_INITIATOR_S 8
  8687. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  8688. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  8689. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  8690. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  8691. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  8692. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  8693. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  8694. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  8695. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  8696. do { \
  8697. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  8698. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  8699. } while (0)
  8700. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  8701. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  8702. #define HTT_RX_DELBA_BYTES 4
  8703. /**
  8704. * @brief tx queue group information element definition
  8705. *
  8706. * @details
  8707. * The following diagram shows the format of the tx queue group
  8708. * information element, which can be included in target --> host
  8709. * messages to specify the number of tx "credits" (tx descriptors
  8710. * for LL, or tx buffers for HL) available to a particular group
  8711. * of host-side tx queues, and which host-side tx queues belong to
  8712. * the group.
  8713. *
  8714. * |31|30 24|23 16|15|14|13 0|
  8715. * |------------------------------------------------------------------------|
  8716. * | X| reserved | tx queue grp ID | A| S| credit count |
  8717. * |------------------------------------------------------------------------|
  8718. * | vdev ID mask | AC mask |
  8719. * |------------------------------------------------------------------------|
  8720. *
  8721. * The following definitions describe the fields within the tx queue group
  8722. * information element:
  8723. * - credit_count
  8724. * Bits 13:1
  8725. * Purpose: specify how many tx credits are available to the tx queue group
  8726. * Value: An absolute or relative, positive or negative credit value
  8727. * The 'A' bit specifies whether the value is absolute or relative.
  8728. * The 'S' bit specifies whether the value is positive or negative.
  8729. * A negative value can only be relative, not absolute.
  8730. * An absolute value replaces any prior credit value the host has for
  8731. * the tx queue group in question.
  8732. * A relative value is added to the prior credit value the host has for
  8733. * the tx queue group in question.
  8734. * - sign
  8735. * Bit 14
  8736. * Purpose: specify whether the credit count is positive or negative
  8737. * Value: 0 -> positive, 1 -> negative
  8738. * - absolute
  8739. * Bit 15
  8740. * Purpose: specify whether the credit count is absolute or relative
  8741. * Value: 0 -> relative, 1 -> absolute
  8742. * - txq_group_id
  8743. * Bits 23:16
  8744. * Purpose: indicate which tx queue group's credit and/or membership are
  8745. * being specified
  8746. * Value: 0 to max_tx_queue_groups-1
  8747. * - reserved
  8748. * Bits 30:16
  8749. * Value: 0x0
  8750. * - eXtension
  8751. * Bit 31
  8752. * Purpose: specify whether another tx queue group info element follows
  8753. * Value: 0 -> no more tx queue group information elements
  8754. * 1 -> another tx queue group information element immediately follows
  8755. * - ac_mask
  8756. * Bits 15:0
  8757. * Purpose: specify which Access Categories belong to the tx queue group
  8758. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  8759. * the tx queue group.
  8760. * The AC bit-mask values are obtained by left-shifting by the
  8761. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  8762. * - vdev_id_mask
  8763. * Bits 31:16
  8764. * Purpose: specify which vdev's tx queues belong to the tx queue group
  8765. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  8766. * belong to the tx queue group.
  8767. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  8768. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  8769. */
  8770. PREPACK struct htt_txq_group {
  8771. A_UINT32
  8772. credit_count: 14,
  8773. sign: 1,
  8774. absolute: 1,
  8775. tx_queue_group_id: 8,
  8776. reserved0: 7,
  8777. extension: 1;
  8778. A_UINT32
  8779. ac_mask: 16,
  8780. vdev_id_mask: 16;
  8781. } POSTPACK;
  8782. /* first word */
  8783. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  8784. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  8785. #define HTT_TXQ_GROUP_SIGN_S 14
  8786. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  8787. #define HTT_TXQ_GROUP_ABS_S 15
  8788. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  8789. #define HTT_TXQ_GROUP_ID_S 16
  8790. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  8791. #define HTT_TXQ_GROUP_EXT_S 31
  8792. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  8793. /* second word */
  8794. #define HTT_TXQ_GROUP_AC_MASK_S 0
  8795. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  8796. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  8797. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  8798. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  8799. do { \
  8800. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  8801. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  8802. } while (0)
  8803. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  8804. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  8805. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  8806. do { \
  8807. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  8808. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  8809. } while (0)
  8810. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  8811. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  8812. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  8813. do { \
  8814. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  8815. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  8816. } while (0)
  8817. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  8818. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  8819. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  8820. do { \
  8821. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  8822. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  8823. } while (0)
  8824. #define HTT_TXQ_GROUP_ID_GET(_info) \
  8825. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  8826. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  8827. do { \
  8828. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  8829. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  8830. } while (0)
  8831. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  8832. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  8833. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  8834. do { \
  8835. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  8836. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  8837. } while (0)
  8838. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  8839. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  8840. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  8841. do { \
  8842. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  8843. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  8844. } while (0)
  8845. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  8846. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  8847. /**
  8848. * @brief target -> host TX completion indication message definition
  8849. *
  8850. * @details
  8851. * The following diagram shows the format of the TX completion indication sent
  8852. * from the target to the host
  8853. *
  8854. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  8855. * |-------------------------------------------------------------------|
  8856. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  8857. * |-------------------------------------------------------------------|
  8858. * payload:| MSDU1 ID | MSDU0 ID |
  8859. * |-------------------------------------------------------------------|
  8860. * : MSDU3 ID | MSDU2 ID :
  8861. * |-------------------------------------------------------------------|
  8862. * | struct htt_tx_compl_ind_append_retries |
  8863. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  8864. * | struct htt_tx_compl_ind_append_tx_tstamp |
  8865. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  8866. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  8867. * |-------------------------------------------------------------------|
  8868. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  8869. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  8870. * | MSDU0 tx_tsf64_low |
  8871. * |-------------------------------------------------------------------|
  8872. * | MSDU0 tx_tsf64_high |
  8873. * |-------------------------------------------------------------------|
  8874. * | MSDU1 tx_tsf64_low |
  8875. * |-------------------------------------------------------------------|
  8876. * | MSDU1 tx_tsf64_high |
  8877. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  8878. * | phy_timestamp |
  8879. * |-------------------------------------------------------------------|
  8880. * | rate specs (see below) |
  8881. * |-------------------------------------------------------------------|
  8882. * | seqctrl | framectrl |
  8883. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  8884. * Where:
  8885. * A0 = append (a.k.a. append0)
  8886. * A1 = append1
  8887. * TP = MSDU tx power presence
  8888. * A2 = append2
  8889. * A3 = append3
  8890. * A4 = append4
  8891. *
  8892. * The following field definitions describe the format of the TX completion
  8893. * indication sent from the target to the host
  8894. * Header fields:
  8895. * - msg_type
  8896. * Bits 7:0
  8897. * Purpose: identifies this as HTT TX completion indication
  8898. * Value: 0x7
  8899. * - status
  8900. * Bits 10:8
  8901. * Purpose: the TX completion status of payload fragmentations descriptors
  8902. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  8903. * - tid
  8904. * Bits 14:11
  8905. * Purpose: the tid associated with those fragmentation descriptors. It is
  8906. * valid or not, depending on the tid_invalid bit.
  8907. * Value: 0 to 15
  8908. * - tid_invalid
  8909. * Bits 15:15
  8910. * Purpose: this bit indicates whether the tid field is valid or not
  8911. * Value: 0 indicates valid; 1 indicates invalid
  8912. * - num
  8913. * Bits 23:16
  8914. * Purpose: the number of payload in this indication
  8915. * Value: 1 to 255
  8916. * - append (a.k.a. append0)
  8917. * Bits 24:24
  8918. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  8919. * the number of tx retries for one MSDU at the end of this message
  8920. * Value: 0 indicates no appending; 1 indicates appending
  8921. * - append1
  8922. * Bits 25:25
  8923. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  8924. * contains the timestamp info for each TX msdu id in payload.
  8925. * The order of the timestamps matches the order of the MSDU IDs.
  8926. * Note that a big-endian host needs to account for the reordering
  8927. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  8928. * conversion) when determining which tx timestamp corresponds to
  8929. * which MSDU ID.
  8930. * Value: 0 indicates no appending; 1 indicates appending
  8931. * - msdu_tx_power_presence
  8932. * Bits 26:26
  8933. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  8934. * for each MSDU referenced by the TX_COMPL_IND message.
  8935. * The tx power is reported in 0.5 dBm units.
  8936. * The order of the per-MSDU tx power reports matches the order
  8937. * of the MSDU IDs.
  8938. * Note that a big-endian host needs to account for the reordering
  8939. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  8940. * conversion) when determining which Tx Power corresponds to
  8941. * which MSDU ID.
  8942. * Value: 0 indicates MSDU tx power reports are not appended,
  8943. * 1 indicates MSDU tx power reports are appended
  8944. * - append2
  8945. * Bits 27:27
  8946. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  8947. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  8948. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  8949. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  8950. * for each MSDU, for convenience.
  8951. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  8952. * this append2 bit is set).
  8953. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  8954. * dB above the noise floor.
  8955. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  8956. * 1 indicates MSDU ACK RSSI values are appended.
  8957. * - append3
  8958. * Bits 28:28
  8959. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  8960. * contains the tx tsf info based on wlan global TSF for
  8961. * each TX msdu id in payload.
  8962. * The order of the tx tsf matches the order of the MSDU IDs.
  8963. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  8964. * values to indicate the the lower 32 bits and higher 32 bits of
  8965. * the tx tsf.
  8966. * The tx_tsf64 here represents the time MSDU was acked and the
  8967. * tx_tsf64 has microseconds units.
  8968. * Value: 0 indicates no appending; 1 indicates appending
  8969. * - append4
  8970. * Bits 29:29
  8971. * Purpose: Indicate whether data frame control fields and fields required
  8972. * for radio tap header are appended for each MSDU in TX_COMP_IND
  8973. * message. The order of the this message matches the order of
  8974. * the MSDU IDs.
  8975. * Value: 0 indicates frame control fields and fields required for
  8976. * radio tap header values are not appended,
  8977. * 1 indicates frame control fields and fields required for
  8978. * radio tap header values are appended.
  8979. * Payload fields:
  8980. * - hmsdu_id
  8981. * Bits 15:0
  8982. * Purpose: this ID is used to track the Tx buffer in host
  8983. * Value: 0 to "size of host MSDU descriptor pool - 1"
  8984. */
  8985. PREPACK struct htt_tx_data_hdr_information {
  8986. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  8987. A_UINT32 /* word 1 */
  8988. /* preamble:
  8989. * 0-OFDM,
  8990. * 1-CCk,
  8991. * 2-HT,
  8992. * 3-VHT
  8993. */
  8994. preamble: 2, /* [1:0] */
  8995. /* mcs:
  8996. * In case of HT preamble interpret
  8997. * MCS along with NSS.
  8998. * Valid values for HT are 0 to 7.
  8999. * HT mcs 0 with NSS 2 is mcs 8.
  9000. * Valid values for VHT are 0 to 9.
  9001. */
  9002. mcs: 4, /* [5:2] */
  9003. /* rate:
  9004. * This is applicable only for
  9005. * CCK and OFDM preamble type
  9006. * rate 0: OFDM 48 Mbps,
  9007. * 1: OFDM 24 Mbps,
  9008. * 2: OFDM 12 Mbps
  9009. * 3: OFDM 6 Mbps
  9010. * 4: OFDM 54 Mbps
  9011. * 5: OFDM 36 Mbps
  9012. * 6: OFDM 18 Mbps
  9013. * 7: OFDM 9 Mbps
  9014. * rate 0: CCK 11 Mbps Long
  9015. * 1: CCK 5.5 Mbps Long
  9016. * 2: CCK 2 Mbps Long
  9017. * 3: CCK 1 Mbps Long
  9018. * 4: CCK 11 Mbps Short
  9019. * 5: CCK 5.5 Mbps Short
  9020. * 6: CCK 2 Mbps Short
  9021. */
  9022. rate : 3, /* [ 8: 6] */
  9023. rssi : 8, /* [16: 9] units=dBm */
  9024. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  9025. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  9026. stbc : 1, /* [22] */
  9027. sgi : 1, /* [23] */
  9028. ldpc : 1, /* [24] */
  9029. beamformed: 1, /* [25] */
  9030. /* tx_retry_cnt:
  9031. * Indicates retry count of data tx frames provided by the host.
  9032. */
  9033. tx_retry_cnt: 6; /* [31:26] */
  9034. A_UINT32 /* word 2 */
  9035. framectrl:16, /* [15: 0] */
  9036. seqno:16; /* [31:16] */
  9037. } POSTPACK;
  9038. #define HTT_TX_COMPL_IND_STATUS_S 8
  9039. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  9040. #define HTT_TX_COMPL_IND_TID_S 11
  9041. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  9042. #define HTT_TX_COMPL_IND_TID_INV_S 15
  9043. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  9044. #define HTT_TX_COMPL_IND_NUM_S 16
  9045. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  9046. #define HTT_TX_COMPL_IND_APPEND_S 24
  9047. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  9048. #define HTT_TX_COMPL_IND_APPEND1_S 25
  9049. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  9050. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  9051. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  9052. #define HTT_TX_COMPL_IND_APPEND2_S 27
  9053. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  9054. #define HTT_TX_COMPL_IND_APPEND3_S 28
  9055. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  9056. #define HTT_TX_COMPL_IND_APPEND4_S 29
  9057. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  9058. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  9059. do { \
  9060. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  9061. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  9062. } while (0)
  9063. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  9064. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  9065. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  9066. do { \
  9067. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  9068. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  9069. } while (0)
  9070. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  9071. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  9072. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  9073. do { \
  9074. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  9075. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  9076. } while (0)
  9077. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  9078. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  9079. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  9080. do { \
  9081. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  9082. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  9083. } while (0)
  9084. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  9085. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  9086. HTT_TX_COMPL_IND_TID_INV_S)
  9087. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  9088. do { \
  9089. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  9090. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  9091. } while (0)
  9092. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  9093. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  9094. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  9095. do { \
  9096. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  9097. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  9098. } while (0)
  9099. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  9100. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  9101. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  9102. do { \
  9103. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  9104. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  9105. } while (0)
  9106. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  9107. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  9108. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  9109. do { \
  9110. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  9111. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  9112. } while (0)
  9113. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  9114. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  9115. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  9116. do { \
  9117. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  9118. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  9119. } while (0)
  9120. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  9121. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  9122. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  9123. do { \
  9124. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  9125. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  9126. } while (0)
  9127. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  9128. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  9129. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  9130. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  9131. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  9132. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  9133. #define HTT_TX_COMPL_IND_STAT_OK 0
  9134. /* DISCARD:
  9135. * current meaning:
  9136. * MSDUs were queued for transmission but filtered by HW or SW
  9137. * without any over the air attempts
  9138. * legacy meaning (HL Rome):
  9139. * MSDUs were discarded by the target FW without any over the air
  9140. * attempts due to lack of space
  9141. */
  9142. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  9143. /* NO_ACK:
  9144. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  9145. */
  9146. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  9147. /* POSTPONE:
  9148. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  9149. * be downloaded again later (in the appropriate order), when they are
  9150. * deliverable.
  9151. */
  9152. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  9153. /*
  9154. * The PEER_DEL tx completion status is used for HL cases
  9155. * where the peer the frame is for has been deleted.
  9156. * The host has already discarded its copy of the frame, but
  9157. * it still needs the tx completion to restore its credit.
  9158. */
  9159. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  9160. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  9161. #define HTT_TX_COMPL_IND_STAT_DROP 5
  9162. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  9163. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  9164. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  9165. PREPACK struct htt_tx_compl_ind_base {
  9166. A_UINT32 hdr;
  9167. A_UINT16 payload[1/*or more*/];
  9168. } POSTPACK;
  9169. PREPACK struct htt_tx_compl_ind_append_retries {
  9170. A_UINT16 msdu_id;
  9171. A_UINT8 tx_retries;
  9172. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  9173. 0: this is the last append_retries struct */
  9174. } POSTPACK;
  9175. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  9176. A_UINT32 timestamp[1/*or more*/];
  9177. } POSTPACK;
  9178. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  9179. A_UINT32 tx_tsf64_low;
  9180. A_UINT32 tx_tsf64_high;
  9181. } POSTPACK;
  9182. /* htt_tx_data_hdr_information payload extension fields: */
  9183. /* DWORD zero */
  9184. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  9185. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  9186. /* DWORD one */
  9187. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  9188. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  9189. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  9190. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  9191. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  9192. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  9193. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  9194. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  9195. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  9196. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  9197. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  9198. #define HTT_FW_TX_DATA_HDR_BW_S 19
  9199. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  9200. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  9201. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  9202. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  9203. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  9204. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  9205. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  9206. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  9207. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  9208. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  9209. /* DWORD two */
  9210. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  9211. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  9212. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  9213. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  9214. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  9215. do { \
  9216. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  9217. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  9218. } while (0)
  9219. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  9220. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  9221. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  9222. do { \
  9223. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  9224. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  9225. } while (0)
  9226. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  9227. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  9228. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  9229. do { \
  9230. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  9231. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  9232. } while (0)
  9233. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  9234. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  9235. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  9236. do { \
  9237. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  9238. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  9239. } while (0)
  9240. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  9241. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  9242. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  9243. do { \
  9244. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  9245. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  9246. } while (0)
  9247. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  9248. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  9249. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  9250. do { \
  9251. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  9252. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  9253. } while (0)
  9254. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  9255. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  9256. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  9257. do { \
  9258. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  9259. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  9260. } while (0)
  9261. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  9262. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  9263. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  9264. do { \
  9265. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  9266. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  9267. } while (0)
  9268. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  9269. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  9270. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  9271. do { \
  9272. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  9273. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  9274. } while (0)
  9275. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  9276. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  9277. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  9278. do { \
  9279. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  9280. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  9281. } while (0)
  9282. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  9283. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  9284. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  9285. do { \
  9286. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  9287. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  9288. } while (0)
  9289. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  9290. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  9291. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  9292. do { \
  9293. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  9294. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  9295. } while (0)
  9296. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  9297. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  9298. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  9299. do { \
  9300. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  9301. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  9302. } while (0)
  9303. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  9304. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  9305. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  9306. do { \
  9307. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  9308. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  9309. } while (0)
  9310. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  9311. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  9312. /**
  9313. * @brief target -> host rate-control update indication message
  9314. *
  9315. * @details
  9316. * The following diagram shows the format of the RC Update message
  9317. * sent from the target to the host, while processing the tx-completion
  9318. * of a transmitted PPDU.
  9319. *
  9320. * |31 24|23 16|15 8|7 0|
  9321. * |-------------------------------------------------------------|
  9322. * | peer ID | vdev ID | msg_type |
  9323. * |-------------------------------------------------------------|
  9324. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  9325. * |-------------------------------------------------------------|
  9326. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  9327. * |-------------------------------------------------------------|
  9328. * | : |
  9329. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  9330. * | : |
  9331. * |-------------------------------------------------------------|
  9332. * | : |
  9333. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  9334. * | : |
  9335. * |-------------------------------------------------------------|
  9336. * : :
  9337. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  9338. *
  9339. */
  9340. typedef struct {
  9341. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  9342. A_UINT32 rate_code_flags;
  9343. A_UINT32 flags; /* Encodes information such as excessive
  9344. retransmission, aggregate, some info
  9345. from .11 frame control,
  9346. STBC, LDPC, (SGI and Tx Chain Mask
  9347. are encoded in ptx_rc->flags field),
  9348. AMPDU truncation (BT/time based etc.),
  9349. RTS/CTS attempt */
  9350. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  9351. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  9352. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  9353. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  9354. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  9355. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  9356. } HTT_RC_TX_DONE_PARAMS;
  9357. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  9358. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  9359. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  9360. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  9361. #define HTT_RC_UPDATE_VDEVID_S 8
  9362. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  9363. #define HTT_RC_UPDATE_PEERID_S 16
  9364. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  9365. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  9366. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  9367. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  9368. do { \
  9369. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  9370. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  9371. } while (0)
  9372. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  9373. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  9374. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  9375. do { \
  9376. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  9377. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  9378. } while (0)
  9379. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  9380. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  9381. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  9382. do { \
  9383. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  9384. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  9385. } while (0)
  9386. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  9387. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  9388. /**
  9389. * @brief target -> host rx fragment indication message definition
  9390. *
  9391. * @details
  9392. * The following field definitions describe the format of the rx fragment
  9393. * indication message sent from the target to the host.
  9394. * The rx fragment indication message shares the format of the
  9395. * rx indication message, but not all fields from the rx indication message
  9396. * are relevant to the rx fragment indication message.
  9397. *
  9398. *
  9399. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  9400. * |-----------+-------------------+---------------------+-------------|
  9401. * | peer ID | |FV| ext TID | msg type |
  9402. * |-------------------------------------------------------------------|
  9403. * | | flush | flush |
  9404. * | | end | start |
  9405. * | | seq num | seq num |
  9406. * |-------------------------------------------------------------------|
  9407. * | reserved | FW rx desc bytes |
  9408. * |-------------------------------------------------------------------|
  9409. * | | FW MSDU Rx |
  9410. * | | desc B0 |
  9411. * |-------------------------------------------------------------------|
  9412. * Header fields:
  9413. * - MSG_TYPE
  9414. * Bits 7:0
  9415. * Purpose: identifies this as an rx fragment indication message
  9416. * Value: 0xa
  9417. * - EXT_TID
  9418. * Bits 12:8
  9419. * Purpose: identify the traffic ID of the rx data, including
  9420. * special "extended" TID values for multicast, broadcast, and
  9421. * non-QoS data frames
  9422. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  9423. * - FLUSH_VALID (FV)
  9424. * Bit 13
  9425. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  9426. * is valid
  9427. * Value:
  9428. * 1 -> flush IE is valid and needs to be processed
  9429. * 0 -> flush IE is not valid and should be ignored
  9430. * - PEER_ID
  9431. * Bits 31:16
  9432. * Purpose: Identify, by ID, which peer sent the rx data
  9433. * Value: ID of the peer who sent the rx data
  9434. * - FLUSH_SEQ_NUM_START
  9435. * Bits 5:0
  9436. * Purpose: Indicate the start of a series of MPDUs to flush
  9437. * Not all MPDUs within this series are necessarily valid - the host
  9438. * must check each sequence number within this range to see if the
  9439. * corresponding MPDU is actually present.
  9440. * This field is only valid if the FV bit is set.
  9441. * Value:
  9442. * The sequence number for the first MPDUs to check to flush.
  9443. * The sequence number is masked by 0x3f.
  9444. * - FLUSH_SEQ_NUM_END
  9445. * Bits 11:6
  9446. * Purpose: Indicate the end of a series of MPDUs to flush
  9447. * Value:
  9448. * The sequence number one larger than the sequence number of the
  9449. * last MPDU to check to flush.
  9450. * The sequence number is masked by 0x3f.
  9451. * Not all MPDUs within this series are necessarily valid - the host
  9452. * must check each sequence number within this range to see if the
  9453. * corresponding MPDU is actually present.
  9454. * This field is only valid if the FV bit is set.
  9455. * Rx descriptor fields:
  9456. * - FW_RX_DESC_BYTES
  9457. * Bits 15:0
  9458. * Purpose: Indicate how many bytes in the Rx indication are used for
  9459. * FW Rx descriptors
  9460. * Value: 1
  9461. */
  9462. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  9463. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  9464. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  9465. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  9466. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  9467. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  9468. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  9469. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  9470. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  9471. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  9472. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  9473. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  9474. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  9475. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  9476. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  9477. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  9478. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  9479. #define HTT_RX_FRAG_IND_BYTES \
  9480. (4 /* msg hdr */ + \
  9481. 4 /* flush spec */ + \
  9482. 4 /* (unused) FW rx desc bytes spec */ + \
  9483. 4 /* FW rx desc */)
  9484. /**
  9485. * @brief target -> host test message definition
  9486. *
  9487. * @details
  9488. * The following field definitions describe the format of the test
  9489. * message sent from the target to the host.
  9490. * The message consists of a 4-octet header, followed by a variable
  9491. * number of 32-bit integer values, followed by a variable number
  9492. * of 8-bit character values.
  9493. *
  9494. * |31 16|15 8|7 0|
  9495. * |-----------------------------------------------------------|
  9496. * | num chars | num ints | msg type |
  9497. * |-----------------------------------------------------------|
  9498. * | int 0 |
  9499. * |-----------------------------------------------------------|
  9500. * | int 1 |
  9501. * |-----------------------------------------------------------|
  9502. * | ... |
  9503. * |-----------------------------------------------------------|
  9504. * | char 3 | char 2 | char 1 | char 0 |
  9505. * |-----------------------------------------------------------|
  9506. * | | | ... | char 4 |
  9507. * |-----------------------------------------------------------|
  9508. * - MSG_TYPE
  9509. * Bits 7:0
  9510. * Purpose: identifies this as a test message
  9511. * Value: HTT_MSG_TYPE_TEST
  9512. * - NUM_INTS
  9513. * Bits 15:8
  9514. * Purpose: indicate how many 32-bit integers follow the message header
  9515. * - NUM_CHARS
  9516. * Bits 31:16
  9517. * Purpose: indicate how many 8-bit charaters follow the series of integers
  9518. */
  9519. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  9520. #define HTT_RX_TEST_NUM_INTS_S 8
  9521. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  9522. #define HTT_RX_TEST_NUM_CHARS_S 16
  9523. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  9524. do { \
  9525. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  9526. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  9527. } while (0)
  9528. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  9529. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  9530. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  9531. do { \
  9532. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  9533. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  9534. } while (0)
  9535. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  9536. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  9537. /**
  9538. * @brief target -> host packet log message
  9539. *
  9540. * @details
  9541. * The following field definitions describe the format of the packet log
  9542. * message sent from the target to the host.
  9543. * The message consists of a 4-octet header,followed by a variable number
  9544. * of 32-bit character values.
  9545. *
  9546. * |31 16|15 12|11 10|9 8|7 0|
  9547. * |------------------------------------------------------------------|
  9548. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  9549. * |------------------------------------------------------------------|
  9550. * | payload |
  9551. * |------------------------------------------------------------------|
  9552. * - MSG_TYPE
  9553. * Bits 7:0
  9554. * Purpose: identifies this as a pktlog message
  9555. * Value: HTT_T2H_MSG_TYPE_PKTLOG
  9556. * - mac_id
  9557. * Bits 9:8
  9558. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  9559. * Value: 0-3
  9560. * - pdev_id
  9561. * Bits 11:10
  9562. * Purpose: pdev_id
  9563. * Value: 0-3
  9564. * 0 (for rings at SOC level),
  9565. * 1/2/3 PDEV -> 0/1/2
  9566. * - payload_size
  9567. * Bits 31:16
  9568. * Purpose: explicitly specify the payload size
  9569. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  9570. */
  9571. PREPACK struct htt_pktlog_msg {
  9572. A_UINT32 header;
  9573. A_UINT32 payload[1/* or more */];
  9574. } POSTPACK;
  9575. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  9576. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  9577. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  9578. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  9579. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  9580. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  9581. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  9582. do { \
  9583. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  9584. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  9585. } while (0)
  9586. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  9587. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  9588. HTT_T2H_PKTLOG_MAC_ID_S)
  9589. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  9590. do { \
  9591. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  9592. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  9593. } while (0)
  9594. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  9595. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  9596. HTT_T2H_PKTLOG_PDEV_ID_S)
  9597. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  9598. do { \
  9599. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  9600. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  9601. } while (0)
  9602. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  9603. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  9604. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  9605. /*
  9606. * Rx reorder statistics
  9607. * NB: all the fields must be defined in 4 octets size.
  9608. */
  9609. struct rx_reorder_stats {
  9610. /* Non QoS MPDUs received */
  9611. A_UINT32 deliver_non_qos;
  9612. /* MPDUs received in-order */
  9613. A_UINT32 deliver_in_order;
  9614. /* Flush due to reorder timer expired */
  9615. A_UINT32 deliver_flush_timeout;
  9616. /* Flush due to move out of window */
  9617. A_UINT32 deliver_flush_oow;
  9618. /* Flush due to DELBA */
  9619. A_UINT32 deliver_flush_delba;
  9620. /* MPDUs dropped due to FCS error */
  9621. A_UINT32 fcs_error;
  9622. /* MPDUs dropped due to monitor mode non-data packet */
  9623. A_UINT32 mgmt_ctrl;
  9624. /* Unicast-data MPDUs dropped due to invalid peer */
  9625. A_UINT32 invalid_peer;
  9626. /* MPDUs dropped due to duplication (non aggregation) */
  9627. A_UINT32 dup_non_aggr;
  9628. /* MPDUs dropped due to processed before */
  9629. A_UINT32 dup_past;
  9630. /* MPDUs dropped due to duplicate in reorder queue */
  9631. A_UINT32 dup_in_reorder;
  9632. /* Reorder timeout happened */
  9633. A_UINT32 reorder_timeout;
  9634. /* invalid bar ssn */
  9635. A_UINT32 invalid_bar_ssn;
  9636. /* reorder reset due to bar ssn */
  9637. A_UINT32 ssn_reset;
  9638. /* Flush due to delete peer */
  9639. A_UINT32 deliver_flush_delpeer;
  9640. /* Flush due to offload*/
  9641. A_UINT32 deliver_flush_offload;
  9642. /* Flush due to out of buffer*/
  9643. A_UINT32 deliver_flush_oob;
  9644. /* MPDUs dropped due to PN check fail */
  9645. A_UINT32 pn_fail;
  9646. /* MPDUs dropped due to unable to allocate memory */
  9647. A_UINT32 store_fail;
  9648. /* Number of times the tid pool alloc succeeded */
  9649. A_UINT32 tid_pool_alloc_succ;
  9650. /* Number of times the MPDU pool alloc succeeded */
  9651. A_UINT32 mpdu_pool_alloc_succ;
  9652. /* Number of times the MSDU pool alloc succeeded */
  9653. A_UINT32 msdu_pool_alloc_succ;
  9654. /* Number of times the tid pool alloc failed */
  9655. A_UINT32 tid_pool_alloc_fail;
  9656. /* Number of times the MPDU pool alloc failed */
  9657. A_UINT32 mpdu_pool_alloc_fail;
  9658. /* Number of times the MSDU pool alloc failed */
  9659. A_UINT32 msdu_pool_alloc_fail;
  9660. /* Number of times the tid pool freed */
  9661. A_UINT32 tid_pool_free;
  9662. /* Number of times the MPDU pool freed */
  9663. A_UINT32 mpdu_pool_free;
  9664. /* Number of times the MSDU pool freed */
  9665. A_UINT32 msdu_pool_free;
  9666. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  9667. A_UINT32 msdu_queued;
  9668. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  9669. A_UINT32 msdu_recycled;
  9670. /* Number of MPDUs with invalid peer but A2 found in AST */
  9671. A_UINT32 invalid_peer_a2_in_ast;
  9672. /* Number of MPDUs with invalid peer but A3 found in AST */
  9673. A_UINT32 invalid_peer_a3_in_ast;
  9674. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  9675. A_UINT32 invalid_peer_bmc_mpdus;
  9676. /* Number of MSDUs with err attention word */
  9677. A_UINT32 rxdesc_err_att;
  9678. /* Number of MSDUs with flag of peer_idx_invalid */
  9679. A_UINT32 rxdesc_err_peer_idx_inv;
  9680. /* Number of MSDUs with flag of peer_idx_timeout */
  9681. A_UINT32 rxdesc_err_peer_idx_to;
  9682. /* Number of MSDUs with flag of overflow */
  9683. A_UINT32 rxdesc_err_ov;
  9684. /* Number of MSDUs with flag of msdu_length_err */
  9685. A_UINT32 rxdesc_err_msdu_len;
  9686. /* Number of MSDUs with flag of mpdu_length_err */
  9687. A_UINT32 rxdesc_err_mpdu_len;
  9688. /* Number of MSDUs with flag of tkip_mic_err */
  9689. A_UINT32 rxdesc_err_tkip_mic;
  9690. /* Number of MSDUs with flag of decrypt_err */
  9691. A_UINT32 rxdesc_err_decrypt;
  9692. /* Number of MSDUs with flag of fcs_err */
  9693. A_UINT32 rxdesc_err_fcs;
  9694. /* Number of Unicast (bc_mc bit is not set in attention word)
  9695. * frames with invalid peer handler
  9696. */
  9697. A_UINT32 rxdesc_uc_msdus_inv_peer;
  9698. /* Number of unicast frame directly (direct bit is set in attention word)
  9699. * to DUT with invalid peer handler
  9700. */
  9701. A_UINT32 rxdesc_direct_msdus_inv_peer;
  9702. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  9703. * frames with invalid peer handler
  9704. */
  9705. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  9706. /* Number of MSDUs dropped due to no first MSDU flag */
  9707. A_UINT32 rxdesc_no_1st_msdu;
  9708. /* Number of MSDUs droped due to ring overflow */
  9709. A_UINT32 msdu_drop_ring_ov;
  9710. /* Number of MSDUs dropped due to FC mismatch */
  9711. A_UINT32 msdu_drop_fc_mismatch;
  9712. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  9713. A_UINT32 msdu_drop_mgmt_remote_ring;
  9714. /* Number of MSDUs dropped due to errors not reported in attention word */
  9715. A_UINT32 msdu_drop_misc;
  9716. /* Number of MSDUs go to offload before reorder */
  9717. A_UINT32 offload_msdu_wal;
  9718. /* Number of data frame dropped by offload after reorder */
  9719. A_UINT32 offload_msdu_reorder;
  9720. /* Number of MPDUs with sequence number in the past and within the BA window */
  9721. A_UINT32 dup_past_within_window;
  9722. /* Number of MPDUs with sequence number in the past and outside the BA window */
  9723. A_UINT32 dup_past_outside_window;
  9724. /* Number of MSDUs with decrypt/MIC error */
  9725. A_UINT32 rxdesc_err_decrypt_mic;
  9726. /* Number of data MSDUs received on both local and remote rings */
  9727. A_UINT32 data_msdus_on_both_rings;
  9728. /* MPDUs never filled */
  9729. A_UINT32 holes_not_filled;
  9730. };
  9731. /*
  9732. * Rx Remote buffer statistics
  9733. * NB: all the fields must be defined in 4 octets size.
  9734. */
  9735. struct rx_remote_buffer_mgmt_stats {
  9736. /* Total number of MSDUs reaped for Rx processing */
  9737. A_UINT32 remote_reaped;
  9738. /* MSDUs recycled within firmware */
  9739. A_UINT32 remote_recycled;
  9740. /* MSDUs stored by Data Rx */
  9741. A_UINT32 data_rx_msdus_stored;
  9742. /* Number of HTT indications from WAL Rx MSDU */
  9743. A_UINT32 wal_rx_ind;
  9744. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  9745. A_UINT32 wal_rx_ind_unconsumed;
  9746. /* Number of HTT indications from Data Rx MSDU */
  9747. A_UINT32 data_rx_ind;
  9748. /* Number of unconsumed HTT indications from Data Rx MSDU */
  9749. A_UINT32 data_rx_ind_unconsumed;
  9750. /* Number of HTT indications from ATHBUF */
  9751. A_UINT32 athbuf_rx_ind;
  9752. /* Number of remote buffers requested for refill */
  9753. A_UINT32 refill_buf_req;
  9754. /* Number of remote buffers filled by the host */
  9755. A_UINT32 refill_buf_rsp;
  9756. /* Number of times MAC hw_index = f/w write_index */
  9757. A_INT32 mac_no_bufs;
  9758. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  9759. A_INT32 fw_indices_equal;
  9760. /* Number of times f/w finds no buffers to post */
  9761. A_INT32 host_no_bufs;
  9762. };
  9763. /*
  9764. * TXBF MU/SU packets and NDPA statistics
  9765. * NB: all the fields must be defined in 4 octets size.
  9766. */
  9767. struct rx_txbf_musu_ndpa_pkts_stats {
  9768. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  9769. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  9770. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  9771. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  9772. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  9773. A_UINT32 reserved[3]; /* must be set to 0x0 */
  9774. };
  9775. /*
  9776. * htt_dbg_stats_status -
  9777. * present - The requested stats have been delivered in full.
  9778. * This indicates that either the stats information was contained
  9779. * in its entirety within this message, or else this message
  9780. * completes the delivery of the requested stats info that was
  9781. * partially delivered through earlier STATS_CONF messages.
  9782. * partial - The requested stats have been delivered in part.
  9783. * One or more subsequent STATS_CONF messages with the same
  9784. * cookie value will be sent to deliver the remainder of the
  9785. * information.
  9786. * error - The requested stats could not be delivered, for example due
  9787. * to a shortage of memory to construct a message holding the
  9788. * requested stats.
  9789. * invalid - The requested stat type is either not recognized, or the
  9790. * target is configured to not gather the stats type in question.
  9791. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  9792. * series_done - This special value indicates that no further stats info
  9793. * elements are present within a series of stats info elems
  9794. * (within a stats upload confirmation message).
  9795. */
  9796. enum htt_dbg_stats_status {
  9797. HTT_DBG_STATS_STATUS_PRESENT = 0,
  9798. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  9799. HTT_DBG_STATS_STATUS_ERROR = 2,
  9800. HTT_DBG_STATS_STATUS_INVALID = 3,
  9801. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  9802. };
  9803. /**
  9804. * @brief target -> host statistics upload
  9805. *
  9806. * @details
  9807. * The following field definitions describe the format of the HTT target
  9808. * to host stats upload confirmation message.
  9809. * The message contains a cookie echoed from the HTT host->target stats
  9810. * upload request, which identifies which request the confirmation is
  9811. * for, and a series of tag-length-value stats information elements.
  9812. * The tag-length header for each stats info element also includes a
  9813. * status field, to indicate whether the request for the stat type in
  9814. * question was fully met, partially met, unable to be met, or invalid
  9815. * (if the stat type in question is disabled in the target).
  9816. * A special value of all 1's in this status field is used to indicate
  9817. * the end of the series of stats info elements.
  9818. *
  9819. *
  9820. * |31 16|15 8|7 5|4 0|
  9821. * |------------------------------------------------------------|
  9822. * | reserved | msg type |
  9823. * |------------------------------------------------------------|
  9824. * | cookie LSBs |
  9825. * |------------------------------------------------------------|
  9826. * | cookie MSBs |
  9827. * |------------------------------------------------------------|
  9828. * | stats entry length | reserved | S |stat type|
  9829. * |------------------------------------------------------------|
  9830. * | |
  9831. * | type-specific stats info |
  9832. * | |
  9833. * |------------------------------------------------------------|
  9834. * | stats entry length | reserved | S |stat type|
  9835. * |------------------------------------------------------------|
  9836. * | |
  9837. * | type-specific stats info |
  9838. * | |
  9839. * |------------------------------------------------------------|
  9840. * | n/a | reserved | 111 | n/a |
  9841. * |------------------------------------------------------------|
  9842. * Header fields:
  9843. * - MSG_TYPE
  9844. * Bits 7:0
  9845. * Purpose: identifies this is a statistics upload confirmation message
  9846. * Value: 0x9
  9847. * - COOKIE_LSBS
  9848. * Bits 31:0
  9849. * Purpose: Provide a mechanism to match a target->host stats confirmation
  9850. * message with its preceding host->target stats request message.
  9851. * Value: LSBs of the opaque cookie specified by the host-side requestor
  9852. * - COOKIE_MSBS
  9853. * Bits 31:0
  9854. * Purpose: Provide a mechanism to match a target->host stats confirmation
  9855. * message with its preceding host->target stats request message.
  9856. * Value: MSBs of the opaque cookie specified by the host-side requestor
  9857. *
  9858. * Stats Information Element tag-length header fields:
  9859. * - STAT_TYPE
  9860. * Bits 4:0
  9861. * Purpose: identifies the type of statistics info held in the
  9862. * following information element
  9863. * Value: htt_dbg_stats_type
  9864. * - STATUS
  9865. * Bits 7:5
  9866. * Purpose: indicate whether the requested stats are present
  9867. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  9868. * the completion of the stats entry series
  9869. * - LENGTH
  9870. * Bits 31:16
  9871. * Purpose: indicate the stats information size
  9872. * Value: This field specifies the number of bytes of stats information
  9873. * that follows the element tag-length header.
  9874. * It is expected but not required that this length is a multiple of
  9875. * 4 bytes. Even if the length is not an integer multiple of 4, the
  9876. * subsequent stats entry header will begin on a 4-byte aligned
  9877. * boundary.
  9878. */
  9879. #define HTT_T2H_STATS_COOKIE_SIZE 8
  9880. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  9881. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  9882. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  9883. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  9884. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  9885. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  9886. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  9887. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  9888. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  9889. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  9890. do { \
  9891. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  9892. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  9893. } while (0)
  9894. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  9895. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  9896. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  9897. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  9898. do { \
  9899. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  9900. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  9901. } while (0)
  9902. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  9903. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  9904. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  9905. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  9906. do { \
  9907. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  9908. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  9909. } while (0)
  9910. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  9911. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  9912. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  9913. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  9914. #define HTT_MAX_AGGR 64
  9915. #define HTT_HL_MAX_AGGR 18
  9916. /**
  9917. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  9918. *
  9919. * @details
  9920. * The following field definitions describe the format of the HTT host
  9921. * to target frag_desc/msdu_ext bank configuration message.
  9922. * The message contains the based address and the min and max id of the
  9923. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  9924. * MSDU_EXT/FRAG_DESC.
  9925. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  9926. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  9927. * the hardware does the mapping/translation.
  9928. *
  9929. * Total banks that can be configured is configured to 16.
  9930. *
  9931. * This should be called before any TX has be initiated by the HTT
  9932. *
  9933. * |31 16|15 8|7 5|4 0|
  9934. * |------------------------------------------------------------|
  9935. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  9936. * |------------------------------------------------------------|
  9937. * | BANK0_BASE_ADDRESS (bits 31:0) |
  9938. #if HTT_PADDR64
  9939. * | BANK0_BASE_ADDRESS (bits 63:32) |
  9940. #endif
  9941. * |------------------------------------------------------------|
  9942. * | ... |
  9943. * |------------------------------------------------------------|
  9944. * | BANK15_BASE_ADDRESS (bits 31:0) |
  9945. #if HTT_PADDR64
  9946. * | BANK15_BASE_ADDRESS (bits 63:32) |
  9947. #endif
  9948. * |------------------------------------------------------------|
  9949. * | BANK0_MAX_ID | BANK0_MIN_ID |
  9950. * |------------------------------------------------------------|
  9951. * | ... |
  9952. * |------------------------------------------------------------|
  9953. * | BANK15_MAX_ID | BANK15_MIN_ID |
  9954. * |------------------------------------------------------------|
  9955. * Header fields:
  9956. * - MSG_TYPE
  9957. * Bits 7:0
  9958. * Value: 0x6
  9959. * for systems with 64-bit format for bus addresses:
  9960. * - BANKx_BASE_ADDRESS_LO
  9961. * Bits 31:0
  9962. * Purpose: Provide a mechanism to specify the base address of the
  9963. * MSDU_EXT bank physical/bus address.
  9964. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  9965. * - BANKx_BASE_ADDRESS_HI
  9966. * Bits 31:0
  9967. * Purpose: Provide a mechanism to specify the base address of the
  9968. * MSDU_EXT bank physical/bus address.
  9969. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  9970. * for systems with 32-bit format for bus addresses:
  9971. * - BANKx_BASE_ADDRESS
  9972. * Bits 31:0
  9973. * Purpose: Provide a mechanism to specify the base address of the
  9974. * MSDU_EXT bank physical/bus address.
  9975. * Value: MSDU_EXT bank physical / bus address
  9976. * - BANKx_MIN_ID
  9977. * Bits 15:0
  9978. * Purpose: Provide a mechanism to specify the min index that needs to
  9979. * mapped.
  9980. * - BANKx_MAX_ID
  9981. * Bits 31:16
  9982. * Purpose: Provide a mechanism to specify the max index that needs to
  9983. * mapped.
  9984. *
  9985. */
  9986. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  9987. * safe value.
  9988. * @note MAX supported banks is 16.
  9989. */
  9990. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  9991. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  9992. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  9993. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  9994. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  9995. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  9996. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  9997. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  9998. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  9999. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  10000. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  10001. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  10002. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  10003. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  10004. do { \
  10005. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  10006. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  10007. } while (0)
  10008. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  10009. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  10010. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  10011. do { \
  10012. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  10013. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  10014. } while (0)
  10015. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  10016. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  10017. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  10018. do { \
  10019. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  10020. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  10021. } while (0)
  10022. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  10023. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  10024. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  10025. do { \
  10026. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  10027. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  10028. } while (0)
  10029. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  10030. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  10031. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  10032. do { \
  10033. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  10034. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  10035. } while (0)
  10036. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  10037. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  10038. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  10039. do { \
  10040. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  10041. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  10042. } while (0)
  10043. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  10044. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  10045. /*
  10046. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  10047. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  10048. * addresses are stored in a XXX-bit field.
  10049. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  10050. * htt_tx_frag_desc64_bank_cfg_t structs.
  10051. */
  10052. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  10053. _paddr_bits_, \
  10054. _paddr__bank_base_address_) \
  10055. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  10056. /** word 0 \
  10057. * msg_type: 8, \
  10058. * pdev_id: 2, \
  10059. * swap: 1, \
  10060. * reserved0: 5, \
  10061. * num_banks: 8, \
  10062. * desc_size: 8; \
  10063. */ \
  10064. A_UINT32 word0; \
  10065. /* \
  10066. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  10067. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  10068. * the second A_UINT32). \
  10069. */ \
  10070. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  10071. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  10072. } POSTPACK
  10073. /* define htt_tx_frag_desc32_bank_cfg_t */
  10074. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  10075. /* define htt_tx_frag_desc64_bank_cfg_t */
  10076. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  10077. /*
  10078. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  10079. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  10080. */
  10081. #if HTT_PADDR64
  10082. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  10083. #else
  10084. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  10085. #endif
  10086. /**
  10087. * @brief target -> host HTT TX Credit total count update message definition
  10088. *
  10089. *|31 16|15|14 9| 8 |7 0 |
  10090. *|---------------------+--+----------+-------+----------|
  10091. *|cur htt credit delta | Q| reserved | sign | msg type |
  10092. *|------------------------------------------------------|
  10093. *
  10094. * Header fields:
  10095. * - MSG_TYPE
  10096. * Bits 7:0
  10097. * Purpose: identifies this as a htt tx credit delta update message
  10098. * Value: 0xe
  10099. * - SIGN
  10100. * Bits 8
  10101. * identifies whether credit delta is positive or negative
  10102. * Value:
  10103. * - 0x0: credit delta is positive, rebalance in some buffers
  10104. * - 0x1: credit delta is negative, rebalance out some buffers
  10105. * - reserved
  10106. * Bits 14:9
  10107. * Value: 0x0
  10108. * - TXQ_GRP
  10109. * Bit 15
  10110. * Purpose: indicates whether any tx queue group information elements
  10111. * are appended to the tx credit update message
  10112. * Value: 0 -> no tx queue group information element is present
  10113. * 1 -> a tx queue group information element immediately follows
  10114. * - DELTA_COUNT
  10115. * Bits 31:16
  10116. * Purpose: Specify current htt credit delta absolute count
  10117. */
  10118. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  10119. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  10120. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  10121. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  10122. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  10123. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  10124. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  10125. do { \
  10126. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  10127. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  10128. } while (0)
  10129. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  10130. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  10131. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  10132. do { \
  10133. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  10134. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  10135. } while (0)
  10136. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  10137. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  10138. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  10139. do { \
  10140. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  10141. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  10142. } while (0)
  10143. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  10144. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  10145. #define HTT_TX_CREDIT_MSG_BYTES 4
  10146. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  10147. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  10148. /**
  10149. * @brief HTT WDI_IPA Operation Response Message
  10150. *
  10151. * @details
  10152. * HTT WDI_IPA Operation Response message is sent by target
  10153. * to host confirming suspend or resume operation.
  10154. * |31 24|23 16|15 8|7 0|
  10155. * |----------------+----------------+----------------+----------------|
  10156. * | op_code | Rsvd | msg_type |
  10157. * |-------------------------------------------------------------------|
  10158. * | Rsvd | Response len |
  10159. * |-------------------------------------------------------------------|
  10160. * | |
  10161. * | Response-type specific info |
  10162. * | |
  10163. * | |
  10164. * |-------------------------------------------------------------------|
  10165. * Header fields:
  10166. * - MSG_TYPE
  10167. * Bits 7:0
  10168. * Purpose: Identifies this as WDI_IPA Operation Response message
  10169. * value: = 0x13
  10170. * - OP_CODE
  10171. * Bits 31:16
  10172. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  10173. * value: = enum htt_wdi_ipa_op_code
  10174. * - RSP_LEN
  10175. * Bits 16:0
  10176. * Purpose: length for the response-type specific info
  10177. * value: = length in bytes for response-type specific info
  10178. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  10179. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  10180. */
  10181. PREPACK struct htt_wdi_ipa_op_response_t
  10182. {
  10183. /* DWORD 0: flags and meta-data */
  10184. A_UINT32
  10185. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  10186. reserved1: 8,
  10187. op_code: 16;
  10188. A_UINT32
  10189. rsp_len: 16,
  10190. reserved2: 16;
  10191. } POSTPACK;
  10192. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  10193. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  10194. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  10195. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  10196. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  10197. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  10198. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  10199. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  10200. do { \
  10201. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  10202. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  10203. } while (0)
  10204. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  10205. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  10206. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  10207. do { \
  10208. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  10209. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  10210. } while (0)
  10211. enum htt_phy_mode {
  10212. htt_phy_mode_11a = 0,
  10213. htt_phy_mode_11g = 1,
  10214. htt_phy_mode_11b = 2,
  10215. htt_phy_mode_11g_only = 3,
  10216. htt_phy_mode_11na_ht20 = 4,
  10217. htt_phy_mode_11ng_ht20 = 5,
  10218. htt_phy_mode_11na_ht40 = 6,
  10219. htt_phy_mode_11ng_ht40 = 7,
  10220. htt_phy_mode_11ac_vht20 = 8,
  10221. htt_phy_mode_11ac_vht40 = 9,
  10222. htt_phy_mode_11ac_vht80 = 10,
  10223. htt_phy_mode_11ac_vht20_2g = 11,
  10224. htt_phy_mode_11ac_vht40_2g = 12,
  10225. htt_phy_mode_11ac_vht80_2g = 13,
  10226. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  10227. htt_phy_mode_11ac_vht160 = 15,
  10228. htt_phy_mode_max,
  10229. };
  10230. /**
  10231. * @brief target -> host HTT channel change indication
  10232. * @details
  10233. * Specify when a channel change occurs.
  10234. * This allows the host to precisely determine which rx frames arrived
  10235. * on the old channel and which rx frames arrived on the new channel.
  10236. *
  10237. *|31 |7 0 |
  10238. *|-------------------------------------------+----------|
  10239. *| reserved | msg type |
  10240. *|------------------------------------------------------|
  10241. *| primary_chan_center_freq_mhz |
  10242. *|------------------------------------------------------|
  10243. *| contiguous_chan1_center_freq_mhz |
  10244. *|------------------------------------------------------|
  10245. *| contiguous_chan2_center_freq_mhz |
  10246. *|------------------------------------------------------|
  10247. *| phy_mode |
  10248. *|------------------------------------------------------|
  10249. *
  10250. * Header fields:
  10251. * - MSG_TYPE
  10252. * Bits 7:0
  10253. * Purpose: identifies this as a htt channel change indication message
  10254. * Value: 0x15
  10255. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  10256. * Bits 31:0
  10257. * Purpose: identify the (center of the) new 20 MHz primary channel
  10258. * Value: center frequency of the 20 MHz primary channel, in MHz units
  10259. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  10260. * Bits 31:0
  10261. * Purpose: identify the (center of the) contiguous frequency range
  10262. * comprising the new channel.
  10263. * For example, if the new channel is a 80 MHz channel extending
  10264. * 60 MHz beyond the primary channel, this field would be 30 larger
  10265. * than the primary channel center frequency field.
  10266. * Value: center frequency of the contiguous frequency range comprising
  10267. * the full channel in MHz units
  10268. * (80+80 channels also use the CONTIG_CHAN2 field)
  10269. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  10270. * Bits 31:0
  10271. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  10272. * within a VHT 80+80 channel.
  10273. * This field is only relevant for VHT 80+80 channels.
  10274. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  10275. * channel (arbitrary value for cases besides VHT 80+80)
  10276. * - PHY_MODE
  10277. * Bits 31:0
  10278. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  10279. * and band
  10280. * Value: htt_phy_mode enum value
  10281. */
  10282. PREPACK struct htt_chan_change_t
  10283. {
  10284. /* DWORD 0: flags and meta-data */
  10285. A_UINT32
  10286. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  10287. reserved1: 24;
  10288. A_UINT32 primary_chan_center_freq_mhz;
  10289. A_UINT32 contig_chan1_center_freq_mhz;
  10290. A_UINT32 contig_chan2_center_freq_mhz;
  10291. A_UINT32 phy_mode;
  10292. } POSTPACK;
  10293. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  10294. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  10295. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  10296. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  10297. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  10298. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  10299. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  10300. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  10301. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  10302. do { \
  10303. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  10304. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  10305. } while (0)
  10306. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  10307. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  10308. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  10309. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  10310. do { \
  10311. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  10312. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  10313. } while (0)
  10314. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  10315. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  10316. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  10317. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  10318. do { \
  10319. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  10320. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  10321. } while (0)
  10322. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  10323. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  10324. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  10325. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  10326. do { \
  10327. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  10328. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  10329. } while (0)
  10330. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  10331. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  10332. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  10333. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  10334. /**
  10335. * @brief rx offload packet error message
  10336. *
  10337. * @details
  10338. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  10339. * of target payload like mic err.
  10340. *
  10341. * |31 24|23 16|15 8|7 0|
  10342. * |----------------+----------------+----------------+----------------|
  10343. * | tid | vdev_id | msg_sub_type | msg_type |
  10344. * |-------------------------------------------------------------------|
  10345. * : (sub-type dependent content) :
  10346. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  10347. * Header fields:
  10348. * - msg_type
  10349. * Bits 7:0
  10350. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  10351. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  10352. * - msg_sub_type
  10353. * Bits 15:8
  10354. * Purpose: Identifies which type of rx error is reported by this message
  10355. * value: htt_rx_ofld_pkt_err_type
  10356. * - vdev_id
  10357. * Bits 23:16
  10358. * Purpose: Identifies which vdev received the erroneous rx frame
  10359. * value:
  10360. * - tid
  10361. * Bits 31:24
  10362. * Purpose: Identifies the traffic type of the rx frame
  10363. * value:
  10364. *
  10365. * - The payload fields used if the sub-type == MIC error are shown below.
  10366. * Note - MIC err is per MSDU, while PN is per MPDU.
  10367. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  10368. * with MIC err in A-MSDU case, so FW will send only one HTT message
  10369. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  10370. * instead of sending separate HTT messages for each wrong MSDU within
  10371. * the MPDU.
  10372. *
  10373. * |31 24|23 16|15 8|7 0|
  10374. * |----------------+----------------+----------------+----------------|
  10375. * | Rsvd | key_id | peer_id |
  10376. * |-------------------------------------------------------------------|
  10377. * | receiver MAC addr 31:0 |
  10378. * |-------------------------------------------------------------------|
  10379. * | Rsvd | receiver MAC addr 47:32 |
  10380. * |-------------------------------------------------------------------|
  10381. * | transmitter MAC addr 31:0 |
  10382. * |-------------------------------------------------------------------|
  10383. * | Rsvd | transmitter MAC addr 47:32 |
  10384. * |-------------------------------------------------------------------|
  10385. * | PN 31:0 |
  10386. * |-------------------------------------------------------------------|
  10387. * | Rsvd | PN 47:32 |
  10388. * |-------------------------------------------------------------------|
  10389. * - peer_id
  10390. * Bits 15:0
  10391. * Purpose: identifies which peer is frame is from
  10392. * value:
  10393. * - key_id
  10394. * Bits 23:16
  10395. * Purpose: identifies key_id of rx frame
  10396. * value:
  10397. * - RA_31_0 (receiver MAC addr 31:0)
  10398. * Bits 31:0
  10399. * Purpose: identifies by MAC address which vdev received the frame
  10400. * value: MAC address lower 4 bytes
  10401. * - RA_47_32 (receiver MAC addr 47:32)
  10402. * Bits 15:0
  10403. * Purpose: identifies by MAC address which vdev received the frame
  10404. * value: MAC address upper 2 bytes
  10405. * - TA_31_0 (transmitter MAC addr 31:0)
  10406. * Bits 31:0
  10407. * Purpose: identifies by MAC address which peer transmitted the frame
  10408. * value: MAC address lower 4 bytes
  10409. * - TA_47_32 (transmitter MAC addr 47:32)
  10410. * Bits 15:0
  10411. * Purpose: identifies by MAC address which peer transmitted the frame
  10412. * value: MAC address upper 2 bytes
  10413. * - PN_31_0
  10414. * Bits 31:0
  10415. * Purpose: Identifies pn of rx frame
  10416. * value: PN lower 4 bytes
  10417. * - PN_47_32
  10418. * Bits 15:0
  10419. * Purpose: Identifies pn of rx frame
  10420. * value:
  10421. * TKIP or CCMP: PN upper 2 bytes
  10422. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  10423. */
  10424. enum htt_rx_ofld_pkt_err_type {
  10425. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  10426. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  10427. };
  10428. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  10429. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  10430. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  10431. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  10432. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  10433. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  10434. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  10435. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  10436. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  10437. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  10438. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  10439. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  10440. do { \
  10441. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  10442. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  10443. } while (0)
  10444. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  10445. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  10446. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  10447. do { \
  10448. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  10449. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  10450. } while (0)
  10451. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  10452. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  10453. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  10454. do { \
  10455. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  10456. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  10457. } while (0)
  10458. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  10459. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  10460. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  10461. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  10462. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  10463. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  10464. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  10465. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  10466. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  10467. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  10468. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  10469. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  10470. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  10471. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  10472. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  10473. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  10474. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  10475. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  10476. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  10477. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  10478. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  10479. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  10480. do { \
  10481. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  10482. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  10483. } while (0)
  10484. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  10485. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  10486. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  10487. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  10488. do { \
  10489. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  10490. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  10491. } while (0)
  10492. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  10493. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  10494. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  10495. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  10496. do { \
  10497. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  10498. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  10499. } while (0)
  10500. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  10501. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  10502. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  10503. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  10504. do { \
  10505. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  10506. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  10507. } while (0)
  10508. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  10509. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  10510. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  10511. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  10512. do { \
  10513. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  10514. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  10515. } while (0)
  10516. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  10517. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  10518. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  10519. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  10520. do { \
  10521. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  10522. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  10523. } while (0)
  10524. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  10525. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  10526. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  10527. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  10528. do { \
  10529. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  10530. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  10531. } while (0)
  10532. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  10533. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  10534. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  10535. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  10536. do { \
  10537. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  10538. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  10539. } while (0)
  10540. /**
  10541. * @brief peer rate report message
  10542. *
  10543. * @details
  10544. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  10545. * justified rate of all the peers.
  10546. *
  10547. * |31 24|23 16|15 8|7 0|
  10548. * |----------------+----------------+----------------+----------------|
  10549. * | peer_count | | msg_type |
  10550. * |-------------------------------------------------------------------|
  10551. * : Payload (variant number of peer rate report) :
  10552. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  10553. * Header fields:
  10554. * - msg_type
  10555. * Bits 7:0
  10556. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  10557. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  10558. * - reserved
  10559. * Bits 15:8
  10560. * Purpose:
  10561. * value:
  10562. * - peer_count
  10563. * Bits 31:16
  10564. * Purpose: Specify how many peer rate report elements are present in the payload.
  10565. * value:
  10566. *
  10567. * Payload:
  10568. * There are variant number of peer rate report follow the first 32 bits.
  10569. * The peer rate report is defined as follows.
  10570. *
  10571. * |31 20|19 16|15 0|
  10572. * |-----------------------+---------+---------------------------------|-
  10573. * | reserved | phy | peer_id | \
  10574. * |-------------------------------------------------------------------| -> report #0
  10575. * | rate | /
  10576. * |-----------------------+---------+---------------------------------|-
  10577. * | reserved | phy | peer_id | \
  10578. * |-------------------------------------------------------------------| -> report #1
  10579. * | rate | /
  10580. * |-----------------------+---------+---------------------------------|-
  10581. * | reserved | phy | peer_id | \
  10582. * |-------------------------------------------------------------------| -> report #2
  10583. * | rate | /
  10584. * |-------------------------------------------------------------------|-
  10585. * : :
  10586. * : :
  10587. * : :
  10588. * :-------------------------------------------------------------------:
  10589. *
  10590. * - peer_id
  10591. * Bits 15:0
  10592. * Purpose: identify the peer
  10593. * value:
  10594. * - phy
  10595. * Bits 19:16
  10596. * Purpose: identify which phy is in use
  10597. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  10598. * Please see enum htt_peer_report_phy_type for detail.
  10599. * - reserved
  10600. * Bits 31:20
  10601. * Purpose:
  10602. * value:
  10603. * - rate
  10604. * Bits 31:0
  10605. * Purpose: represent the justified rate of the peer specified by peer_id
  10606. * value:
  10607. */
  10608. enum htt_peer_rate_report_phy_type {
  10609. HTT_PEER_RATE_REPORT_11B = 0,
  10610. HTT_PEER_RATE_REPORT_11A_G,
  10611. HTT_PEER_RATE_REPORT_11N,
  10612. HTT_PEER_RATE_REPORT_11AC,
  10613. };
  10614. #define HTT_PEER_RATE_REPORT_SIZE 8
  10615. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  10616. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  10617. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  10618. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  10619. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  10620. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  10621. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  10622. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  10623. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  10624. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  10625. do { \
  10626. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  10627. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  10628. } while (0)
  10629. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  10630. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  10631. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  10632. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  10633. do { \
  10634. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  10635. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  10636. } while (0)
  10637. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  10638. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  10639. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  10640. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  10641. do { \
  10642. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  10643. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  10644. } while (0)
  10645. /**
  10646. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_MAP Message
  10647. *
  10648. * @details
  10649. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  10650. * a flow of descriptors.
  10651. *
  10652. * This message is in TLV format and indicates the parameters to be setup a
  10653. * flow in the host. Each entry indicates that a particular flow ID is ready to
  10654. * receive descriptors from a specified pool.
  10655. *
  10656. * The message would appear as follows:
  10657. *
  10658. * |31 24|23 16|15 8|7 0|
  10659. * |----------------+----------------+----------------+----------------|
  10660. * header | reserved | num_flows | msg_type |
  10661. * |-------------------------------------------------------------------|
  10662. * | |
  10663. * : payload :
  10664. * | |
  10665. * |-------------------------------------------------------------------|
  10666. *
  10667. * The header field is one DWORD long and is interpreted as follows:
  10668. * b'0:7 - msg_type: This will be set to HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  10669. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  10670. * this message
  10671. * b'16-31 - reserved: These bits are reserved for future use
  10672. *
  10673. * Payload:
  10674. * The payload would contain multiple objects of the following structure. Each
  10675. * object represents a flow.
  10676. *
  10677. * |31 24|23 16|15 8|7 0|
  10678. * |----------------+----------------+----------------+----------------|
  10679. * header | reserved | num_flows | msg_type |
  10680. * |-------------------------------------------------------------------|
  10681. * payload0| flow_type |
  10682. * |-------------------------------------------------------------------|
  10683. * | flow_id |
  10684. * |-------------------------------------------------------------------|
  10685. * | reserved0 | flow_pool_id |
  10686. * |-------------------------------------------------------------------|
  10687. * | reserved1 | flow_pool_size |
  10688. * |-------------------------------------------------------------------|
  10689. * | reserved2 |
  10690. * |-------------------------------------------------------------------|
  10691. * payload1| flow_type |
  10692. * |-------------------------------------------------------------------|
  10693. * | flow_id |
  10694. * |-------------------------------------------------------------------|
  10695. * | reserved0 | flow_pool_id |
  10696. * |-------------------------------------------------------------------|
  10697. * | reserved1 | flow_pool_size |
  10698. * |-------------------------------------------------------------------|
  10699. * | reserved2 |
  10700. * |-------------------------------------------------------------------|
  10701. * | . |
  10702. * | . |
  10703. * | . |
  10704. * |-------------------------------------------------------------------|
  10705. *
  10706. * Each payload is 5 DWORDS long and is interpreted as follows:
  10707. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  10708. * this flow is associated. It can be VDEV, peer,
  10709. * or tid (AC). Based on enum htt_flow_type.
  10710. *
  10711. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  10712. * object. For flow_type vdev it is set to the
  10713. * vdevid, for peer it is peerid and for tid, it is
  10714. * tid_num.
  10715. *
  10716. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  10717. * in the host for this flow
  10718. * b'16:31 - reserved0: This field in reserved for the future. In case
  10719. * we have a hierarchical implementation (HCM) of
  10720. * pools, it can be used to indicate the ID of the
  10721. * parent-pool.
  10722. *
  10723. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  10724. * Descriptors for this flow will be
  10725. * allocated from this pool in the host.
  10726. * b'16:31 - reserved1: This field in reserved for the future. In case
  10727. * we have a hierarchical implementation of pools,
  10728. * it can be used to indicate the max number of
  10729. * descriptors in the pool. The b'0:15 can be used
  10730. * to indicate min number of descriptors in the
  10731. * HCM scheme.
  10732. *
  10733. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  10734. * we have a hierarchical implementation of pools,
  10735. * b'0:15 can be used to indicate the
  10736. * priority-based borrowing (PBB) threshold of
  10737. * the flow's pool. The b'16:31 are still left
  10738. * reserved.
  10739. */
  10740. enum htt_flow_type {
  10741. FLOW_TYPE_VDEV = 0,
  10742. /* Insert new flow types above this line */
  10743. };
  10744. PREPACK struct htt_flow_pool_map_payload_t {
  10745. A_UINT32 flow_type;
  10746. A_UINT32 flow_id;
  10747. A_UINT32 flow_pool_id:16,
  10748. reserved0:16;
  10749. A_UINT32 flow_pool_size:16,
  10750. reserved1:16;
  10751. A_UINT32 reserved2;
  10752. } POSTPACK;
  10753. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  10754. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  10755. (sizeof(struct htt_flow_pool_map_payload_t))
  10756. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  10757. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  10758. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  10759. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  10760. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  10761. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  10762. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  10763. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  10764. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  10765. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  10766. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  10767. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  10768. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  10769. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  10770. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  10771. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  10772. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  10773. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  10774. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  10775. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  10776. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  10777. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  10778. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  10779. do { \
  10780. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  10781. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  10782. } while (0)
  10783. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  10784. do { \
  10785. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  10786. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  10787. } while (0)
  10788. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  10789. do { \
  10790. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  10791. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  10792. } while (0)
  10793. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  10794. do { \
  10795. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  10796. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  10797. } while (0)
  10798. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  10799. do { \
  10800. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  10801. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  10802. } while (0)
  10803. /**
  10804. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP Message
  10805. *
  10806. * @details
  10807. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  10808. * down a flow of descriptors.
  10809. * This message indicates that for the flow (whose ID is provided) is wanting
  10810. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  10811. * pool of descriptors from where descriptors are being allocated for this
  10812. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  10813. * be unmapped by the host.
  10814. *
  10815. * The message would appear as follows:
  10816. *
  10817. * |31 24|23 16|15 8|7 0|
  10818. * |----------------+----------------+----------------+----------------|
  10819. * | reserved0 | msg_type |
  10820. * |-------------------------------------------------------------------|
  10821. * | flow_type |
  10822. * |-------------------------------------------------------------------|
  10823. * | flow_id |
  10824. * |-------------------------------------------------------------------|
  10825. * | reserved1 | flow_pool_id |
  10826. * |-------------------------------------------------------------------|
  10827. *
  10828. * The message is interpreted as follows:
  10829. * dword0 - b'0:7 - msg_type: This will be set to
  10830. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  10831. * b'8:31 - reserved0: Reserved for future use
  10832. *
  10833. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  10834. * this flow is associated. It can be VDEV, peer,
  10835. * or tid (AC). Based on enum htt_flow_type.
  10836. *
  10837. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  10838. * object. For flow_type vdev it is set to the
  10839. * vdevid, for peer it is peerid and for tid, it is
  10840. * tid_num.
  10841. *
  10842. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  10843. * used in the host for this flow
  10844. * b'16:31 - reserved0: This field in reserved for the future.
  10845. *
  10846. */
  10847. PREPACK struct htt_flow_pool_unmap_t {
  10848. A_UINT32 msg_type:8,
  10849. reserved0:24;
  10850. A_UINT32 flow_type;
  10851. A_UINT32 flow_id;
  10852. A_UINT32 flow_pool_id:16,
  10853. reserved1:16;
  10854. } POSTPACK;
  10855. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  10856. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  10857. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  10858. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  10859. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  10860. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  10861. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  10862. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  10863. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  10864. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  10865. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  10866. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  10867. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  10868. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  10869. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  10870. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  10871. do { \
  10872. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  10873. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  10874. } while (0)
  10875. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  10876. do { \
  10877. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  10878. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  10879. } while (0)
  10880. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  10881. do { \
  10882. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  10883. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  10884. } while (0)
  10885. /**
  10886. * @brief HTT_T2H_MSG_TYPE_SRING_SETUP_DONE Message
  10887. *
  10888. * @details
  10889. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  10890. * SRNG ring setup is done
  10891. *
  10892. * This message indicates whether the last setup operation is successful.
  10893. * It will be sent to host when host set respose_required bit in
  10894. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  10895. * The message would appear as follows:
  10896. *
  10897. * |31 24|23 16|15 8|7 0|
  10898. * |--------------- +----------------+----------------+----------------|
  10899. * | setup_status | ring_id | pdev_id | msg_type |
  10900. * |-------------------------------------------------------------------|
  10901. *
  10902. * The message is interpreted as follows:
  10903. * dword0 - b'0:7 - msg_type: This will be set to
  10904. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  10905. * b'8:15 - pdev_id:
  10906. * 0 (for rings at SOC/UMAC level),
  10907. * 1/2/3 mac id (for rings at LMAC level)
  10908. * b'16:23 - ring_id: Identify the ring which is set up
  10909. * More details can be got from enum htt_srng_ring_id
  10910. * b'24:31 - setup_status: Indicate status of setup operation
  10911. * Refer to htt_ring_setup_status
  10912. */
  10913. PREPACK struct htt_sring_setup_done_t {
  10914. A_UINT32 msg_type: 8,
  10915. pdev_id: 8,
  10916. ring_id: 8,
  10917. setup_status: 8;
  10918. } POSTPACK;
  10919. enum htt_ring_setup_status {
  10920. htt_ring_setup_status_ok = 0,
  10921. htt_ring_setup_status_error,
  10922. };
  10923. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  10924. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  10925. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  10926. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  10927. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  10928. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  10929. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  10930. do { \
  10931. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  10932. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  10933. } while (0)
  10934. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  10935. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  10936. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  10937. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  10938. HTT_SRING_SETUP_DONE_RING_ID_S)
  10939. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  10940. do { \
  10941. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  10942. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  10943. } while (0)
  10944. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  10945. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  10946. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  10947. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  10948. HTT_SRING_SETUP_DONE_STATUS_S)
  10949. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  10950. do { \
  10951. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  10952. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  10953. } while (0)
  10954. /**
  10955. * @brief HTT_T2H_MSG_TYPE_MAP_FLOW_INFO Message
  10956. *
  10957. * @details
  10958. * HTT TX map flow entry with tqm flow pointer
  10959. * Sent from firmware to host to add tqm flow pointer in corresponding
  10960. * flow search entry. Flow metadata is replayed back to host as part of this
  10961. * struct to enable host to find the specific flow search entry
  10962. *
  10963. * The message would appear as follows:
  10964. *
  10965. * |31 28|27 18|17 14|13 8|7 0|
  10966. * |-------+------------------------------------------+----------------|
  10967. * | rsvd0 | fse_hsh_idx | msg_type |
  10968. * |-------------------------------------------------------------------|
  10969. * | rsvd1 | tid | peer_id |
  10970. * |-------------------------------------------------------------------|
  10971. * | tqm_flow_pntr_lo |
  10972. * |-------------------------------------------------------------------|
  10973. * | tqm_flow_pntr_hi |
  10974. * |-------------------------------------------------------------------|
  10975. * | fse_meta_data |
  10976. * |-------------------------------------------------------------------|
  10977. *
  10978. * The message is interpreted as follows:
  10979. *
  10980. * dword0 - b'0:7 - msg_type: This will be set to
  10981. * HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  10982. *
  10983. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  10984. * for this flow entry
  10985. *
  10986. * dword0 - b'28:31 - rsvd0: Reserved for future use
  10987. *
  10988. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  10989. *
  10990. * dword1 - b'14:17 - tid
  10991. *
  10992. * dword1 - b'18:31 - rsvd1: Reserved for future use
  10993. *
  10994. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  10995. *
  10996. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  10997. *
  10998. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  10999. * given by host
  11000. */
  11001. PREPACK struct htt_tx_map_flow_info {
  11002. A_UINT32
  11003. msg_type: 8,
  11004. fse_hsh_idx: 20,
  11005. rsvd0: 4;
  11006. A_UINT32
  11007. peer_id: 14,
  11008. tid: 4,
  11009. rsvd1: 14;
  11010. A_UINT32 tqm_flow_pntr_lo;
  11011. A_UINT32 tqm_flow_pntr_hi;
  11012. struct htt_tx_flow_metadata fse_meta_data;
  11013. } POSTPACK;
  11014. /* DWORD 0 */
  11015. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  11016. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  11017. /* DWORD 1 */
  11018. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  11019. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  11020. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  11021. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  11022. /* DWORD 0 */
  11023. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  11024. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  11025. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  11026. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  11027. do { \
  11028. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  11029. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  11030. } while (0)
  11031. /* DWORD 1 */
  11032. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  11033. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  11034. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  11035. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  11036. do { \
  11037. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  11038. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  11039. } while (0)
  11040. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  11041. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  11042. HTT_TX_MAP_FLOW_INFO_TID_S)
  11043. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  11044. do { \
  11045. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  11046. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  11047. } while (0)
  11048. /*
  11049. * htt_dbg_ext_stats_status -
  11050. * present - The requested stats have been delivered in full.
  11051. * This indicates that either the stats information was contained
  11052. * in its entirety within this message, or else this message
  11053. * completes the delivery of the requested stats info that was
  11054. * partially delivered through earlier STATS_CONF messages.
  11055. * partial - The requested stats have been delivered in part.
  11056. * One or more subsequent STATS_CONF messages with the same
  11057. * cookie value will be sent to deliver the remainder of the
  11058. * information.
  11059. * error - The requested stats could not be delivered, for example due
  11060. * to a shortage of memory to construct a message holding the
  11061. * requested stats.
  11062. * invalid - The requested stat type is either not recognized, or the
  11063. * target is configured to not gather the stats type in question.
  11064. */
  11065. enum htt_dbg_ext_stats_status {
  11066. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  11067. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  11068. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  11069. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  11070. };
  11071. /**
  11072. * @brief target -> host ppdu stats upload
  11073. *
  11074. * @details
  11075. * The following field definitions describe the format of the HTT target
  11076. * to host ppdu stats indication message.
  11077. *
  11078. *
  11079. * |31 16|15 12|11 10|9 8|7 0 |
  11080. * |----------------------------------------------------------------------|
  11081. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  11082. * |----------------------------------------------------------------------|
  11083. * | ppdu_id |
  11084. * |----------------------------------------------------------------------|
  11085. * | Timestamp in us |
  11086. * |----------------------------------------------------------------------|
  11087. * | reserved |
  11088. * |----------------------------------------------------------------------|
  11089. * | type-specific stats info |
  11090. * | (see htt_ppdu_stats.h) |
  11091. * |----------------------------------------------------------------------|
  11092. * Header fields:
  11093. * - MSG_TYPE
  11094. * Bits 7:0
  11095. * Purpose: Identifies this is a PPDU STATS indication
  11096. * message.
  11097. * Value: 0x1d
  11098. * - mac_id
  11099. * Bits 9:8
  11100. * Purpose: mac_id of this ppdu_id
  11101. * Value: 0-3
  11102. * - pdev_id
  11103. * Bits 11:10
  11104. * Purpose: pdev_id of this ppdu_id
  11105. * Value: 0-3
  11106. * 0 (for rings at SOC level),
  11107. * 1/2/3 PDEV -> 0/1/2
  11108. * - payload_size
  11109. * Bits 31:16
  11110. * Purpose: total tlv size
  11111. * Value: payload_size in bytes
  11112. */
  11113. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  11114. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  11115. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  11116. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  11117. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  11118. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  11119. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  11120. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  11121. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  11122. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  11123. do { \
  11124. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  11125. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  11126. } while (0)
  11127. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  11128. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  11129. HTT_T2H_PPDU_STATS_MAC_ID_S)
  11130. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  11131. do { \
  11132. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  11133. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  11134. } while (0)
  11135. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  11136. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  11137. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  11138. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  11139. do { \
  11140. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  11141. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  11142. } while (0)
  11143. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  11144. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  11145. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  11146. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  11147. do { \
  11148. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  11149. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  11150. } while (0)
  11151. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  11152. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  11153. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  11154. /* htt_t2h_ppdu_stats_ind_hdr_t
  11155. * This struct contains the fields within the header of the
  11156. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  11157. * stats info.
  11158. * This struct assumes little-endian layout, and thus is only
  11159. * suitable for use within processors known to be little-endian
  11160. * (such as the target).
  11161. * In contrast, the above macros provide endian-portable methods
  11162. * to get and set the bitfields within this PPDU_STATS_IND header.
  11163. */
  11164. typedef struct {
  11165. A_UINT32 msg_type: 8, /* bits 7:0 */
  11166. mac_id: 2, /* bits 9:8 */
  11167. pdev_id: 2, /* bits 11:10 */
  11168. reserved1: 4, /* bits 15:12 */
  11169. payload_size: 16; /* bits 31:16 */
  11170. A_UINT32 ppdu_id;
  11171. A_UINT32 timestamp_us;
  11172. A_UINT32 reserved2;
  11173. } htt_t2h_ppdu_stats_ind_hdr_t;
  11174. /**
  11175. * @brief target -> host extended statistics upload
  11176. *
  11177. * @details
  11178. * The following field definitions describe the format of the HTT target
  11179. * to host stats upload confirmation message.
  11180. * The message contains a cookie echoed from the HTT host->target stats
  11181. * upload request, which identifies which request the confirmation is
  11182. * for, and a single stats can span over multiple HTT stats indication
  11183. * due to the HTT message size limitation so every HTT ext stats indication
  11184. * will have tag-length-value stats information elements.
  11185. * The tag-length header for each HTT stats IND message also includes a
  11186. * status field, to indicate whether the request for the stat type in
  11187. * question was fully met, partially met, unable to be met, or invalid
  11188. * (if the stat type in question is disabled in the target).
  11189. * A Done bit 1's indicate the end of the of stats info elements.
  11190. *
  11191. *
  11192. * |31 16|15 12|11|10 8|7 5|4 0|
  11193. * |--------------------------------------------------------------|
  11194. * | reserved | msg type |
  11195. * |--------------------------------------------------------------|
  11196. * | cookie LSBs |
  11197. * |--------------------------------------------------------------|
  11198. * | cookie MSBs |
  11199. * |--------------------------------------------------------------|
  11200. * | stats entry length | rsvd | D| S | stat type |
  11201. * |--------------------------------------------------------------|
  11202. * | type-specific stats info |
  11203. * | (see htt_stats.h) |
  11204. * |--------------------------------------------------------------|
  11205. * Header fields:
  11206. * - MSG_TYPE
  11207. * Bits 7:0
  11208. * Purpose: Identifies this is a extended statistics upload confirmation
  11209. * message.
  11210. * Value: 0x1c
  11211. * - COOKIE_LSBS
  11212. * Bits 31:0
  11213. * Purpose: Provide a mechanism to match a target->host stats confirmation
  11214. * message with its preceding host->target stats request message.
  11215. * Value: LSBs of the opaque cookie specified by the host-side requestor
  11216. * - COOKIE_MSBS
  11217. * Bits 31:0
  11218. * Purpose: Provide a mechanism to match a target->host stats confirmation
  11219. * message with its preceding host->target stats request message.
  11220. * Value: MSBs of the opaque cookie specified by the host-side requestor
  11221. *
  11222. * Stats Information Element tag-length header fields:
  11223. * - STAT_TYPE
  11224. * Bits 7:0
  11225. * Purpose: identifies the type of statistics info held in the
  11226. * following information element
  11227. * Value: htt_dbg_ext_stats_type
  11228. * - STATUS
  11229. * Bits 10:8
  11230. * Purpose: indicate whether the requested stats are present
  11231. * Value: htt_dbg_ext_stats_status
  11232. * - DONE
  11233. * Bits 11
  11234. * Purpose:
  11235. * Indicates the completion of the stats entry, this will be the last
  11236. * stats conf HTT segment for the requested stats type.
  11237. * Value:
  11238. * 0 -> the stats retrieval is ongoing
  11239. * 1 -> the stats retrieval is complete
  11240. * - LENGTH
  11241. * Bits 31:16
  11242. * Purpose: indicate the stats information size
  11243. * Value: This field specifies the number of bytes of stats information
  11244. * that follows the element tag-length header.
  11245. * It is expected but not required that this length is a multiple of
  11246. * 4 bytes.
  11247. */
  11248. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  11249. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  11250. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  11251. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  11252. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  11253. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  11254. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  11255. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  11256. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  11257. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  11258. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  11259. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  11260. do { \
  11261. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  11262. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  11263. } while (0)
  11264. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  11265. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  11266. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  11267. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  11268. do { \
  11269. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  11270. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  11271. } while (0)
  11272. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  11273. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  11274. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  11275. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  11276. do { \
  11277. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  11278. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  11279. } while (0)
  11280. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  11281. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  11282. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  11283. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  11284. do { \
  11285. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  11286. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  11287. } while (0)
  11288. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  11289. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  11290. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  11291. typedef enum {
  11292. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  11293. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  11294. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  11295. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  11296. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  11297. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  11298. /* Reserved from 128 - 255 for target internal use.*/
  11299. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  11300. } HTT_PEER_TYPE;
  11301. /** 2 word representation of MAC addr */
  11302. typedef struct {
  11303. /** upper 4 bytes of MAC address */
  11304. A_UINT32 mac_addr31to0;
  11305. /** lower 2 bytes of MAC address */
  11306. A_UINT32 mac_addr47to32;
  11307. } htt_mac_addr;
  11308. /** macro to convert MAC address from char array to HTT word format */
  11309. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  11310. (phtt_mac_addr)->mac_addr31to0 = \
  11311. (((c_macaddr)[0] << 0) | \
  11312. ((c_macaddr)[1] << 8) | \
  11313. ((c_macaddr)[2] << 16) | \
  11314. ((c_macaddr)[3] << 24)); \
  11315. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  11316. } while (0)
  11317. /**
  11318. * @brief target -> host monitor mac header indication message
  11319. *
  11320. * @details
  11321. * The following diagram shows the format of the monitor mac header message
  11322. * sent from the target to the host.
  11323. * This message is primarily sent when promiscuous rx mode is enabled.
  11324. * One message is sent per rx PPDU.
  11325. *
  11326. * |31 24|23 16|15 8|7 0|
  11327. * |-------------------------------------------------------------|
  11328. * | peer_id | reserved0 | msg_type |
  11329. * |-------------------------------------------------------------|
  11330. * | reserved1 | num_mpdu |
  11331. * |-------------------------------------------------------------|
  11332. * | struct hw_rx_desc |
  11333. * | (see wal_rx_desc.h) |
  11334. * |-------------------------------------------------------------|
  11335. * | struct ieee80211_frame_addr4 |
  11336. * | (see ieee80211_defs.h) |
  11337. * |-------------------------------------------------------------|
  11338. * | struct ieee80211_frame_addr4 |
  11339. * | (see ieee80211_defs.h) |
  11340. * |-------------------------------------------------------------|
  11341. * | ...... |
  11342. * |-------------------------------------------------------------|
  11343. *
  11344. * Header fields:
  11345. * - msg_type
  11346. * Bits 7:0
  11347. * Purpose: Identifies this is a monitor mac header indication message.
  11348. * Value: 0x20
  11349. * - peer_id
  11350. * Bits 31:16
  11351. * Purpose: Software peer id given by host during association,
  11352. * During promiscuous mode, the peer ID will be invalid (0xFF)
  11353. * for rx PPDUs received from unassociated peers.
  11354. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  11355. * - num_mpdu
  11356. * Bits 15:0
  11357. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  11358. * delivered within the message.
  11359. * Value: 1 to 32
  11360. * num_mpdu is limited to a maximum value of 32, due to buffer
  11361. * size limits. For PPDUs with more than 32 MPDUs, only the
  11362. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  11363. * the PPDU will be provided.
  11364. */
  11365. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  11366. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  11367. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  11368. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  11369. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  11370. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  11371. do { \
  11372. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  11373. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  11374. } while (0)
  11375. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  11376. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  11377. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  11378. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  11379. do { \
  11380. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  11381. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  11382. } while (0)
  11383. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  11384. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  11385. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  11386. /**
  11387. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE Message
  11388. *
  11389. * @details
  11390. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  11391. * the flow pool associated with the specified ID is resized
  11392. *
  11393. * The message would appear as follows:
  11394. *
  11395. * |31 16|15 8|7 0|
  11396. * |---------------------------------+----------------+----------------|
  11397. * | reserved0 | Msg type |
  11398. * |-------------------------------------------------------------------|
  11399. * | flow pool new size | flow pool ID |
  11400. * |-------------------------------------------------------------------|
  11401. *
  11402. * The message is interpreted as follows:
  11403. * b'0:7 - msg_type: This will be set to
  11404. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  11405. *
  11406. * b'0:15 - flow pool ID: Existing flow pool ID
  11407. *
  11408. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  11409. *
  11410. */
  11411. PREPACK struct htt_flow_pool_resize_t {
  11412. A_UINT32 msg_type:8,
  11413. reserved0:24;
  11414. A_UINT32 flow_pool_id:16,
  11415. flow_pool_new_size:16;
  11416. } POSTPACK;
  11417. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  11418. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  11419. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  11420. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  11421. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  11422. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  11423. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  11424. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  11425. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  11426. do { \
  11427. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  11428. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  11429. } while (0)
  11430. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  11431. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  11432. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  11433. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  11434. do { \
  11435. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  11436. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  11437. } while (0)
  11438. /**
  11439. * @brief host -> target channel change message
  11440. *
  11441. * @details
  11442. * the meesage is generated by FW every time FW changes channel. This will be used by host mainly
  11443. * to associate RX frames to correct channel they were received on.
  11444. * The following field definitions describe the format of the HTT target
  11445. * to host channel change message.
  11446. * |31 16|15 8|7 5|4 0|
  11447. * |------------------------------------------------------------|
  11448. * | reserved | MSG_TYPE |
  11449. * |------------------------------------------------------------|
  11450. * | CHAN_MHZ |
  11451. * |------------------------------------------------------------|
  11452. * | BAND_CENTER_FREQ1 |
  11453. * |------------------------------------------------------------|
  11454. * | BAND_CENTER_FREQ2 |
  11455. * |------------------------------------------------------------|
  11456. * | CHAN_PHY_MODE |
  11457. * |------------------------------------------------------------|
  11458. * Header fields:
  11459. * - MSG_TYPE
  11460. * Bits 7:0
  11461. * Value: 0xf
  11462. * - CHAN_MHZ
  11463. * Bits 31:0
  11464. * Purpose: frequency of the primary 20mhz channel.
  11465. * - BAND_CENTER_FREQ1
  11466. * Bits 31:0
  11467. * Purpose: centre frequency of the full channel.
  11468. * - BAND_CENTER_FREQ2
  11469. * Bits 31:0
  11470. * Purpose: centre frequency2 of the channel. is only valid for 11acvht 80plus80.
  11471. * - CHAN_PHY_MODE
  11472. * Bits 31:0
  11473. * Purpose: phy mode of the channel.
  11474. */
  11475. PREPACK struct htt_chan_change_msg {
  11476. A_UINT32 chan_mhz; /* frequency in mhz */
  11477. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz*/
  11478. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  11479. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  11480. } POSTPACK;
  11481. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  11482. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  11483. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  11484. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  11485. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  11486. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  11487. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  11488. /*
  11489. * The read and write indices point to the data within the host buffer.
  11490. * Because the first 4 bytes of the host buffer is used for the read index and
  11491. * the next 4 bytes for the write index, the data itself starts at offset 8.
  11492. * The read index and write index are the byte offsets from the base of the
  11493. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  11494. * Refer the ASCII text picture below.
  11495. */
  11496. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  11497. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  11498. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  11499. /*
  11500. ***************************************************************************
  11501. *
  11502. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  11503. *
  11504. ***************************************************************************
  11505. *
  11506. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  11507. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  11508. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  11509. * written into the Host memory region mentioned below.
  11510. *
  11511. * Read index is updated by the Host. At any point of time, the read index will
  11512. * indicate the index that will next be read by the Host. The read index is
  11513. * in units of bytes offset from the base of the meta-data buffer.
  11514. *
  11515. * Write index is updated by the FW. At any point of time, the write index will
  11516. * indicate from where the FW can start writing any new data. The write index is
  11517. * in units of bytes offset from the base of the meta-data buffer.
  11518. *
  11519. * If the Host is not fast enough in reading the CFR data, any new capture data
  11520. * would be dropped if there is no space left to write the new captures.
  11521. *
  11522. * The last 4 bytes of the memory region will have the magic pattern
  11523. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  11524. * not overrun the host buffer.
  11525. *
  11526. * ,--------------------. read and write indices store the
  11527. * | | byte offset from the base of the
  11528. * | ,--------+--------. meta-data buffer to the next
  11529. * | | | | location within the data buffer
  11530. * | | v v that will be read / written
  11531. * ************************************************************************
  11532. * * Read * Write * * Magic *
  11533. * * index * index * CFR data1 ...... CFR data N * pattern *
  11534. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  11535. * ************************************************************************
  11536. * |<---------- data buffer ---------->|
  11537. *
  11538. * |<----------------- meta-data buffer allocated in Host ----------------|
  11539. *
  11540. * Note:
  11541. * - Considering the 4 bytes needed to store the Read index (R) and the
  11542. * Write index (W), the initial value is as follows:
  11543. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  11544. * - Buffer empty condition:
  11545. * R = W
  11546. *
  11547. * Regarding CFR data format:
  11548. * --------------------------
  11549. *
  11550. * Each CFR tone is stored in HW as 16-bits with the following format:
  11551. * {bits[15:12], bits[11:6], bits[5:0]} =
  11552. * {unsigned exponent (4 bits),
  11553. * signed mantissa_real (6 bits),
  11554. * signed mantissa_imag (6 bits)}
  11555. *
  11556. * CFR_real = mantissa_real * 2^(exponent-5)
  11557. * CFR_imag = mantissa_imag * 2^(exponent-5)
  11558. *
  11559. *
  11560. * The CFR data is written to the 16-bit unsigned output array (buff) in
  11561. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  11562. *
  11563. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  11564. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  11565. * .
  11566. * .
  11567. * .
  11568. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  11569. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  11570. */
  11571. /* Bandwidth of peer CFR captures */
  11572. typedef enum {
  11573. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  11574. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  11575. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  11576. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  11577. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  11578. HTT_PEER_CFR_CAPTURE_BW_MAX,
  11579. } HTT_PEER_CFR_CAPTURE_BW;
  11580. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  11581. * was captured
  11582. */
  11583. typedef enum {
  11584. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  11585. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  11586. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  11587. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  11588. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  11589. } HTT_PEER_CFR_CAPTURE_MODE;
  11590. typedef enum {
  11591. /* This message type is currently used for the below purpose:
  11592. *
  11593. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  11594. * wmi_peer_cfr_capture_cmd.
  11595. * If payload_present bit is set to 0 then the associated memory region
  11596. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  11597. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  11598. * message; the CFR dump will be present at the end of the message,
  11599. * after the chan_phy_mode.
  11600. */
  11601. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  11602. /* Always keep this last */
  11603. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  11604. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  11605. /**
  11606. * @brief target -> host CFR dump completion indication message definition
  11607. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  11608. *
  11609. * @details
  11610. * The following diagram shows the format of the Channel Frequency Response
  11611. * (CFR) dump completion indication. This inidcation is sent to the Host when
  11612. * the channel capture of a peer is copied by Firmware into the Host memory
  11613. *
  11614. * **************************************************************************
  11615. *
  11616. * Message format when the CFR capture message type is
  11617. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  11618. *
  11619. * **************************************************************************
  11620. *
  11621. * |31 16|15 |8|7 0|
  11622. * |----------------------------------------------------------------|
  11623. * header: | reserved |P| msg_type |
  11624. * word 0 | | | |
  11625. * |----------------------------------------------------------------|
  11626. * payload: | cfr_capture_msg_type |
  11627. * word 1 | |
  11628. * |----------------------------------------------------------------|
  11629. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  11630. * word 2 | | | | | | | | |
  11631. * |----------------------------------------------------------------|
  11632. * | mac_addr31to0 |
  11633. * word 3 | |
  11634. * |----------------------------------------------------------------|
  11635. * | unused / reserved | mac_addr47to32 |
  11636. * word 4 | | |
  11637. * |----------------------------------------------------------------|
  11638. * | index |
  11639. * word 5 | |
  11640. * |----------------------------------------------------------------|
  11641. * | length |
  11642. * word 6 | |
  11643. * |----------------------------------------------------------------|
  11644. * | timestamp |
  11645. * word 7 | |
  11646. * |----------------------------------------------------------------|
  11647. * | counter |
  11648. * word 8 | |
  11649. * |----------------------------------------------------------------|
  11650. * | chan_mhz |
  11651. * word 9 | |
  11652. * |----------------------------------------------------------------|
  11653. * | band_center_freq1 |
  11654. * word 10 | |
  11655. * |----------------------------------------------------------------|
  11656. * | band_center_freq2 |
  11657. * word 11 | |
  11658. * |----------------------------------------------------------------|
  11659. * | chan_phy_mode |
  11660. * word 12 | |
  11661. * |----------------------------------------------------------------|
  11662. * where,
  11663. * P - payload present bit (payload_present explained below)
  11664. * req_id - memory request id (mem_req_id explained below)
  11665. * S - status field (status explained below)
  11666. * capbw - capture bandwidth (capture_bw explained below)
  11667. * mode - mode of capture (mode explained below)
  11668. * sts - space time streams (sts_count explained below)
  11669. * chbw - channel bandwidth (channel_bw explained below)
  11670. * captype - capture type (cap_type explained below)
  11671. *
  11672. * The following field definitions describe the format of the CFR dump
  11673. * completion indication sent from the target to the host
  11674. *
  11675. * Header fields:
  11676. *
  11677. * Word 0
  11678. * - msg_type
  11679. * Bits 7:0
  11680. * Purpose: Identifies this as CFR TX completion indication
  11681. * Value: HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  11682. * - payload_present
  11683. * Bit 8
  11684. * Purpose: Identifies how CFR data is sent to host
  11685. * Value: 0 - If CFR Payload is written to host memory
  11686. * 1 - If CFR Payload is sent as part of HTT message
  11687. * (This is the requirement for SDIO/USB where it is
  11688. * not possible to write CFR data to host memory)
  11689. * - reserved
  11690. * Bits 31:9
  11691. * Purpose: Reserved
  11692. * Value: 0
  11693. *
  11694. * Payload fields:
  11695. *
  11696. * Word 1
  11697. * - cfr_capture_msg_type
  11698. * Bits 31:0
  11699. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  11700. * to specify the format used for the remainder of the message
  11701. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  11702. * (currently only MSG_TYPE_1 is defined)
  11703. *
  11704. * Word 2
  11705. * - mem_req_id
  11706. * Bits 6:0
  11707. * Purpose: Contain the mem request id of the region where the CFR capture
  11708. * has been stored - of type WMI_HOST_MEM_REQ_ID
  11709. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  11710. this value is invalid)
  11711. * - status
  11712. * Bit 7
  11713. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  11714. * Value: 1 (True) - Successful; 0 (False) - Not successful
  11715. * - capture_bw
  11716. * Bits 10:8
  11717. * Purpose: Carry the bandwidth of the CFR capture
  11718. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  11719. * - mode
  11720. * Bits 13:11
  11721. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  11722. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  11723. * - sts_count
  11724. * Bits 16:14
  11725. * Purpose: Carry the number of space time streams
  11726. * Value: Number of space time streams
  11727. * - channel_bw
  11728. * Bits 19:17
  11729. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  11730. * measurement
  11731. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  11732. * - cap_type
  11733. * Bits 23:20
  11734. * Purpose: Carry the type of the capture
  11735. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  11736. * - vdev_id
  11737. * Bits 31:24
  11738. * Purpose: Carry the virtual device id
  11739. * Value: vdev ID
  11740. *
  11741. * Word 3
  11742. * - mac_addr31to0
  11743. * Bits 31:0
  11744. * Purpose: Contain the bits 31:0 of the peer MAC address
  11745. * Value: Bits 31:0 of the peer MAC address
  11746. *
  11747. * Word 4
  11748. * - mac_addr47to32
  11749. * Bits 15:0
  11750. * Purpose: Contain the bits 47:32 of the peer MAC address
  11751. * Value: Bits 47:32 of the peer MAC address
  11752. *
  11753. * Word 5
  11754. * - index
  11755. * Bits 31:0
  11756. * Purpose: Contain the index at which this CFR dump was written in the Host
  11757. * allocated memory. This index is the number of bytes from the base address.
  11758. * Value: Index position
  11759. *
  11760. * Word 6
  11761. * - length
  11762. * Bits 31:0
  11763. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  11764. * Value: Length of the CFR capture of the peer
  11765. *
  11766. * Word 7
  11767. * - timestamp
  11768. * Bits 31:0
  11769. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  11770. * clock used for this timestamp is private to the target and not visible to
  11771. * the host i.e., Host can interpret only the relative timestamp deltas from
  11772. * one message to the next, but can't interpret the absolute timestamp from a
  11773. * single message.
  11774. * Value: Timestamp in microseconds
  11775. *
  11776. * Word 8
  11777. * - counter
  11778. * Bits 31:0
  11779. * Purpose: Carry the count of the current CFR capture from FW. This is
  11780. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  11781. * in host memory)
  11782. * Value: Count of the current CFR capture
  11783. *
  11784. * Word 9
  11785. * - chan_mhz
  11786. * Bits 31:0
  11787. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  11788. * Value: Primary 20 channel frequency
  11789. *
  11790. * Word 10
  11791. * - band_center_freq1
  11792. * Bits 31:0
  11793. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  11794. * Value: Center frequency 1 in MHz
  11795. *
  11796. * Word 11
  11797. * - band_center_freq2
  11798. * Bits 31:0
  11799. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  11800. * the VDEV
  11801. * 80plus80 mode
  11802. * Value: Center frequency 2 in MHz
  11803. *
  11804. * Word 12
  11805. * - chan_phy_mode
  11806. * Bits 31:0
  11807. * Purpose: Carry the phy mode of the channel, of the VDEV
  11808. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  11809. */
  11810. PREPACK struct htt_cfr_dump_ind_type_1 {
  11811. A_UINT32 mem_req_id:7,
  11812. status:1,
  11813. capture_bw:3,
  11814. mode:3,
  11815. sts_count:3,
  11816. channel_bw:3,
  11817. cap_type:4,
  11818. vdev_id:8;
  11819. htt_mac_addr addr;
  11820. A_UINT32 index;
  11821. A_UINT32 length;
  11822. A_UINT32 timestamp;
  11823. A_UINT32 counter;
  11824. struct htt_chan_change_msg chan;
  11825. } POSTPACK;
  11826. PREPACK struct htt_cfr_dump_compl_ind {
  11827. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  11828. union {
  11829. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  11830. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  11831. /* If there is a need to change the memory layout and its associated
  11832. * HTT indication format, a new CFR capture message type can be
  11833. * introduced and added into this union.
  11834. */
  11835. };
  11836. } POSTPACK;
  11837. /*
  11838. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  11839. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  11840. */
  11841. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  11842. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  11843. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  11844. do { \
  11845. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  11846. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  11847. } while(0)
  11848. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  11849. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  11850. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  11851. /*
  11852. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  11853. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  11854. */
  11855. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  11856. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  11857. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  11858. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  11859. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  11860. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  11861. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  11862. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  11863. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  11864. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  11865. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  11866. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  11867. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  11868. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  11869. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  11870. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  11871. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  11872. do { \
  11873. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  11874. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  11875. } while (0)
  11876. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  11877. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  11878. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  11879. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  11880. do { \
  11881. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  11882. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  11883. } while (0)
  11884. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  11885. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  11886. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  11887. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  11888. do { \
  11889. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  11890. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  11891. } while (0)
  11892. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  11893. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  11894. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  11895. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  11896. do { \
  11897. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  11898. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  11899. } while (0)
  11900. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  11901. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  11902. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  11903. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  11904. do { \
  11905. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  11906. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  11907. } while (0)
  11908. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  11909. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  11910. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  11911. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  11912. do { \
  11913. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  11914. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  11915. } while (0)
  11916. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  11917. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  11918. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  11919. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  11920. do { \
  11921. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  11922. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  11923. } while (0)
  11924. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  11925. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  11926. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  11927. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  11928. do { \
  11929. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  11930. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  11931. } while (0)
  11932. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  11933. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  11934. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  11935. /**
  11936. * @brief target -> host peer (PPDU) stats message
  11937. * HTT_T2H_MSG_TYPE_PEER_STATS_IND
  11938. * @details
  11939. * This message is generated by FW when FW is sending stats to host
  11940. * about one or more PPDUs that the FW has transmitted to one or more peers.
  11941. * This message is sent autonomously by the target rather than upon request
  11942. * by the host.
  11943. * The following field definitions describe the format of the HTT target
  11944. * to host peer stats indication message.
  11945. *
  11946. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  11947. * or more PPDU stats records.
  11948. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  11949. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  11950. * then the message would start with the
  11951. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  11952. * below.
  11953. *
  11954. * |31 16|15|14|13 11|10 9|8|7 0|
  11955. * |-------------------------------------------------------------|
  11956. * | reserved |MSG_TYPE |
  11957. * |-------------------------------------------------------------|
  11958. * rec 0 | TLV header |
  11959. * rec 0 |-------------------------------------------------------------|
  11960. * rec 0 | ppdu successful bytes |
  11961. * rec 0 |-------------------------------------------------------------|
  11962. * rec 0 | ppdu retry bytes |
  11963. * rec 0 |-------------------------------------------------------------|
  11964. * rec 0 | ppdu failed bytes |
  11965. * rec 0 |-------------------------------------------------------------|
  11966. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  11967. * rec 0 |-------------------------------------------------------------|
  11968. * rec 0 | retried MSDUs | successful MSDUs |
  11969. * rec 0 |-------------------------------------------------------------|
  11970. * rec 0 | TX duration | failed MSDUs |
  11971. * rec 0 |-------------------------------------------------------------|
  11972. * ...
  11973. * |-------------------------------------------------------------|
  11974. * rec N | TLV header |
  11975. * rec N |-------------------------------------------------------------|
  11976. * rec N | ppdu successful bytes |
  11977. * rec N |-------------------------------------------------------------|
  11978. * rec N | ppdu retry bytes |
  11979. * rec N |-------------------------------------------------------------|
  11980. * rec N | ppdu failed bytes |
  11981. * rec N |-------------------------------------------------------------|
  11982. * rec N | peer id | S|SG| BW | BA |A|rate code|
  11983. * rec N |-------------------------------------------------------------|
  11984. * rec N | retried MSDUs | successful MSDUs |
  11985. * rec N |-------------------------------------------------------------|
  11986. * rec N | TX duration | failed MSDUs |
  11987. * rec N |-------------------------------------------------------------|
  11988. *
  11989. * where:
  11990. * A = is A-MPDU flag
  11991. * BA = block-ack failure flags
  11992. * BW = bandwidth spec
  11993. * SG = SGI enabled spec
  11994. * S = skipped rate ctrl
  11995. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  11996. *
  11997. * Header
  11998. * ------
  11999. * dword0 - b'0:7 - msg_type : HTT_T2H_MSG_TYPE_PEER_STATS_IND
  12000. * dword0 - b'8:31 - reserved : Reserved for future use
  12001. *
  12002. * payload include below peer_stats information
  12003. * --------------------------------------------
  12004. * @TLV : HTT_PPDU_STATS_INFO_TLV
  12005. * @tx_success_bytes : total successful bytes in the PPDU.
  12006. * @tx_retry_bytes : total retried bytes in the PPDU.
  12007. * @tx_failed_bytes : total failed bytes in the PPDU.
  12008. * @tx_ratecode : rate code used for the PPDU.
  12009. * @is_ampdu : Indicates PPDU is AMPDU or not.
  12010. * @ba_ack_failed : BA/ACK failed for this PPDU
  12011. * b00 -> BA received
  12012. * b01 -> BA failed once
  12013. * b10 -> BA failed twice, when HW retry is enabled.
  12014. * @bw : BW
  12015. * b00 -> 20 MHz
  12016. * b01 -> 40 MHz
  12017. * b10 -> 80 MHz
  12018. * b11 -> 160 MHz (or 80+80)
  12019. * @sg : SGI enabled
  12020. * @s : skipped ratectrl
  12021. * @peer_id : peer id
  12022. * @tx_success_msdus : successful MSDUs
  12023. * @tx_retry_msdus : retried MSDUs
  12024. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  12025. * @tx_duration : Tx duration for the PPDU (microsecond units)
  12026. */
  12027. /**
  12028. * @brief HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID Message
  12029. *
  12030. * @details
  12031. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  12032. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  12033. * This message will only be sent if the backpressure condition has existed
  12034. * continuously for an initial period (100 ms).
  12035. * Repeat messages with updated information will be sent after each
  12036. * subsequent period (100 ms) as long as the backpressure remains unabated.
  12037. * This message indicates the ring id along with current head and tail index
  12038. * locations (i.e. write and read indices).
  12039. * The backpressure time indicates the time in ms for which continous
  12040. * backpressure has been observed in the ring.
  12041. *
  12042. * The message format is as follows:
  12043. *
  12044. * |31 24|23 16|15 8|7 0|
  12045. * |----------------+----------------+----------------+----------------|
  12046. * | ring_id | ring_type | pdev_id | msg_type |
  12047. * |-------------------------------------------------------------------|
  12048. * | tail_idx | head_idx |
  12049. * |-------------------------------------------------------------------|
  12050. * | backpressure_time_ms |
  12051. * |-------------------------------------------------------------------|
  12052. *
  12053. * The message is interpreted as follows:
  12054. * dword0 - b'0:7 - msg_type: This will be set to
  12055. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  12056. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  12057. * 1, 2, 3 indicates pdev_id 0,1,2 and
  12058. the msg is for LMAC ring.
  12059. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  12060. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  12061. * htt_backpressure_lmac_ring_id. This represents
  12062. * the ring id for which continous backpressure is seen
  12063. *
  12064. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  12065. * the ring indicated by the ring_id
  12066. *
  12067. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  12068. * the ring indicated by the ring id
  12069. *
  12070. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  12071. * backpressure has been seen in the ring
  12072. * indicated by the ring_id.
  12073. * Units = milliseconds
  12074. */
  12075. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  12076. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  12077. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  12078. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  12079. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  12080. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  12081. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  12082. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  12083. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  12084. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  12085. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  12086. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  12087. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  12088. do { \
  12089. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  12090. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  12091. } while (0)
  12092. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  12093. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  12094. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  12095. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  12096. do { \
  12097. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  12098. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  12099. } while (0)
  12100. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  12101. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  12102. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  12103. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  12104. do { \
  12105. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  12106. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  12107. } while (0)
  12108. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  12109. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  12110. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  12111. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  12112. do { \
  12113. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  12114. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  12115. } while (0)
  12116. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  12117. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  12118. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  12119. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  12120. do { \
  12121. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  12122. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  12123. } while (0)
  12124. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  12125. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  12126. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  12127. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  12128. do { \
  12129. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  12130. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  12131. } while (0)
  12132. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  12133. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  12134. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  12135. enum htt_backpressure_ring_type {
  12136. HTT_SW_RING_TYPE_UMAC,
  12137. HTT_SW_RING_TYPE_LMAC,
  12138. HTT_SW_RING_TYPE_MAX,
  12139. };
  12140. /* Ring id for which the message is sent to host */
  12141. enum htt_backpressure_umac_ringid {
  12142. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  12143. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  12144. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  12145. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  12146. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  12147. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  12148. HTT_SW_RING_IDX_REO_REO2FW_RING,
  12149. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  12150. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  12151. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  12152. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  12153. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  12154. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  12155. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  12156. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  12157. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  12158. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  12159. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  12160. HTT_SW_UMAC_RING_IDX_MAX,
  12161. };
  12162. enum htt_backpressure_lmac_ringid {
  12163. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  12164. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  12165. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  12166. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  12167. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  12168. HTT_SW_RING_IDX_RXDMA2FW_RING,
  12169. HTT_SW_RING_IDX_RXDMA2SW_RING,
  12170. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  12171. HTT_SW_RING_IDX_RXDMA2REO_RING,
  12172. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  12173. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  12174. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  12175. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  12176. HTT_SW_LMAC_RING_IDX_MAX,
  12177. };
  12178. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  12179. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  12180. pdev_id: 8,
  12181. ring_type: 8, /* htt_backpressure_ring_type */
  12182. /*
  12183. * ring_id holds an enum value from either
  12184. * htt_backpressure_umac_ringid or
  12185. * htt_backpressure_lmac_ringid, based on
  12186. * the ring_type setting.
  12187. */
  12188. ring_id: 8;
  12189. A_UINT16 head_idx;
  12190. A_UINT16 tail_idx;
  12191. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  12192. } POSTPACK;
  12193. /*
  12194. * Defines two 32 bit words that can be used by the target to indicate a per
  12195. * user RU allocation and rate information.
  12196. *
  12197. * This information is currently provided in the "sw_response_reference_ptr"
  12198. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  12199. * "rx_ppdu_end_user_stats" TLV.
  12200. *
  12201. * VALID:
  12202. * The consumer of these words must explicitly check the valid bit,
  12203. * and only attempt interpretation of any of the remaining fields if
  12204. * the valid bit is set to 1.
  12205. *
  12206. * VERSION:
  12207. * The consumer of these words must also explicitly check the version bit,
  12208. * and only use the V0 definition if the VERSION field is set to 0.
  12209. *
  12210. * Version 1 is currently undefined, with the exception of the VALID and
  12211. * VERSION fields.
  12212. *
  12213. * Version 0:
  12214. *
  12215. * The fields below are duplicated per BW.
  12216. *
  12217. * The consumer must determine which BW field to use, based on the UL OFDMA
  12218. * PPDU BW indicated by HW.
  12219. *
  12220. * RU_START: RU26 start index for the user.
  12221. * Note that this is always using the RU26 index, regardless
  12222. * of the actual RU assigned to the user
  12223. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  12224. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  12225. *
  12226. * For example, 20MHz (the value in the top row is RU_START)
  12227. *
  12228. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  12229. * RU Size 1 (52): | | | | | |
  12230. * RU Size 2 (106): | | | |
  12231. * RU Size 3 (242): | |
  12232. *
  12233. * RU_SIZE: Indicates the RU size, as defined by enum
  12234. * htt_ul_ofdma_user_info_ru_size.
  12235. *
  12236. * LDPC: LDPC enabled (if 0, BCC is used)
  12237. *
  12238. * DCM: DCM enabled
  12239. *
  12240. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  12241. * |---------------------------------+--------------------------------|
  12242. * |Ver|Valid| FW internal |
  12243. * |---------------------------------+--------------------------------|
  12244. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  12245. * |---------------------------------+--------------------------------|
  12246. */
  12247. enum htt_ul_ofdma_user_info_ru_size {
  12248. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  12249. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  12250. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  12251. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  12252. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  12253. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  12254. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  12255. };
  12256. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  12257. struct htt_ul_ofdma_user_info_v0 {
  12258. A_UINT32 word0;
  12259. A_UINT32 word1;
  12260. };
  12261. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  12262. A_UINT32 w0_fw_rsvd:30; \
  12263. A_UINT32 w0_valid:1; \
  12264. A_UINT32 w0_version:1;
  12265. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  12266. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  12267. };
  12268. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  12269. A_UINT32 w1_nss:3; \
  12270. A_UINT32 w1_mcs:4; \
  12271. A_UINT32 w1_ldpc:1; \
  12272. A_UINT32 w1_dcm:1; \
  12273. A_UINT32 w1_ru_start:7; \
  12274. A_UINT32 w1_ru_size:3; \
  12275. A_UINT32 w1_trig_type:4; \
  12276. A_UINT32 w1_unused:9;
  12277. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  12278. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  12279. };
  12280. /* htt_up_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  12281. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  12282. union {
  12283. A_UINT32 word0;
  12284. struct {
  12285. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  12286. };
  12287. };
  12288. union {
  12289. A_UINT32 word1;
  12290. struct {
  12291. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  12292. };
  12293. };
  12294. } POSTPACK;
  12295. enum HTT_UL_OFDMA_TRIG_TYPE {
  12296. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  12297. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  12298. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  12299. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  12300. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  12301. };
  12302. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  12303. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  12304. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  12305. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  12306. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  12307. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  12308. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  12309. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  12310. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  12311. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  12312. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  12313. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  12314. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  12315. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  12316. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  12317. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  12318. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  12319. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  12320. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  12321. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  12322. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  12323. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  12324. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  12325. /*--- word 0 ---*/
  12326. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  12327. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  12328. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  12329. do { \
  12330. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  12331. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  12332. } while (0)
  12333. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  12334. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  12335. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  12336. do { \
  12337. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  12338. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  12339. } while (0)
  12340. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  12341. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  12342. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  12343. do { \
  12344. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  12345. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  12346. } while (0)
  12347. /*--- word 1 ---*/
  12348. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  12349. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  12350. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  12351. do { \
  12352. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  12353. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  12354. } while (0)
  12355. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  12356. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  12357. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  12358. do { \
  12359. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  12360. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  12361. } while (0)
  12362. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  12363. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  12364. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  12365. do { \
  12366. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  12367. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  12368. } while (0)
  12369. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  12370. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  12371. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  12372. do { \
  12373. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  12374. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  12375. } while (0)
  12376. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  12377. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  12378. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  12379. do { \
  12380. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  12381. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  12382. } while (0)
  12383. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  12384. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  12385. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  12386. do { \
  12387. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  12388. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  12389. } while (0)
  12390. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  12391. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  12392. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  12393. do { \
  12394. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  12395. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  12396. } while (0)
  12397. /**
  12398. * @brief target -> host channel calibration data message
  12399. * @brief host -> target channel calibration data message
  12400. *
  12401. * @details
  12402. * The following field definitions describe the format of the channel
  12403. * calibration data message sent from the target to the host when
  12404. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  12405. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  12406. * The message is defined as htt_chan_caldata_msg followed by a variable
  12407. * number of 32-bit character values.
  12408. *
  12409. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  12410. * |------------------------------------------------------------------|
  12411. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  12412. * |------------------------------------------------------------------|
  12413. * | payload size | mhz |
  12414. * |------------------------------------------------------------------|
  12415. * | center frequency 2 | center frequency 1 |
  12416. * |------------------------------------------------------------------|
  12417. * | check sum |
  12418. * |------------------------------------------------------------------|
  12419. * | payload |
  12420. * |------------------------------------------------------------------|
  12421. * message info field:
  12422. * - MSG_TYPE
  12423. * Bits 7:0
  12424. * Purpose: identifies this as a channel calibration data message
  12425. * Value: HTT_T2H_MSG_TYPE_CHAN_CALDATA (0x15) or
  12426. * HTT_H2T_MSG_TYPE_CHAN_CALDATA (0xb)
  12427. * - SUB_TYPE
  12428. * Bits 11:8
  12429. * Purpose: T2H: indicates whether target is providing chan cal data
  12430. * to the host to store, or requesting that the host
  12431. * download previously-stored data.
  12432. * H2T: indicates whether the host is providing the requested
  12433. * channel cal data, or if it is rejecting the data
  12434. * request because it does not have the requested data.
  12435. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  12436. * - CHKSUM_VALID
  12437. * Bit 12
  12438. * Purpose: indicates if the checksum field is valid
  12439. * value:
  12440. * - FRAG
  12441. * Bit 19:16
  12442. * Purpose: indicates the fragment index for message
  12443. * value: 0 for first fragment, 1 for second fragment, ...
  12444. * - APPEND
  12445. * Bit 20
  12446. * Purpose: indicates if this is the last fragment
  12447. * value: 0 = final fragment, 1 = more fragments will be appended
  12448. *
  12449. * channel and payload size field
  12450. * - MHZ
  12451. * Bits 15:0
  12452. * Purpose: indicates the channel primary frequency
  12453. * Value:
  12454. * - PAYLOAD_SIZE
  12455. * Bits 31:16
  12456. * Purpose: indicates the bytes of calibration data in payload
  12457. * Value:
  12458. *
  12459. * center frequency field
  12460. * - CENTER FREQUENCY 1
  12461. * Bits 15:0
  12462. * Purpose: indicates the channel center frequency
  12463. * Value: channel center frequency, in MHz units
  12464. * - CENTER FREQUENCY 2
  12465. * Bits 31:16
  12466. * Purpose: indicates the secondary channel center frequency,
  12467. * only for 11acvht 80plus80 mode
  12468. * Value: secondary channel center frequeny, in MHz units, if applicable
  12469. *
  12470. * checksum field
  12471. * - CHECK_SUM
  12472. * Bits 31:0
  12473. * Purpose: check the payload data, it is just for this fragment.
  12474. * This is intended for the target to check that the channel
  12475. * calibration data returned by the host is the unmodified data
  12476. * that was previously provided to the host by the target.
  12477. * value: checksum of fragment payload
  12478. */
  12479. PREPACK struct htt_chan_caldata_msg {
  12480. /* DWORD 0: message info */
  12481. A_UINT32
  12482. msg_type: 8,
  12483. sub_type: 4 ,
  12484. chksum_valid: 1, /** 1:valid, 0:invalid */
  12485. reserved1: 3,
  12486. frag_idx: 4, /** fragment index for calibration data */
  12487. appending: 1, /** 0: no fragment appending,
  12488. * 1: extra fragment appending */
  12489. reserved2: 11;
  12490. /* DWORD 1: channel and payload size */
  12491. A_UINT32
  12492. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  12493. payload_size: 16; /** unit: bytes */
  12494. /* DWORD 2: center frequency */
  12495. A_UINT32
  12496. band_center_freq1: 16, /** Center frequency 1 in MHz */
  12497. band_center_freq2: 16; /** Center frequency 2 in MHz,
  12498. * valid only for 11acvht 80plus80 mode */
  12499. /* DWORD 3: check sum */
  12500. A_UINT32 chksum;
  12501. /* variable length for calibration data */
  12502. A_UINT32 payload[1/* or more */];
  12503. } POSTPACK;
  12504. /* T2H SUBTYPE */
  12505. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  12506. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  12507. /* H2T SUBTYPE */
  12508. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  12509. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  12510. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  12511. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  12512. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  12513. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  12514. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  12515. do { \
  12516. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  12517. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  12518. } while (0)
  12519. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  12520. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  12521. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  12522. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  12523. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  12524. do { \
  12525. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  12526. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  12527. } while (0)
  12528. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  12529. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  12530. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  12531. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  12532. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  12533. do { \
  12534. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  12535. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  12536. } while (0)
  12537. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  12538. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  12539. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  12540. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  12541. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  12542. do { \
  12543. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  12544. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  12545. } while (0)
  12546. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  12547. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  12548. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  12549. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  12550. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  12551. do { \
  12552. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  12553. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  12554. } while (0)
  12555. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  12556. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  12557. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  12558. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  12559. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  12560. do { \
  12561. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  12562. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  12563. } while (0)
  12564. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  12565. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  12566. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  12567. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  12568. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  12569. do { \
  12570. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  12571. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  12572. } while (0)
  12573. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  12574. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  12575. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  12576. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  12577. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  12578. do { \
  12579. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  12580. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  12581. } while (0)
  12582. #endif